On 03/16/2011 09:15 AM, bhavanasi sarath wrote:
i want to learn how to compress a folder which is having some text
filesbut compress that from another directory..
http://docs.python.org/library/zipfile.html
(Sorry for the HTML email, getting things set up on new workstation)
_
e x/range style). Is this the case or does the compiler do
> something clever here?
>
Only way to know is to check!
http://docs.python.org/library/timeit.html
--
Corey Richardson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
-Original Message-
From: ANKUR AGGARWAL
To: tutor
Sent: Sun, Mar 20, 2011 1:49 pm
Subject: [Tutor] Difference
Hey
want to know whats the difference between the pygame.display.update()
and pygame.display.flip()
An explanation with the example would be grea.
Thanks In Advance
Ankur Ag
;s what the shell does!
So, exit out of the Python interpreter before trying to run that command
(>>>exit, or Ctrl-D).
--
Corey Richardson
(Forgive the horrible formatting and HTML, on the road using a web
client)
___
Tutor maillist - Tut
On 03/28/2011 01:04 PM, markri...@gsoftcon.com wrote:
> When replying to the mailing list, does everyone just hit the reply button in
> your email program. Because that sends the email directly to your email. Also
> everyone is cc'ng the mailing list; is that the exceptable way to reply so
> eve
On 03/28/2011 06:17 PM, Steven D'Aprano wrote:
> Corey Richardson wrote:
>
>> Thunderbird has a "reply list" button that I use.
>
> It does? What version are you using?
3.1.8
I don't know how it knows what a mailing list is and isn't, but it does.
Af
e using Python 2,
you have no option but to use the first, as far as I know. Maybe Python
2.7 has that formatting, I'm not sure.
--
Corey Richardson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
minal, sudo apt-get install idle.
When you need software, search in Synaptic (Package Manager) or google
first, it's usually very accessible!
--
Corey Richardson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscr
hree elements of L aren't equal to each other. Due to
python's short-circuit evaluation, it breaks the if after the first one,
because '1' != '4'. The parentheses there are useless.
You might look at [1] to see if there is anything that will count how
many times somethi
e that except. Example:
try:
foo = int("blargh")
except ValueError:
pass
It looks like you're forgetting an important operation on the inches
variable, as well as centimeters later on.
Take a look at
http://docs.python.org/library/stdtypes.html#typesnumeric
For future que
e same list but with one occurrence per element:
>
> [cat, dog, tree, bird, woods]
>
> Any help much appreciated!
The set type enforces uniqueness:
http://docs.python.org/library/stdtypes.html#set
You would use list(set(l)) to get the list from l where everything is
unique.
- --
Core
a loop? If you add in a loop, it will also be fairly easy to add in
another loop to make sure they enter a name not in the list. So, your
pseudo-code might look something like this:
for i in range(6):
make prompt string;
get name;
while name in names_gotten:
get name;
add
ect has no attribute 'append'
Yes, because append belongs to list, and not str!
http://docs.python.org/tutorial/datastructures.html#more-on-lists
words = [
word = raw_input("Name #1: ")
words.append(word)
Keep in mind the rest of the email I sent, that part was one of the
least importa
7;t worry
about them right away.
For things like this I would recommend getting very familiar with
Python, and then picking up a bit of C.
- --
Corey Richardson
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
iQEcBAEBAgAGBQJN3rF9AAoJEAFAbo/KNFvp0nYH
7;s still very *very*
limited.
For webOS it looks like the only way you'll get Python is if you whip
together a C(++) program that statically links to it.
- --
Corey Richardson
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
iQEcBAEBAgAGBQJN67V8AAoJEAFAbo/KNFvpv/MH/088lDJ
printf("%s, age %d\n", d.name, d.age);
printf("Address: %s", d.address);
}
Encapsulate that, and you have yourself an object. OO isn't hard to do,
even (single!) inheritance isn't too great of a challenge. It's getting
things dynamic instead of static that'
t"))
> outfile.write("===\n")
It may just be me, but I think
outfile.write(('=' * 23) + '\n')
looks better.
>
> counts_list = counts.items()
> counts_list.sort()
> for word in counts_list:
> outfile.write("%-18s%d\n" %(word[0], word[1]))
>
> outfile.close
Parenthesis are important! outfile.close is a method object,
outfile.close() is a method call. Context managers make this easy,
because you don't have to manually close things.
Hope it helped,
--
Corey Richardson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
et me know if I am wrong...
>
A wise man once said,
> Could you please refrain from presenting your *religious* convictions
> in this list: the notions you believe in as well as the ones that you
> believe are false?
Could be applied to government too.
--
Corey Richardson
o see how things are done,
and is always a good learning experience.
Cheers,
- --
Corey Richardson
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
iQEcBAEBAgAGBQJN85uFAAoJEAFAbo/KNFvpaNoIAI0OeY7lnqdTR4AsdOdwZK0k
HrZ5xuEaXVyO6UArYvVynoB6cZF+hNGiYmIiv2IO/aYLCjU0WWAvSLfLGD4zgWFR
NnHdZvJ7
there is a port for Python 3 somewhere too. http://excess.org/urwid/
(Apologies if email is HTML, using a web client)
--
Corey Richardson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailma
he differences between i,l, | and 1 and '' and "
> and between ' and ` etc.
>
I use and love inconsolata[0], it's a great font for programming,
and looks great as well (both on screen and off).
[0] - http://www.levien.com/type/myfonts/inconsolata.html
-
your best bet would probably be Cloud9 or
a similar product.
--
Corey Richardson
"Those who deny freedom to others, deserve it not for themselves"
-- Abraham Lincoln
signature.asc
Description: PGP signature
___
Tutor maillist - Tutor
Excerpts from Tahir Hafiz's message of Thu Jul 21 16:24:22 -0400 2011:
> Cloud9 seems interesting as a browser based IDE. Do you know if there is a
> way to run Python code as well create/edit it?
>
Not as far as I know.
--
Corey Richardson
"Those who deny freedom to oth
figure it out. I saw the
"Run" button and its configuration, but it looks like it wants a JS file and
args? Or...maybe not?
--
Corey Richardson
"Those who deny freedom to others, deserve it not for themselves"
-- Abraham L
Excerpts from bob gailer's message of Thu Jul 21 17:21:01 -0400 2011:
> On 7/21/2011 12:30 PM, Corey Richardson wrote:
> > If you have a browser, Cloud9 IDE might be able to do it.
> I just tried Cloud9 and gave up in frustration.
>
> Unintuitive interfacre. No help. F
d level 2 or is there a way to
> just adjust the word (I used labels)
>
When working with tkinter, http://effbot.org/tkinterbook/ will likely be your
best friend. Specifically, you're going to want
your_label1.config(text="New word!")
your_label2.config(text="Another!&qu
e threading feature of your user
agent -- or switch to one that has said feature. I know recent thunderbird's
do it, if that's the sort of thing you're into. Thread view makes
things bucketloads easier.
--
Corey Richardson
"Those who deny freedom to others, deser
On Tue, 29 May 2012 17:50:37 -0700 (PDT)
PhantomsCore
wrote:
>
> if gameIsDone:
> if playAgain():
> missedLetters = ''
> correctLetters = ''
> gameIsDone = False
> secretWord = getRandomWord(words)
> else:
> break
#
>
> if [ $(id -u) != "0" ];then
>echo "This script must be run as root."
>exit 1
> fi
import os
if os.environ['USER'] != 'root':
print('This script must be run as root.')
exit(1)
e you can install all the
packages you want with pip, without having to worry about mucking up
the system, versions of things, etc.
Assuming Windows:
Good luck!
--
Corey Richardson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
stions?
(I've been away from Python for a bit, one of the other tutors might
correct me with better practice things, I'm rusty!)
--
Corey Richardson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
101 - 131 of 131 matches
Mail list logo