[Tutor] running as generic file type

2005-12-22 Thread Eli Zabielski
HiI'm very new to python, I created my first program, saved it as .py. I wanted to show it to my friends and I tested running it on another computer, one without python, and it didn't work, it gave me a list of programs to try to run it on (ex. word, IE, Mozilla). Is there any way to save it so

Re: [Tutor] Differnce between java and python

2005-12-22 Thread Alan Gauld
Another example is that Python supports Duck Typing, that is its type checking is protocol based. I see your point, but duck typing seems awfully implicit and behind-the-scenes. When you first encounter it it is. I came from a C++ and Pascal background where strict typing was the rule, Python

Re: [Tutor] Differnce between java and python

2005-12-22 Thread Alan Gauld
[Putting this back on the list so others get the context info] - Original Message - From: shivayogi kumbar [EMAIL PROTECTED] Subject: Re: [Tutor] Differnce between java and python Sir I have completed my Msc(c.s).I have worked on java and also done my project on javaa using swings

Re: [Tutor] running as generic file type

2005-12-22 Thread Kent Johnson
Eli Zabielski wrote: Hi I'm very new to python, I created my first program, saved it as .py. I wanted to show it to my friends and I tested running it on another computer, one without python, and it didn't work, it gave me a list of programs to try to run it on (ex. word, IE, Mozilla). Is

Re: [Tutor] Books

2005-12-22 Thread daniel.brown
While we are on the topic of books, what book would you recommend for the experienced C++/C# programmer looking to pick up Python? I've been looking at 'Python in a Nutshell' and 'Programming Python' on amazon.co.uk, as I've found O'Reilly books good in the past. I'm mainly looking to use Python

[Tutor] Numeric import error

2005-12-22 Thread Johan Geldenhuys
Hi all, I have installed Numeric (Suse 10.0) and it is in my site-packages folder, but I can't import the module. Any idea how to fix this/ TIA Johan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] running as generic file type

2005-12-22 Thread Alan Gauld
Hi Eli, I'm very new to python, I created my first program, saved it as .py. I wanted to show it to my friends and I tested running it on another computer, one without python, and it didn't work, That's because Python is an interpreted language so it needs an interpreter to be present. This

[Tutor] md5 message digest algorithm

2005-12-22 Thread Ales Zemene
hi, suprising for me is that making .py file: import md5 hash = md5.new() and running it produces : AttributeError: 'module' object has no attribute 'new' and similar : from Crypto.Hash import MD5 ImportError: cannot import name MD5 but in both cases it works on python command line intepretter.

Re: [Tutor] Performance of Python loops vs multiple MySQL queries

2005-12-22 Thread Bernard Lebel
On 12/21/05, Kent Johnson [EMAIL PROTECTED] wrote: Bernard Lebel wrote: Hello, Finally, after a year and a half of learning and messing around with Python, I'm writing THE code that made learn Python in the first place: a render farm client management software. I may have several

Re: [Tutor] Numeric import error

2005-12-22 Thread Pujo Aji
Can you open the python interpreter and write:import NumericWhat kind of error message you have?Cheers,pujoOn 12/22/05, Johan Geldenhuys [EMAIL PROTECTED] wrote:Hi all, I have installed Numeric (Suse 10.0) and it is in my site-packagesfolder, but I can't import the module.Any idea how to fix

Re: [Tutor] Numeric import error

