[Tutor] Problem with complex strings as key for a shelve-Dictionary

2009-09-06 Thread markus kossner
Dear all, I have a Problem with complex strings as keys in a shelve Object: #!/usr/bin/python import shelve test=shelve.open('testshelve') test={ 'CCN1c2c2/C(=C2/S/C(=N\c3ccc(Cl)cc3)N(C)C2=O)C1=O':int(0), 'CN1/C(=N\c2ccc(Cl)cc2)S/C(=C2\C(=O)Nc3c32)C1=O':int(20), 'c1cc2c(cc1)N(CCCl)C(=O)/C2

Re: [Tutor] Help deciding between python and ruby

2009-09-06 Thread kevin parks
Well, the only thing more annoying than off topic discussion is "meta" discussion on lists and folks passing judgement on other people's posts (ie. you should have x, your should not have Y... I shouldn't have this second doughnut, but you know what, i am gonna eat that *and* have a second

Re: [Tutor] mapping/filtering a sequence

2009-09-06 Thread kevin parks
I actually find the map biz easier to get my head around than the list comp. I guess this makes it another good reason for me to be happy that map is apparently staying in after nearly being depreciated. I generally prefer list comp in every instance, but the idea of an if else construct wi

Re: [Tutor] how to read and transmit/send only section of the image (sub-image)

2009-09-06 Thread Kent Johnson
On Sat, Sep 5, 2009 at 10:52 AM, Jojo Mwebaze wrote: > oooh that will be helpful,  kindly point me to how i can begin with getting > a sub-image that has the same width as the > original. That will be my starting point. I don't know the details of FITS format, but I imagine it would be something

Re: [Tutor] Problem with complex strings as key for a shelve-Dictionary

2009-09-06 Thread Kent Johnson
On Sun, Sep 6, 2009 at 6:20 AM, markus kossner wrote: > Dear all, > I have a Problem with complex strings as keys in a shelve Object: > > #!/usr/bin/python > import shelve > test=shelve.open('testshelve') > test={ > 'CCN1c2c2/C(=C2/S/C(=N\c3ccc(Cl)cc3)N(C)C2=O)C1=O':int(0), > 'CN1/C(=N\c2ccc(C

[Tutor] Simple Game

2009-09-06 Thread Corey Richardson
So far, I can use tuples/lists/dictionary's, and define some functions, and a bit of other things. Would it be hard for me to make a simple text rpg game? Or is there something else I should know before I try that. ___ Tutor maillist - Tutor@python.o

Re: [Tutor] Simple Game

2009-09-06 Thread Eric Dorsey
Hi Corey, If this is going to be a command line program, two things that immediately come to mind for me are: validating user input and persistence. If you put something like "(1) to attack, (2) to run" what if the user types "yes", or "Y", or "9"? You'll want to make sure your program doesn't cra

[Tutor] Pack/Unpack hacking

2009-09-06 Thread Tino Dai
Hi All, Hope the people in the US are having a nice Labor Day! I am looking for the source code for the pack/unpack functions found in the struct package. As of this email, I have tried a strings on the struct.pyc file. The inspection of the pyc file was hoping that I could find a stub to the

Re: [Tutor] Pack/Unpack hacking

2009-09-06 Thread Lucas Prado Melo
On Sun, Sep 6, 2009 at 3:20 PM, Tino Dai wrote: > Hi All, > > Hope the people in the US are having a nice Labor Day! I am looking for > the source code > for the pack/unpack functions found in the struct package. As of this > email, I have tried a > strings on the struct.pyc file. The inspect

[Tutor] A basic question

2009-09-06 Thread sharon
I have been trying how to get a any python program to run by clicking on the icon. I keep reading on the internet make it executable: chmod a+x try_python.py Where do I actually put the above expression so that it will work everytime. If I then sent this try_python.py to someone else with

Re: [Tutor] Pack/Unpack hacking

2009-09-06 Thread Tim Golden
Hope the people in the US are having a nice Labor Day! I am looking for the source code for the pack/unpack functions found in the struct package. As of this email, I have tried a strings on the struct.pyc file. The inspection of the pyc file was hoping that I could find a stub to the source.

Re: [Tutor] Pack/Unpack hacking

2009-09-06 Thread Kent Johnson
On Sun, Sep 6, 2009 at 2:20 PM, Tino Dai wrote: > Hi All, > >     Hope the people in the US are having a nice Labor Day! I am looking for > the source code > for the pack/unpack functions found in the struct package. As of this email, > I have tried a > strings on the struct.pyc file. The inspecti

Re: [Tutor] A basic question

2009-09-06 Thread Lucas Prado Melo
On Thu, Aug 6, 2009 at 4:20 PM, sharon wrote: > I have been trying how to get a any python program to run by clicking on > the icon. I keep reading on the internet make it executable: > > chmod a+x try_python.py > Did you write: #!/usr/bin/env python at the first line of the file too? > Wher

Re: [Tutor] A basic question

2009-09-06 Thread Alan Gauld
"sharon" wrote I have been trying how to get a any python program to run by clicking on the icon. I keep reading on the internet make it executable: chmod a+x try_python.py You do this in a console window, at a bash prompt. You also need to add the "shebang" line at the top of the file.

Re: [Tutor] Simple Game

2009-09-06 Thread Alan Gauld
"Corey Richardson" wrote So far, I can use tuples/lists/dictionary's, and define some functions, and a bit of other things. Would it be hard for me to make a simple text rpg game? Or is there something else I should know before I try that. No idea about rpg because I've never played one fa

Re: [Tutor] Help deciding between python and ruby

2009-09-06 Thread Luke Paireepinart
On Sun, Sep 6, 2009 at 10:21 AM, kevin parks wrote: > Well, the only thing more annoying than off topic discussion is "meta" > discussion on lists and folks passing judgement on other people's posts (ie. > you should have x, your should not have Y... I shouldn't have this second > doughnut, but y

Re: [Tutor] how to read and transmit/send only section of the image (sub-image)

2009-09-06 Thread Jojo Mwebaze
thanks a lot . cheers Johnson On Sun, Sep 6, 2009 at 4:23 PM, Kent Johnson wrote: > On Sat, Sep 5, 2009 at 10:52 AM, Jojo Mwebaze > wrote: > > oooh that will be helpful, kindly point me to how i can begin with > getting > > a sub-image that has the same width as the > > original. That will

Re: [Tutor] Tutor Digest, Vol 67, Issue 22

2009-09-06 Thread Corey Richardson
"Corey Richardson" wrote So far, I can use tuples/lists/dictionary's, and define some functions, and a bit of other things. Would it be hard for me to make a simple text rpg game? Or is there something else I should know before I try that. No idea about rpg because I've never pl

Re: [Tutor] Tutor Digest, Vol 67, Issue 22

2009-09-06 Thread Luke Paireepinart
> > >> Ummm, whats a branch? Haha, I know loops, but not branches. > A branch changes the program flow based on a condition. Example: x = int(raw_input("Please enter a number!")) if x > 10: print "Your number was greater than 10!" else: print "Your number was less than or equal to 10!" ___

Re: [Tutor] Help deciding between python and ruby

2009-09-06 Thread Alan Gauld
"Luke Paireepinart" wrote I agree, but I can see how some people don't like it. It's similar to the Java vs. C++ debate I guess, Java is forced OO and C++ is optional. While this is a genuine complaint for Java I have to be fair and say that Ruby does a good job of hiding its OOP purity w

Re: [Tutor] Tutor Digest, Vol 67, Issue 22

2009-09-06 Thread Alan Gauld
"Corey Richardson" wrote then you can program anything since sequences, loops and branches are all that are necessary to program anything! Ummm, whats a branch? Haha, I know loops, but not branches. Branches are if/else statements and case statements and jump or goto statements. In Pytho