Re: [Tutor] Question about HORIZONTAL BAR CHART.....

2006-11-26 Thread Luke Paireepinart
Asrarahmed Kadri wrote: > As far as I understand, I need to design an algorithm which computes > the padding between each bar (space between each bar) and the length > of each bar ( remember that this is a HORIZONTAL BAR CHART). I think what you want to design is an algorithm that computes the HE

Re: [Tutor] program spontaneously closes...

2006-11-26 Thread Luke Paireepinart
Bob has answered your original question, but I'd like to make some observations. Alan Gilfoy wrote: > Hello All. > I've been concocting some simple programs based on an online tutorial, > and I, of course, save a program as a .py file. > > When running my program via IDLE, once I've cleaned out

Re: [Tutor] shebang question

2006-11-26 Thread زياد بن عبدالعزيز الباتلي
"john maclean" <[EMAIL PROTECTED]> On Sun, 26 Nov 2006 01:34:28 + wrote: > From what I can tell/remember, the first works in the *nix environment > if python is in your $PATH, ... Actually, no. The first will try to feed the script to the executable "/usr/bin/python". If that doesn't exist (o

Re: [Tutor] Please suggest a python book

2006-11-26 Thread Eike Welk
If you are a natural scientist or an engineer you should look at: Hans P. Langtangen Python Scripting for Computational Science It's an introduction to Python and to topical libs, for people who want to do numerical computations. Eike ___ Tutor maill

Re: [Tutor] Auto-hyperlinking ignoring html tags

2006-11-26 Thread Kent Johnson
anil maran wrote: > Hey > > I m trying to auto-hyperlink urls, > i found libcia.web.Regextransform.py > but the problem is it applies auto hyperlink on html tags > for eg < img src = " http://www.google.com/a.gif " > > > becomes > *gta* img src=" < a href= "http://www.google.com/a.gif " *lt > >

[Tutor] adjust key bindings

2006-11-26 Thread John CORRY
Hi All, I have been trying to bind the "z" key to the "Down" key using Python 2.4, Glade 2 and Pygtk. I have posted this problem on the Pygtk list but have had no response. I was hoping somebody on the tutor list could help. I think that I am close. I can capture the "z" key press and assign a

Re: [Tutor] Please suggest a python book

2006-11-26 Thread Dick Moores
At 06:34 AM 11/25/2006, Eike Welk wrote: >If you are a natural scientist or an engineer you should look at: > >Hans P. Langtangen >Python Scripting for Computational Science > >It's an introduction to Python and to topical libs, for people who >want to do numerical computations. Thanks for this!

Re: [Tutor] shebang question

2006-11-26 Thread shawn bright
well thanks for all the info, gents, i appreciate it a lot ! sk On 11/26/06, زياد بن عبدالعزيز الباتلي <[EMAIL PROTECTED]> wrote: "john maclean" <[EMAIL PROTECTED]> On Sun, 26 Nov 2006 01:34:28 + wrote: > From what I can tell/remember, the first works in the *nix environment > if python is

Re: [Tutor] my program problem!

2006-11-26 Thread Alan Gilfoy
Hey! Glad to hear that using raw_input() at the end is the actual solution, not just a jury-rigged workaround. :) So sleep(10) would simply be a shorter snippet of code for that purpose? The \n thing might be handy if I was short on space, but I don't mind separate 'print' lines, I find that m

[Tutor] What are the issues in running Python script on another machine (developed on Windows but will be using on Linux)

2006-11-26 Thread Asrarahmed Kadri
Hi folks, I have a couple of programs that I want to test on a different machine.. I have developed these on Win-XP platform, but I want to test them on my college's machine, which is running Linux. Are there any issues involved or i just need to take my files on a USB memory stick, and copy pa

Re: [Tutor] help with Tkinter, please

2006-11-26 Thread Michael Lange
On Sat, 25 Nov 2006 17:23:39 -0800 Dick Moores <[EMAIL PROTECTED]> wrote: > I've done a lot of fiddling around with setting "side=left", and > trying to put all the buttons inside a second Frame inside the first > one, but I can't get the layout I want, which is the Label on top of > the Entry,

[Tutor] python exceptions

2006-11-26 Thread johnf
My debugger comes up with lots of exceptions (builtin with my IDE wing) when I run code I have obtained from others. This is not a formating error - but real unhandled exceptions. But the when the program/programs is/are run from the command line they work as expected. So does this mean tha

Re: [Tutor] help with Tkinter, please

2006-11-26 Thread Dick Moores
At 08:59 AM 11/26/2006, Michael Lange wrote: >On Sat, 25 Nov 2006 17:23:39 -0800 >Dick Moores <[EMAIL PROTECTED]> wrote: > > > I've done a lot of fiddling around with setting "side=left", and > > trying to put all the buttons inside a second Frame inside the first > > one, but I can't get the layou

Re: [Tutor] What are the issues in running Python script on another machine (developed on Windows but will be using on Linux)

2006-11-26 Thread Andreas Kostyrka
* Asrarahmed Kadri <[EMAIL PROTECTED]> [061126 16:15]: > Hi folks, > > I have a couple of programs that I want to test on a different machine.. > > I have developed these on Win-XP platform, but I want to test them on my > college's machine, which is running Linux. > > Are there any issues invol

Re: [Tutor] shebang question

2006-11-26 Thread Michael P. Reilly
Very true about Python being installed in different places. In fact, for system compatibility reasons, it is sometime required that two or three very different releases of Python need to exist on the same system. If more than one happen to be in your path, then the use of "env python" becomes a

[Tutor] Newbie string & File I/O questions......

2006-11-26 Thread Moedeloos Overste
Hi everybody, I am new to python and trying to write a lottery program for a schoolproject. The program is supposed to draw the lottery any entered(user input) number of times, then store the drawing results in a file. After drawings the user should see (if he wants to) how many times each of

Re: [Tutor] Newbie string & File I/O questions.....

2006-11-26 Thread Asrarahmed Kadri
You can use, '\n' with each value, that u are writing to the file. eg. outstring = outstring + '\n' \n stands for new line character. I couldnt get the second question. Regarding the third question, you can do this: done = 0 fd = open(filename,'r') while not done: line = fd.readline()

Re: [Tutor] help with Tkinter, please

2006-11-26 Thread Kent Johnson
Dick Moores wrote: > At 08:59 AM 11/26/2006, Michael Lange wrote: >> On Sat, 25 Nov 2006 17:23:39 -0800 >> Dick Moores <[EMAIL PROTECTED]> wrote: >> >>> I've done a lot of fiddling around with setting "side=left", and >>> trying to put all the buttons inside a second Frame inside the first >>> one,

Re: [Tutor] help with Tkinter, please

2006-11-26 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote > Some time has passed and I've made some progress. My question now is > about the placement of buttons. ... > one, but I can't get the layout I want, which is the Label on top of > the Entry, then a row of the first 3 buttons (which respectively > trigger

Re: [Tutor] Please suggest a python book

2006-11-26 Thread Alan Gauld
"Narasimha" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi! Friends, > > I am new to python. I have a vacation of 15 days. Please suggest me > a python > book (or a website). > > I already know C language. I have heard much about Python. If you know C then the best place to s

Re: [Tutor] program spontaneously closes...

2006-11-26 Thread Alan Gauld
"Alan Gilfoy" <[EMAIL PROTECTED]> wrote > The command line program seems to work through my program OK, but > the > command line program shuts down immediately after the program has > run Yes this is normal behaviour. There are several ways around it, one of which is the raw_input trick you ha

Re: [Tutor] program spontaneously closes...

2006-11-26 Thread Alan Gauld
"Luke Paireepinart" <[EMAIL PROTECTED]> wrote > And what's all of this 'command-line' business? Your python script > is > the same when run by double-clicking as it is when run from idle: I'll have to disdagree with you here Luke. IDLE changes script behaviour in quite a number of subtle ways

Re: [Tutor] my program problem!

2006-11-26 Thread Alan Gauld
"Alan Gilfoy" <[EMAIL PROTECTED]> wrote > So sleep(10) would simply be a shorter snippet of code for that > purpose? sleep just gices a long pause before quitting, usually enough to read the output. > The \n thing might be handy if I was short on space, but I don't > mind > separate 'print' li

Re: [Tutor] python exceptions

2006-11-26 Thread Alan Gauld
"johnf" <[EMAIL PROTECTED]> wrote > My debugger comes up with lots of exceptions (builtin with my IDE > wing) when I > run code I have obtained from others. This is not a formating > error - but > real unhandled exceptions. But the when the program/programs is/are > run from > the command li

Re: [Tutor] Newbie string & File I/O questions......

2006-11-26 Thread Alan Gauld
"Moedeloos Overste" <[EMAIL PROTECTED]> wrote > This is what I've been able to come up with so far: > > vDraws = input("How many times do you want to draw the lottery? :>") input is considered a damngerous function because a user could input malicious python code. Its better to use raw_input an

Re: [Tutor] python exceptions

2006-11-26 Thread johnf
On Sunday 26 November 2006 15:43, Alan Gauld wrote: > "johnf" <[EMAIL PROTECTED]> wrote > > > My debugger comes up with lots of exceptions (builtin with my IDE > > wing) when I > > run code I have obtained from others. This is not a formating > > error - but > > real unhandled exceptions. But the

Re: [Tutor] python exceptions

2006-11-26 Thread John Fouhy
On 27/11/06, johnf <[EMAIL PROTECTED]> wrote: > I can but it's not the issue - I think? I want to know how it works - > exceptions not handled by python that is. Are there exception handled > outside of python when using modules such as wxPython and pyQT? Or are some > exceptions not handled whe

[Tutor] to learn

2006-11-26 Thread ED PENNELL
my name is ED PENNELL, i am using MAC TIGER want to learn python and use it on emacs,i down loaded 2.5 python,i will start with IDLE, DO I NEED PORTS FOR MY MAC and need tutor with MAC.a very fresh starter. THANKS ED _

Re: [Tutor] adjust key bindings

2006-11-26 Thread Luke Paireepinart
John CORRY wrote: > Hi All, > > I have been trying to bind the "z" key to the "Down" key using Python > 2.4, Glade 2 and Pygtk. I have posted this problem on the Pygtk list > but have had no response. I was hoping somebody on the tutor list could > help. I think that I am close. I can capture t

Re: [Tutor] to learn

2006-11-26 Thread Luke Paireepinart
ED PENNELL wrote: > my name is ED PENNELL, i am using MAC TIGER want > to learn python and use it on emacs,i down loaded 2.5 > python,i will start with IDLE, DO I NEED PORTS FOR MY > MAC You had me up till here and then you lost me. What do you mean, ports? network ports? software ports (as

Re: [Tutor] python exceptions

2006-11-26 Thread johnf
On Sunday 26 November 2006 16:17, John Fouhy wrote: > On 27/11/06, johnf <[EMAIL PROTECTED]> wrote: > > I can but it's not the issue - I think? I want to know how it works - > > exceptions not handled by python that is. Are there exception handled > > outside of python when using modules such as

Re: [Tutor] help with Tkinter, please

2006-11-26 Thread Dick Moores
At 08:59 AM 11/26/2006, Michael Lange wrote: >On Sat, 25 Nov 2006 17:23:39 -0800 >Dick Moores <[EMAIL PROTECTED]> wrote: > > > I've done a lot of fiddling around with setting "side=left", and > > trying to put all the buttons inside a second Frame inside the first > > one, but I can't get the layou

Re: [Tutor] python exceptions

2006-11-26 Thread John Fouhy
On 27/11/06, johnf <[EMAIL PROTECTED]> wrote: > So there are outside exception handlers? OK. thanks for the answer. For now > that all I needed to understand. I'm not sure that "outside" is quite the right word .. If you write Tkinter code, you will (at some point) call mainloop(). mainloop()

Re: [Tutor] help with Tkinter, please

2006-11-26 Thread John Fouhy
On 27/11/06, Dick Moores <[EMAIL PROTECTED]> wrote: > Well, I'm having a terrible time with grid(). I do have the 6 buttons > in the same row, but they're a real mess. Someone please run this and > tell me how to get them looking better. I'm not certain exactly what layout you want, but have a loo

Re: [Tutor] help with Tkinter, please

2006-11-26 Thread Dick Moores
At 03:09 PM 11/26/2006, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > Some time has passed and I've made some progress. My question now is > > about the placement of buttons. >... > > one, but I can't get the layout I want, which is the Label on top of > > the Entry, then a row

Re: [Tutor] to learn

2006-11-26 Thread John Fouhy
On 27/11/06, ED PENNELL <[EMAIL PROTECTED]> wrote: > my name is ED PENNELL, i am using MAC TIGER want > to learn python and use it on emacs,i down loaded 2.5 > python,i will start with IDLE, DO I NEED PORTS FOR MY > MAC and need tutor with MAC.a very fresh starter. > THANKS ED Hi Ed, If y

Re: [Tutor] help with Tkinter, please

2006-11-26 Thread Dick Moores
At 06:54 PM 11/26/2006, John Fouhy wrote: >On 27/11/06, Dick Moores <[EMAIL PROTECTED]> wrote: > > Well, I'm having a terrible time with grid(). I do have the 6 buttons > > in the same row, but they're a real mess. Someone please run this and > > tell me how to get them looking better. > >I'm not c

[Tutor] moving from pack to grid in tkinter

2006-11-26 Thread Tony Cappellini
I've got a main window which is 640 * 400. self.root.geometry("600x400") self.label.pack(side=BOTTOM, fill=X) This line would put the label at the bottom of the window, and extend to both left and right edges of the window. I want to change to grid geometry because I have several more widge

Re: [Tutor] help with Tkinter, please

2006-11-26 Thread John Fouhy
On 27/11/06, Dick Moores <[EMAIL PROTECTED]> wrote: > I have a question about the "EXIT" button's command, > command=sys.exit. It fails to quit the program when I've entered too > large an integer for factoring, or for prime testing, and I don't > want to wait any more for the result. When I'm runn

Re: [Tutor] moving from pack to grid in tkinter

2006-11-26 Thread John Fouhy
On 27/11/06, Tony Cappellini <[EMAIL PROTECTED]> wrote: > I've got a main window which is 640 * 400. > self.root.geometry("600x400") > > self.label.pack(side=BOTTOM, fill=X) > This line would put the label at the bottom of the window, and extend to > both left and right edges of the window.