2005-12-22 Thread Johan Geldenhuys
import Numeric Traceback (most recent call last): File "stdin", line 1, in ? ImportError: No module named Numeric Pujo Aji wrote: Can you open the python interpreter and write: import Numeric What kind of error message you have? Cheers, pujo On 12/22/05, Johan Geldenhuys [EMAIL

Re: [Tutor] Numeric import error

2005-12-22 Thread Pujo Aji
Do you have other modules in your site-packages directory ?Such as spe, pyro, pyrobot etc.On 12/22/05, Johan Geldenhuys [EMAIL PROTECTED] wrote: import Numeric Traceback (most recent call last): File stdin, line 1, in ? ImportError: No module named Numeric Pujo Aji wrote: Can you

Re: [Tutor] Numeric import error

2005-12-22 Thread Pujo Aji
Can you find numeric.py inside your numeric folder ?On 12/22/05, Pujo Aji [EMAIL PROTECTED] wrote: Do you have other modules in your site-packages directory ?Such as spe, pyro, pyrobot etc. On 12/22/05, Johan Geldenhuys [EMAIL PROTECTED] wrote: import Numeric Traceback (most recent

Re: [Tutor] Books

2005-12-22 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-22 05:00: While we are on the topic of books, what book would you recommend for the experienced C++/C# programmer looking to pick up Python? I've been looking at 'Python in a Nutshell' and 'Programming Python' on amazon.co.uk, as I've found

Re: [Tutor] md5 message digest algorithm

2005-12-22 Thread Kent Johnson
Ales Zemene wrote: hi, suprising for me is that making .py file: import md5 hash = md5.new() and running it produces : AttributeError: 'module' object has no attribute 'new' By any chance is your program called md5.py? If so it is being imported instead of the md5 library module. and

Re: [Tutor] Performance of Python loops vs multiple MySQL queries

2005-12-22 Thread Kent Johnson
Bernard Lebel wrote: On 12/21/05, Kent Johnson [EMAIL PROTECTED] wrote: - Don't assume there is going to be a problem. [Bernard] Okay perhaps by problem I have not been very accurate. I meant sync problems. You see, when the script finds a job, it makes updates in the database, that is, it

Re: [Tutor] Performance of Python loops vs multiple MySQL queries

2005-12-22 Thread Bernard Lebel
Thanks for all the advice Kent. Bernard On 12/22/05, Kent Johnson [EMAIL PROTECTED] wrote: Bernard Lebel wrote: On 12/21/05, Kent Johnson [EMAIL PROTECTED] wrote: - Don't assume there is going to be a problem. [Bernard] Okay perhaps by problem I have not been very accurate. I

Re: [Tutor] Books

2005-12-22 Thread Alan Gauld
While we are on the topic of books, what book would you recommend for the experienced C++/C# programmer looking to pick up Python? looking to use Python for general scripting tasks as I'm finding that batch files just aren't flexible or powerful enough on WinXP... For your particular

Re: [Tutor] Performance of Python loops vs multiple MySQL queries

2005-12-22 Thread Alan Gauld
Also there was a consideration of performance. I have one question on the topic breaking code into small functions and performance. I have read somewhere that *any* call whatoever, that is, methods, functions and such, involve a performance cost. Is that right? Yes it is, but its not a huge

Re: [Tutor] Differnce between java and python (fwd)

2005-12-22 Thread Danny Yoo
[Keeping tutor@python.org in CC. Ok, so now we know that Shivayogi already has Java experience. Shivayogi might also be a little annoyed that he has to learn a new language. We have to tread more carefully in making claims like Python is easier than Java, because for anyone starting on another

[Tutor] running a .exe

2005-12-22 Thread Robin Buyer
How do you run a .exe from inside a python program. randomexample: print "What would you like to do today? " print "E - email" print "I - internet" what = input("Choose: ") if what == "E": Heres where i would need torun IEXPLORE.exe ___ Tutor

Re: [Tutor] running a .exe

2005-12-22 Thread Kent Johnson
Robin Buyer wrote: How do you run a .exe from inside a python program. random example: print What would you like to do today? print E - email print I - internet what = input(Choose: ) if what == E: Heres where i would need to run IEXPLORE.exe Look at os.system()

Re: [Tutor] Books

2005-12-22 Thread Nick Lunt
Web/Network programming here http://www.amazon.com/gp/product/0596100329/qid=1135198935/sr=2-1/ref=pd_bbs _b_2_1/103-4720029-4050242?s=booksv=glancen=283155 Not CGI specific, and I haven't bought it yet, but I bet it's a blinder :) -Original Message- From: [EMAIL PROTECTED]

Re: [Tutor] running a .exe

2005-12-22 Thread Robin Buyer
The internet was just an example. I'm just looking at how to open .exe from python. - Original Message - From: Liam Clarke-Hutchinson [EMAIL PROTECTED] To: 'Robin Buyer' [EMAIL PROTECTED]; tutor@python.org Sent: Thursday, December 22, 2005 7:35 PM Subject: RE: [Tutor] running a .exe Hi

Re: [Tutor] running a .exe

2005-12-22 Thread Kent Johnson
Robin Buyer wrote: I created a small program to test os.system: import os.path os.system(C:\Program Files\Internet Explorer\IEXPLORE.EXE) when i run this from the command line I get an error message: 'C:\Program' is not recognized as an internal or external command, operable program or

Re: [Tutor] running a .exe

2005-12-22 Thread Robin Buyer
Ahh. That helps a lot. Thanks. -Robin - Original Message - From: Kent Johnson [EMAIL PROTECTED] To: Python Tutor tutor@python.org Sent: Thursday, December 22, 2005 7:46 PM Subject: Re: [Tutor] running a .exe Robin Buyer wrote: I created a small program to test os.system: