[Tutor] Challenge [was Re: Why won't it enter the quiz?]

2005-09-21 Thread Nathan Pinno
I have a challenge for everyone on the tutor list. Take this serious, and don't think I'm asking it just because I am mad or something. I'm not, I just want to clear the air once and for all. Here is the challenge: Choose any program that I am selling on my site, any one of them, and ask me for

Re: [Tutor] Calling Modules in ActiveState 2.4

2005-09-21 Thread Danny Yoo
On Wed, 21 Sep 2005, Bob Nienhuis wrote: > When I do: > import sys > sys.exit(0) > I get: > Traceback (most recent call last): > File "C:\Python24\Lib\site-packages\pythonwin\pywin\scintilla\bindings.py", > line 141, in fire > rc = apply(binding.handler, args) > File "C:\Python24\Lib\site-packag

Re: [Tutor] Calling Modules in ActiveState 2.4

2005-09-21 Thread Bob Nienhuis
Just tried again. Got: >>> import sys >>> sys.exit() Firing event 'ProcessEnter' failed. Traceback (most recent call last):   File "C:\Python24\Lib\site-packages\pythonwin\pywin\scintilla\bindings.py", line 141, in fire     rc = apply(binding.handler, args)   File "C:\Python24\Lib\site-packages\pyt

Re: [Tutor] Calling Modules in ActiveState 2.4

2005-09-21 Thread Bob Nienhuis
When I do: import sys sys.exit(0) I get: Traceback (most recent call last):   File "C:\Python24\Lib\site-packages\pythonwin\pywin\scintilla\bindings.py", line 141, in fire     rc = apply(binding.handler, args)   File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\interact.py", line 478,

Re: [Tutor] Calling Modules in ActiveState 2.4

2005-09-21 Thread Danny Yoo
Hi Bob, Bob, when you see these kinds of errors, please don't paraphrase the error message. You mentioned: > > When I call: > > import sys > > sys.exit() > > I get a traceback error saying it needs more input Instead of putting the error in your own, just copy-and-paste the error. Don't worry

Re: [Tutor] Calling Modules in ActiveState 2.4

2005-09-21 Thread Damien Gouteux
For exit: You need to put an argument (more input) : import sys sys.exit(0) The argument of exit is the return value of your script (0 = okay, other = problem). sys.path is an attribute (of type list) of sys not a function. So don't put () after path. I hope it will help. Damien. Bob Nienhuis

[Tutor] Calling Modules in ActiveState 2.4

2005-09-21 Thread Bob Nienhuis
Working my way through Alan Gauld's tutorial, and I am on the section on modules. When I call: import sys sys.exit() I get a traceback error saying it needs more input Same when I do: import sys print sys.path() Both of these work if I do sys.exit or print sys.path without the parentheses. Is th

Re: [Tutor] Python Editors (particualrly Vim)

2005-09-21 Thread Ed Singleton
I don't believe there's any kinds of wars on this mailing group. :) I found this Python Vim code completion thing in my searches today: http://freshmeat.net/projects/pydiction/ Don't know how good it is, but it looks like it'd do the job. Ed On 21/09/05, Gabriel Farrell <[EMAIL PROTECTED]> wro

Re: [Tutor] cgi.FieldStorage to int

2005-09-21 Thread Adam Cripps
On 9/21/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Adam Cripps wrote: > > On 9/21/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > > > >>Adam Cripps wrote: > >> > >>>I'm trying to get a cgi.FieldStorage into an int. > >>> > >>>The input is in numeric form, as it is provided by an > >>>drop-down bo

Re: [Tutor] Error frameworks

2005-09-21 Thread DS
>>(Please reply to the tutor list, not to me privately) whoops >>Generally, you want to catch the exception at the level that knows what to do >>about it. Your function2() isn't handling the exception in any meaningful >>sense, it is just converting it to a magic return value. You might as well

Re: [Tutor] dialog boxes for Windows

2005-09-21 Thread Kent Johnson
Victor Reijs wrote: > Hello all of you, > > I want to use yes/no-, text-, info-, checklist- dialog boxes in my image > manipulation program (on a Windows XP Pro system using python 2.2 and > 2.3). What is the best way to do this? If your program does not have a GUI and you want to add some simple

[Tutor] Python, vim, indentation, and wrapped lines

2005-09-21 Thread Poor Yorick
I use Vim as my primary Python code editor. I've always wondered if there is a way to make wrapped lines take on the indentation of the previous line. Of course I mean *in the display only*, since I don't want any newlines introduced. This would also be handy for me when editing indented htm

[Tutor] dialog boxes for Windows

2005-09-21 Thread Victor Reijs
Hello all of you, I want to use yes/no-, text-, info-, checklist- dialog boxes in my image manipulation program (on a Windows XP Pro system using python 2.2 and 2.3). What is the best way to do this? Do peopel have some examples or links? I want to know which python modules are needed and where t

Re: [Tutor] cgi.FieldStorage to int

2005-09-21 Thread Kent Johnson
Adam Cripps wrote: > On 9/21/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > >>Adam Cripps wrote: >> >>>I'm trying to get a cgi.FieldStorage into an int. >>> >>>The input is in numeric form, as it is provided by an >>>drop-down box. However, when I try >>> >>>timestable = int(form.getvalue('timesta

