Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Alan Gauld
> Are you the author of Learn to Program Using Python: A Tutorial for > Hobbyists, Self-starters and All Who Want to Learn the Art of Computer > Programming? Yes. > Is the book still available as a web site? Yes. It has been substantially rewritten sionce the book was done to cover more recent

Re: [Tutor] Getting Running File's Name

2006-01-31 Thread Bryan Carbonnell
On 31 Jan 2006 at 9:17, Rinzwind wrote: > Why would that be any different under Linux? > > sys.argv[0] > On 1/31/06, Hans Dushanthakumar <[EMAIL PROTECTED]> wrote: > > Under WinXP, the variable > > sys.argv[0] holds the script file name (including the path). Not sure, Wim/Hans, Thank you both.

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Jon Moore
AlanAre you the author of Learn to Program Using Python: A Tutorial for Hobbyists, Self-starters and All Who Want to Learn the Art of Computer Programming? Is the book still available as a web site?JonOn 31/01/06, Alan Gauld <[EMAIL PROTECTED] > wrote:> So a general recommendation to authors is to

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Jon Moore
DannyMany thanks for that, I notice a few erratas that I am yet to come up against. This will save my sanity (well some of it)1JonOn 31/01/06, Danny Yoo <[EMAIL PROTECTED]> wrote: On Tue, 31 Jan 2006, Jon Moore wrote:> I have been looking for contact details for the author to ask him what> he was

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Alan Gauld
> So a general recommendation to authors is to have a member of the target > audience "test" the book. You Jon have done that but at some cost to you > and those of us on this list. One advantage of doing my book as a web site first was that I had plenty of testers before committing to print (ov

Re: [Tutor] Exit a child thread using threading.Thread() object

2006-01-31 Thread Kent Johnson
Bernard Lebel wrote: > A quick question. > > I have started a child thread using the threading.Thread class. Is > there any way to cleanly exit the child thread? > > What I mean by "cleanly" is for example if you use the > thread.start_new() function to create a child thread, the function > runni

[Tutor] Exit a child thread using threading.Thread() object

2006-01-31 Thread Bernard Lebel
A quick question. I have started a child thread using the threading.Thread class. Is there any way to cleanly exit the child thread? What I mean by "cleanly" is for example if you use the thread.start_new() function to create a child thread, the function running in the child thread can call threa

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Danny Yoo
On Tue, 31 Jan 2006, Jon Moore wrote: > I have been looking for contact details for the author to ask him what > he was eluding to with the exercise, but to no avail. Hi Jon, I did find errata here: http://www.muskalipman.com/ptr_detail.cfm?group=Programming&all=1&isbn=1-59200-073-8 (bottom

Re: [Tutor] Copy files

2006-01-31 Thread Alan Gauld
> The only problem is that despite the fact that as the same user, > I can manually change these files (so I must have the right file > permissions ?) Can you do it from within python at the >>> prompt Use os.getcwd() to find out where you are Use os.chdir() to navigate Use os.listdir() to li

[Tutor] smtplib with yahoo smtp server

2006-01-31 Thread Intercodes
Hello everyone,I am working with a registration system for my website in mod_python. I needed to send mail to registered users for confirmation. Since I can't use my ISP's smtp server, I used yahoo's smtp server and my yahoo username and password  to connect and send mail using this script (see bel

Re: [Tutor] Cannot run .py file from apache web server , Guidance requested

2006-01-31 Thread Bob Gailer
Further delving leads to "Apache Tutorial: Dynamic Content with CGI" in the Apache Documentation. Under that is a section "But it's still not working! ... you see ... The source code of your CGI program ...That means that you have not properly configured Apache to process your CGI program. Rere

Re: [Tutor] Cannot run .py file from apache web server , Guidance requested

2006-01-31 Thread Bob Gailer
John Joseph wrote: > Hi > I am trying to execute .py scripts from my > apache web server , but it is not giving the results > as how I run php files , it just displays the > contents of the script , I am able to run and get > results of PHP from the same loaction > my “sample-test.py “file

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Jon Moore
I know. Its hard enough for someone like me as it is without things like this complicating it!I have another one for the group, but I will save it for another day ;)I have been looking for contact details for the author to ask him what he was eluding to with the exercise, but to no avail. JonOn 31/

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Bob Gailer
Jon Moore wrote: > Hi, > > I am still working my way through my 'Python for absolute beginners > book' and have hit a brick wall with one of the end of chapter exercises. > > The challenge says: > > Improve the function ask_number() so that the function can be called > with a step value. Make the

[Tutor] Cannot run .py file from apache web server , Guidance requested

2006-01-31 Thread John Joseph
Hi I am trying to execute .py scripts from my apache web server , but it is not giving the results as how I run php files , it just displays the contents of the script , I am able to run and get results of PHP from the same loaction my “sample-test.py “file is as follows import cgi reshtm

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Jon Moore
I guess I am not going mad then!I will skip this exercise and move on.ThanksJonOn 31/01/06, Alan Gauld < [EMAIL PROTECTED]> wrote:Hi Jon,> Improve the function ask_number() so that the function can be called with > a> step value. Make the default value of step 1.If its any consolation that doesn't

Re: [Tutor] Copy files

2006-01-31 Thread David Holland
Alan,Thanks for that.  Hopefully this now is easier to read. The only problem is that despite the fact that as the same user, I can manually change these files (so I must have the right file permissions ?) - the copying does not happening.def compare_files(file_name1, file_name2):    

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Alan Gauld
Hi Jon, > Improve the function ask_number() so that the function can be called with > a > step value. Make the default value of step 1. If its any consolation that doesn't really mean much to me either. I understand the concept of step value - range() takes one for example, check the docs. But

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Kent Johnson
Jon Moore wrote: > Hi, > > I am still working my way through my 'Python for absolute beginners > book' and have hit a brick wall with one of the end of chapter exercises. > > The challenge says: > > Improve the function ask_number() so that the function can be called > with a step value. Make

Re: [Tutor] Life after beginner

2006-01-31 Thread Kent Johnson
Pat Martin wrote: > Hello, > > I have been reading about and playing with programming in python for > awhile now. I have most of the basics down. I know what a tuple is, I > know how to load modules, and I understand a fair amount of beginning > programming theory. I have written some scripts f

Re: [Tutor] Life after beginner

2006-01-31 Thread Alan Gauld
Hi Pat, > My question is, what next? Is there some intermediate tutorials or books There are lots of more advanced books, usually focusing on a particular topic. Some examples include: Python and Tkinter programming by Grayson Python Programming on Win32 by Hammond Text Processing in Python b

[Tutor] Newbie question re. Functions

2006-01-31 Thread Jon Moore
Hi,I am still working my way through my 'Python for absolute beginners book' and have hit a brick wall with one of the end of chapter exercises.The challenge says:Improve the function ask_number() so that the function can be called with a step value. Make the default value of step 1. The function l

Re: [Tutor] Getting Running File's Name

2006-01-31 Thread Rinzwind
Why would that be any different under Linux? sys.argv[0] Wim On 1/31/06, Hans Dushanthakumar <[EMAIL PROTECTED]> wrote: > Under WinXP, the variable > sys.argv[0] holds the script file name (including the path). Not sure, > but it may work the same under Linux as well. > > > -Original Message