Re: [Tutor] random number guessing game

2007-05-08 Thread Rikard Bosnjakovic
On 5/9/07, Bob Gailer <[EMAIL PROTECTED]> wrote: [...] > If you don't have to include it, please consider omitting it. Considering the OP's domain name, he might not be able to omit it. -- - Rikard - http://bos.hack.org/cv/ ___ Tutor maillist - Tu

Re: [Tutor] random number guessing game

2007-05-08 Thread Bob Gailer
Treloar, Nick wrote: i am tying to buil a program using child screens the program is going the make a random number and the user has to guess it .   so far i have made the gui  but how do i progame it to make the random number Use the random module. Look it up in the Python doc

[Tutor] random number guessing game

2007-05-08 Thread Treloar, Nick
i am tying to buil a program using child screens the program is going the make a random number and the user has to guess it . so far i have made the gui but how do i progame it to make the random number This message is intended for the addressee named and may contain privileged information or

[Tutor] number guessing game

2007-05-08 Thread Treloar, Nick
here is my code so far from Tkinter import* root = Tk() root.title("main screen") root.maxsize(width=350,height=200) root.minsize(width=350,height=200) root.resizable(width=YES,height=YES) def child1(): c1 = Toplevel(root) c1.guess_ent = Entry(c1, width = 35,) c1.guess_ent.grid(row = 1

Re: [Tutor] Newbie Question on Exceptions...

2007-05-08 Thread John Fouhy
On 09/05/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > try: > print "The fridge contains %s" %fridge[food_sought] > except (KeyError): > print "The fridge does not contain %s"%food_sought [...] > Is the same true of Python? Or is ok to use Exception handling like the book > suggests?

Re: [Tutor] Newbie Question on Exceptions...

2007-05-08 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote > fridge={"apple":"A shiny red apple","pear":"a nice ripe > pear","grapes":"seadless grapes"} > food_sought="apple" > fridge_list=fridge.keys(); Not sure what this line is for... > try: >print "The fridge contains %s" %fridge[food_sought] > except (KeyError): >

Re: [Tutor] Newbie Question on Exceptions...

2007-05-08 Thread Andre Engels
2007/5/8, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > I'm working my way through the book "beginning python" and I came across an > exercise that suggests using Exception trapping to see if a value is in a > dictionary: > > fridge={"apple":"A shiny red apple","pear":"a nice ripe > pear","grapes":"s

Re: [Tutor] Newbie Question on Exceptions...

2007-05-08 Thread Bob Gailer
[EMAIL PROTECTED] wrote: > I'm working my way through the book "beginning python" and I came across an > exercise that suggests using Exception trapping to see if a value is in a > dictionary: > > fridge={"apple":"A shiny red apple","pear":"a nice ripe > pear","grapes":"seadless grapes"} > food_

[Tutor] Newbie Question on Exceptions...

2007-05-08 Thread dsh0105
I'm working my way through the book "beginning python" and I came across an exercise that suggests using Exception trapping to see if a value is in a dictionary: fridge={"apple":"A shiny red apple","pear":"a nice ripe pear","grapes":"seadless grapes"} food_sought="apple" fridge_list=fridge.keys

Re: [Tutor] base directory

2007-05-08 Thread ALAN GAULD
>> Except that there is a conventional set of names so a >> better path would be: >> >> /usr/local/bin/fileName.py >That's incredibly helpful. As another Linux noob, would you mind if I >jump in with 2 follow-up questions: > >To continue the example above, for say, Opera and CoolEditor, I'd use

Re: [Tutor] Running and passing variables to/from Fortran

2007-05-08 Thread Alan Gauld
"John Washakie" <[EMAIL PROTECTED]> wrote >I have a FORTRAN program which reads in unformatted sparse matrix > data. Rather than rewriting the code in Python, I was hoping there > is > a way to call the Fortran program, passing filename variables TO > Fortran, and returning the data (which is an

Re: [Tutor] Basic image editing program in python

2007-05-08 Thread Alan Gauld
"Antonio Diaz" <[EMAIL PROTECTED]> wrote > I have a project in school and I was wondering if its > possible to make a python program that uses > Imaging library to make a GUI of the same functions > that Imaging has. Yes thats very possible. > If its possible to make it in glade.? I assume

Re: [Tutor] can python run under windows 95?

2007-05-08 Thread Alan Gauld
"Alexander Kapshuk" <[EMAIL PROTECTED]> wrote > I've got an old Toshiba Satellite 110CT laptop with Windows 95 > > Would I be able to run Python on it? > If so, what version of Python should I install? Python 1.5.1 definitely works on Win95. I suspect v2.0 will too. The 32 bit DOS version wil

Re: [Tutor] trying to figure out what this means

2007-05-08 Thread Alan Gauld
"Dave C" <[EMAIL PROTECTED]> wrote > when you are doing print these two characters keep showing up in > this book > "%s" % > > What do they do? Its called string formatting. %s means insert a string(the s) here. %d means insert a decimal number(the d) here There are a whole bunch of other codes

Re: [Tutor] command lines

2007-05-08 Thread Alan Gauld
"Rikard Bosnjakovic" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 5/6/07, Jason Coggins <[EMAIL PROTECTED]> wrote: > >> Is there a way to send a command to the Linux Terminal >> from inside a Python program? To be picky you don't send the command to the Terminal but to the OS

Re: [Tutor] base directory

2007-05-08 Thread Alan Gauld
"Jason Coggins" <[EMAIL PROTECTED]> wrote > I am new to Linux. On Windows the base directory > is c:\. Or D:\ or E:\ etc... In other words Windows has many base directories, one per physical drive. > What is the base directory for Linux? In *nix there is only one logical directory structur

Re: [Tutor] exec syntax

2007-05-08 Thread Alan Gauld
"Rikard Bosnjakovic" <[EMAIL PROTECTED]> wrote >> I can see how to use it to execute a script of code embedded in the >> program >> (that example was provided in the documentation) but I cannot >> figure out the >> syntax to use it to run another python program in another file. > > Use execfile

Re: [Tutor] Help python coding not working

2007-05-08 Thread Luke Paireepinart
super krital wrote: > Hi need to get this program running for school so my teacher said to use the > forum etc. Its working fine except its not comparing my guess with the > result. im only having trouble with the second half or def update_text_count > can you please help find a solution so my p

[Tutor] Trouble creating DB2 drivers

2007-05-08 Thread Jason Meiers
Hi, Where you ever able to get this issue resolved, I've got the same issue? http://mail.python.org/pipermail/tutor/2007-February/052994.html Best Regards, Jason Meiers Production Monitoring Pay By Touch -- 101 2nd Street, Suite 1500 S