Re: [Tutor] cgi.FieldStorage to int

2005-09-21 Thread Adam Cripps
On 9/21/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Adam Cripps wrote: > > I'm trying to get a cgi.FieldStorage into an int. > > > > The input is in numeric form, as it is provided by an > > drop-down box. However, when I try > > > > timestable = int(form.getvalue('timestable')) > > > > I get an

Re: [Tutor] cgi.FieldStorage to int

2005-09-21 Thread Kent Johnson
Adam Cripps wrote: > I'm trying to get a cgi.FieldStorage into an int. > > The input is in numeric form, as it is provided by an > drop-down box. However, when I try > > timestable = int(form.getvalue('timestable')) > > I get an error that the type is None - I guess this is because > FieldStora

Re: [Tutor] Error frameworks

2005-09-21 Thread Kent Johnson
(Please reply to the tutor list, not to me privately) DS wrote: > Thanks for looking at my problem. Let me try to explain what bothers me > about raising an error: > > Below is a brain-dead example of one function calling another which > calls another. If in function3 I raise an error, function

[Tutor] cgi.FieldStorage to int

2005-09-21 Thread Adam Cripps
I'm trying to get a cgi.FieldStorage into an int. The input is in numeric form, as it is provided by an drop-down box. However, when I try timestable = int(form.getvalue('timestable')) I get an error that the type is None - I guess this is because FieldStorage is a class. However, I've trawled

[Tutor] FW: Python Editors (particualrly Vim)

2005-09-21 Thread George Flaherty
forwarding. From: Pujo Aji [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 21, 2005 2:39 PMTo: George FlahertySubject: Re: [Tutor] Python Editors (particualrly Vim) I tried pydev, xemacs, komodo, vim, wingide, scite, drPython, pype, idle Each has each own strength point. If I cho

[Tutor] Stopping a shell process started with system()

2005-09-21 Thread Sean Q. Hendricks
Hi all, I'm trying to write a simple front end for a commandline application (some of the people I'm working with get the shakes if they have to use the commandline) in Windows. I was using os.system() to execute a command, and that works fine, but the only way I know to stop the external pro

Re: [Tutor] installation programs

2005-09-21 Thread grouchy
Hi Jeff,Most people seem to use a combination of py2exe, and either Inno Setup or NSIS.  InstallShield is commercial, and, well, you have to pay for it. py2exe gives you the python interpreter, and all the libraries your program needs in a tidy little package, so unless the computers you are instal

Re: [Tutor] Python Editors (particualrly Vim)

2005-09-21 Thread George Flaherty
No editor wars here, my suggestion as I tried to state below is use what you like. Try'em all and take them for a test spin. Granted I might be slightly biased towards eclipse/emacs.but that is just my world :) Just out of curiosity, does vim have code completion for python? Cheers -ge

Re: [Tutor] Python Editors (particualrly Vim)

2005-09-21 Thread Gabriel Farrell
Uh oh, looks like you're begging for an editor war. That said, I'm in the vim camp. It can do everything you specified for all of the languages you mention (well, I'm not sure about collapsible code...web search...aha![1]). After using it for four years, I'm still learning new tricks (see, for

Re: [Tutor] Error frameworks

2005-09-21 Thread Kent Johnson
DS wrote: > Hi > > Is there any particular standard or approach that I should use for an > error framework? For example, suppose I have a set of functions that > call one another, and an error is triggered. I want an error message to > be passed back to the user, so I could: Raise an exception,

[Tutor] Error frameworks

2005-09-21 Thread DS
Hi Is there any particular standard or approach that I should use for an error framework? For example, suppose I have a set of functions that call one another, and an error is triggered. I want an error message to be passed back to the user, so I could: 1. have an error message passed bac

[Tutor] installation programs

2005-09-21 Thread Jeff Peery
Hello, I want to create an installation program. Can anyone tell me what the best program would be to use... maybe inno setup or install shield? do these work with python programs? do they require programming in another language? thanks.   Jeff___ Tutor

Re: [Tutor] Maths: getting degrees from radians (or am I wrong?)

2005-09-21 Thread Bernard Lebel
Okay thanks a lot everyone. Bernard On 9/20/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Bernard Lebel wrote: > > Hello, > > > > I have this little math problem. I have this formula from wich I get a > > dot product between two vectors. > > > > cos(ß) = A.B / |A|.|B| = -0.0634 > > So this woul

Re: [Tutor] Python Editors (particualrly Vim)

2005-09-21 Thread George Flaherty
comments are inline... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ed Singleton Sent: Wednesday, September 21, 2005 9:00 AM To: tutor@python.org Subject: [Tutor] Python Editors (particualrly Vim) I've been trying to decide which editor to use to

[Tutor] Python Editors (particualrly Vim)

2005-09-21 Thread Ed Singleton
I've been trying to decide which editor to use to edit Python (on Windows mostly). My wishlist of features would be: - automatic code formatting (indentation etc) - collapsible code (to collapse def's etc) - automatic code coloring (that's easily changeable) - auto-completion of namespaces - easy