Re: [Tutor] Re: If elif not working in comparison

2005-04-17 Thread Danny Yoo
On Sun, 17 Apr 2005, gerardo arnaez wrote: > I have finished a coumadin dose calcalutor > but want to have it work via a web interface. > > The base code is here > http://mung.net/~dude/coumadinAll.html > > but not sure what would be the next step in getting this working > on the web. Hi Gerar

Re: [Tutor] Has anyone ever tried to convert the textual output of the dis module to another language

2005-04-17 Thread Danny Yoo
> > Just curious. Googling for 'python "dis module" convert "another > > language" ' only got two hits. So maybe no one is trying it? I was > > just daydreaming about a native python compiler, and wondered how > > feasible it would be. > > You might be interested in Pyrex and Psyco: > http://www.co

Re: [Tutor] help

2005-04-17 Thread Danny Yoo
On Sun, 17 Apr 2005, james middendorff wrote: > I was wondering if there was a tutorial and or module that would help me > create a program to use a parallel port to turn on/off a device in > linux? I have searched but cannot find a tutorial on a good way to do > this. The whole project would be

[Tutor] help

2005-04-17 Thread james middendorff
Hello, I was wondering if there was a tutorial and or module that would help me create a program to use a parallel port to turn on/off a device in linux? I have searched but cannot find a tutorial on a good way to do this. The whole project would be to use a parallel port to control solid state re

[Tutor] Problems with encodings

2005-04-17 Thread Olli Rajala
Hi! Been offlist for a while, but now I started to code an administration tool for my own photo gallery and have some troubles, so thought to write and ask some help. :) So, I'm from Finland and I'm using ISO-8859-15 -encoding but Python don't "understand" letters outside ASCII. I've read PEP-0263

Re: [Tutor] Re: Exceptions

2005-04-17 Thread Diana Hawksworth
Golden indeed, Brian! Works like a charm! Thanks heaps. Diana ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Has anyone ever tried to convert the textual output of the dis module to another language

2005-04-17 Thread Sean Perry
R. Alan Monroe wrote: The main things about it that would make it appealing to me: #1 - MUCH MUCH MUCH smaller exes. Speed is not an issue to me, but filesize is. Have you ever compiled "Hello world" in a new language, and found that the exe was 100K+, when it really only needs to be less than 1K?

Re: [Tutor] Re: Exceptions

2005-04-17 Thread Brian van den Broek
Diana Hawksworth said unto the world upon 2005-04-17 20:05: Brian - thanks for your continuing help! Here is ALL of the code. Sure hope you can help. Cheers. Diana Hi Diana, whew! A bit of an adventure, but I think I've got it. (The adventure comes in as I have used Tkinter about twice. I've don

Re: [Tutor] displaying images

2005-04-17 Thread Diana Hawksworth
Ahhh! Thanks Kent. Shall give that a try. Diana - Original Message - From: "Kent Johnson" <[EMAIL PROTECTED]> To: "Diana Hawksworth" <[EMAIL PROTECTED]> Cc: Sent: Monday, April 18, 2005 11:39 AM Subject: Re: [Tutor] displaying images > Diana Hawksworth wrote: > > Hello list! I am work

Re: [Tutor] displaying images

2005-04-17 Thread Kent Johnson
Diana Hawksworth wrote: Hello list! I am working through "Programming Python" by Mark Lutz. I am puzzled by the following script - as I am not certain what the "../gifs/" means, even though Lutz explains it by saying it is the reference for a GIF stored "in another directory". I have tried to

[Tutor] displaying images

2005-04-17 Thread Diana Hawksworth
Hello list!  I am working through "Programming Python" by Mark Lutz. I am puzzled by the following script - as I am not certain what the "../gifs/" means, even though Lutz explains it by saying it is the reference for a GIF stored  "in another directory". I have tried to adapt it - using my

[Tutor] Re: Exceptions

2005-04-17 Thread Diana Hawksworth
Brian - thanks for your continuing help! Here is ALL of the code. Sure hope you can help. Cheers. Diana # Number 10 # A Guess the Number program # Hawksworth - 28/3/05 from Tkinter import * import random class Application(Frame): """ GUI application - guess the number game. """ def __

Re: [Tutor] Has anyone ever tried to convert the textual output ofthe dis module to another language

2005-04-17 Thread Alan Gauld
> #1 - MUCH MUCH MUCH smaller exes. Speed is not an issue to me, but > filesize is. Have you ever compiled "Hello world" in a new language, > and found that the exe was 100K+, when it really only needs to be less > than 1K? It is occasionally possible to get such small exes - it used to be possibl

Re: [Tutor] TKinter and things over Linux

2005-04-17 Thread Alberto Troiano
 Gaucho Hey everyone I have Python 2.3 installed and when I try to import Tkinter I get the following error> >>>import Tkinter Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.3/lib-tk/Tkinter.py", line 38, in ? import _tkinter # If this fails your

Re: [Tutor] More Function Questions (Joseph Q.)

2005-04-17 Thread Alan Gauld
> So what do you use the > def bar(x, y): > return x + y > > bar(4, 5) > > functions for? (I just need a simple example) As an illustration of what a functionlooks like bar is fine but as it stands it's not a great example of a real function for several reasons: 1) The name is not descriptive

Re: [Tutor] Has anyone ever tried to convert the textual output ofthe dis module to another language

2005-04-17 Thread Alan Gauld
Sorry to be picky but... > Witness gcc -- the C language has been around for 30 years, the most > widely used for 20, Depends how you define 'most widely used' I guess but the language with most code and the most programming jobs is still COBOL(*) by a long margin. And going by jobs Java overtook

Re: [Tutor] Has anyone ever tried to convert the textual output of the dis module to another language

2005-04-17 Thread R. Alan Monroe
> R. Alan Monroe wrote: >> Just curious. Googling for 'python "dis module" convert "another >> language" ' only got two hits. So maybe no one is trying it? I was >> just daydreaming about a native python compiler, and wondered how >> feasible it would be. >> > There is already a python -> exe con

Re: [Tutor] OO newbie

2005-04-17 Thread Alan Gauld
Just back from vacation - hence the delayed response... > > super is just a convenience feature added to make Python slightly > > more like some other OOP languages. It is effectively just a > > wrapper around the explicit call to the super class: > > No, super() is much smarter than that and was

Re: [Tutor] Re: If elif not working in comparison

2005-04-17 Thread gerardo arnaez
Hi all. I have finished a coumadin dose calcalutor but want to have it work via a web interface. The base code is here http://mung.net/~dude/coumadinAll.html but not sure what would be the next step in getting this working on the web. is, I want someone to use a web interface and type in INR,

Re: [Tutor] Sort a list into equal sized chunks

2005-04-17 Thread Kent Johnson
Klas Marteleur wrote: Thanks Kent Your program does what i wanted to accomplish. But i dont really know why, and that disturbs me. I guess its the class that confuses me. Could you or sombody else on this list help me out by putting some words on what is happening in this program, and in which

Re: [Tutor] More Function Questions (Joseph Q.)

2005-04-17 Thread Brian van den Broek
Joseph Quigley said unto the world upon 2005-04-17 12:29: Hi all, Another function question. def bar(x, y): return x + y bar(4, 5) So I can put anything I want in there. What good is a function like that? Of course I know about. def foo(): print "Hello all you who subscribe to the Pytho

Re: [Tutor] More Function Questions (Joseph Q.)

2005-04-17 Thread Lee Cullens
I think your looking at it too literally Joseph. Rather than any one example, think of a function as a block of code that is used in more than one place in your program. The x + y block of code is just a simplistic representation, intended to illustrate without the distracting complications o

Re: [Tutor] More Function Questions (Joseph Q.)

2005-04-17 Thread Max Noel
On Apr 17, 2005, at 17:29, Joseph Quigley wrote: So what do you use the def bar(x, y): return x + y bar(4, 5) functions for? (I just need a simple example) Whenever you have something that you may want to do more than once and/or in more than one place in your program. Here's a small exam

Re: [Tutor] More Function Questions (Joseph Q.)

2005-04-17 Thread Jacob S.
Hi all, Another function question. def bar(x, y): return x + y bar(4, 5) So I can put anything I want in there. What good is a function like that? Alright, so what good is this function? def bar(x,y,z): ##Where in this case x, y, and z are strings return x+z+y bar("a","b","-") 'a-b' bar("1

Re: [Tutor] Re: Eceptions

2005-04-17 Thread Brian van den Broek
Diana Hawksworth said unto the world upon 2005-04-16 17:39: > Diana Hawksworth said unto the world upon 2005-04-15 22:25: > > Hello list, > > > > I have been trying to trap a string entry by raising an exception. The code follows - but the exception is never raised. What am I doing

Re: [Tutor] Sort a list into equal sized chunks

2005-04-17 Thread Klas Marteleur
Thanks Kent Your program does what i wanted to accomplish. But i dont really know why, and that disturbs me. I guess its the class that confuses me. Could you or sombody else on this list help me out by putting some words on what is happening in this program, and in which order things are done

[Tutor] More Function Questions (Joseph Q.)

2005-04-17 Thread Joseph Quigley
Hi all, Another function question. def bar(x, y): return x + y bar(4, 5) So I can put anything I want in there. What good is a function like that? Of course I know about. def foo(): print "Hello all you who subscribe to the Python Tutor mailing list!" So what do you use the def

Re: [Tutor] Has anyone ever tried to convert the textual output of the dis module to another language

2005-04-17 Thread Kent Johnson
R. Alan Monroe wrote: Just curious. Googling for 'python "dis module" convert "another language" ' only got two hits. So maybe no one is trying it? I was just daydreaming about a native python compiler, and wondered how feasible it would be. You might be interested in Pyrex and Psyco: http://www.co

Re: [Tutor] Has anyone ever tried to convert the textual output of the dis module to another language

2005-04-17 Thread Max Noel
On Apr 17, 2005, at 16:51, Sean Perry wrote: R. Alan Monroe wrote: Just curious. Googling for 'python "dis module" convert "another language" ' only got two hits. So maybe no one is trying it? I was just daydreaming about a native python compiler, and wondered how feasible it would be. There is alr

Re: [Tutor] Has anyone ever tried to convert the textual output of the dis module to another language

2005-04-17 Thread Sean Perry
R. Alan Monroe wrote: Just curious. Googling for 'python "dis module" convert "another language" ' only got two hits. So maybe no one is trying it? I was just daydreaming about a native python compiler, and wondered how feasible it would be. There is already a python -> exe converter. Comes up on t