Re: [Tutor] Beginner problem: name 'convertToFahrenheit' is not defined

2008-08-14 Thread Alan Gauld
"Joseph Bae" <[EMAIL PROTECTED]> wrote temp = input("Enter A Number : ") convertTo = raw_input("Convert To (F)ahrenheit or (C)elsius? : ") if convertTo == "F": convertedTemp = convertToFahrenheit(temp) print "%d Celsius = %d Fahrenheit" % (temp, convertedTemp) else: convertedTemp = con

Re: [Tutor] What has Editor X got that PyWin32 hasn't?

2008-08-14 Thread Dick Moores
At 06:36 AM 8/14/2008, Jeff Johnson wrote: I use Dabo's Editor.py. It has templates to provide code highlighting, etc. in many languages. I also like the way it runs Python programs. Could you tell us what you like about the way it runs Python programs? Thanks, Dick Moores By the way, Da

Re: [Tutor] What has Editor X got that PyWin32 hasn't?

2008-08-14 Thread Dick Moores
At 04:54 PM 8/14/2008, bob gailer wrote: Dick Moores wrote: At 08:58 PM 8/13/2008, bob gailer wrote: One thing I really like about Python Win is the integrated debugger, which takes no time to start up. SPE OTOH uses WinPDB which runs as a separate process that takes (in the demo video) 15 se

Re: [Tutor] What has Editor X got that PyWin32 hasn't?

2008-08-14 Thread bob gailer
Dick Moores wrote: At 08:58 PM 8/13/2008, bob gailer wrote: One thing I really like about Python Win is the integrated debugger, which takes no time to start up. SPE OTOH uses WinPDB which runs as a separate process that takes (in the demo video) 15 seconds to start (each time it is requested)

Re: [Tutor] Firefox Bookmarks

2008-08-14 Thread John Fouhy
2008/8/14 Benjamin Serrato <[EMAIL PROTECTED]>: > Are there any modules I should know about? Specifically How can I read/write > from places.sqlite? Here's some code to get you stared (requires python 2.5): >>> import sqlite3 >>> db = sqlite3.connect('places.sqlite') >>> c = db.cursor() >>> c.exe

Re: [Tutor] Beginner problem: name 'convertToFahrenheit' is not defined

2008-08-14 Thread Tuxicomane
Joseph Bae <[EMAIL PROTECTED]> writes: > Hi all, Hi ! (and sorry for my approximative English ... ;-) > I'm new to Python (and programming in general) and need some help! > > Here is my code so far for a temperature conversion program >(converts between Fahrenheit and Celsius): > > temp = input(

Re: [Tutor] Beginner problem: name 'convertToFahrenheit' is not defined

2008-08-14 Thread Emad Nawfal (عماد نوفل)
On Thu, Aug 14, 2008 at 7:08 PM, Joseph Bae <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm new to Python (and programming in general) and need some help! > > Here is my code so far for a temperature conversion program (converts > between Fahrenheit and Celsius): > > > > temp = input("Enter A Number

Re: [Tutor] Beginner problem: name 'convertToFahrenheit' is not defined

2008-08-14 Thread Josh Rosen
In Python, def is an executable statement. Your function is not defined until the def statement is run by Python. If you move your function definitions earlier in the code so that your functions are defined before they're used, this code will run properly. Josh R. On Aug 14, 2008, at 4:0

Re: [Tutor] Firefox Bookmarks

2008-08-14 Thread Hugo González Monteverde
Are there any modules I should know about? Specifically How can I read/write from places.sqlite? Hi, pysqlite3 is the python wrapper for the SQLite libs. It is included with Python 2.5 and newer. Docs are at http://oss.itsystementwicklung.de/download/pysqlite/doc/usage-guide.html Have f

[Tutor] Beginner problem: name 'convertToFahrenheit' is not defined

2008-08-14 Thread Joseph Bae
Hi all, I'm new to Python (and programming in general) and need some help! Here is my code so far for a temperature conversion program (converts between Fahrenheit and Celsius): temp = input("Enter A Number : ") convertTo = raw_input("Convert To (F)ahrenheit or (C)elsius? : ") if convertTo ==

Re: [Tutor] __init__, default values and dict's

2008-08-14 Thread ALAN GAULD
> def __init__(self, d=None): > if not d: > > I would use > if d is None: > so the user can explicitly pass e.g. an empty dict. Good catch. I agree. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] __init__, default values and dict's

2008-08-14 Thread Kent Johnson
On Thu, Aug 14, 2008 at 1:32 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > For the second try > > def __init__(self, d=None): > if not d: I would use if d is None: so the user can explicitly pass e.g. an empty dict. Kent ___ Tutor maillist - Tutor@p

Re: [Tutor] __init__, default values and dict's

2008-08-14 Thread Alan Gauld
"Bart Cramer" <[EMAIL PROTECTED]> wrote Does anybody know why this is the case? And what would be the most convenient solution to enforce the dynamic creation of the dictionary? Kent answered the first bit. For the second try def __init__(self, d=None): if not d: d = {} self.d

Re: [Tutor] study advice on javascript to python hand-off

2008-08-14 Thread Hansen, Mike
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Serdar Tumgoren > Sent: Thursday, August 14, 2008 9:35 AM > To: tutor@python.org > Subject: Re: [Tutor] study advice on javascript to python hand-off > > Thanks all for the quick responses. > > Yes

Re: [Tutor] study advice on javascript to python hand-off

2008-08-14 Thread Serdar Tumgoren
Thanks all for the quick responses. Yes, though Dabo looks like an interesting tool, I am headed the route of a web-based form. @Chad: I haven't checked out Turbogears but have been dabbling with django for a bit. Djanog's baked-in admin interface for data entry approaches what I'm trying to acc

Re: [Tutor] study advice on javascript to python hand-off

2008-08-14 Thread Hansen, Mike
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Johnson > Sent: Thursday, August 14, 2008 9:08 AM > To: Serdar Tumgoren > Cc: tutor@python.org > Subject: Re: [Tutor] study advice on javascript to python hand-off > > This is a three tier framewo

Re: [Tutor] study advice on javascript to python hand-off

2008-08-14 Thread Jeff Johnson
This is a three tier framework where you can use any back end you want. They currently support the major ones: MySQL, SQLite, PostGreSQL, MSSql to name the ones I can think of. http://dabodev.com/wiki/FrontPage -- Jeff Jeff Johnson [EMAIL PROTECTED] Phoenix Python User Group - [EMAIL PROTECT

[Tutor] study advice on javascript to python hand-off

2008-08-14 Thread Serdar Tumgoren
Hi everyone, I've been trying to tackle a certain data-entry and processing problem for quite some time, and I was wondering if someone could offer advice on the path I should take. Whatever the answer, I know I have a great deal of study ahead of me, but I was hoping to at least narrow the field.

Re: [Tutor] What has Editor X got that PyWin32 hasn't?

2008-08-14 Thread Jeff Johnson
I use Dabo's Editor.py. It has templates to provide code highlighting, etc. in many languages. I also like the way it runs Python programs. By the way, Dabo is a database/business object centric framework for Python which wraps WxPython. But you can use just the Editor or other parts you li

Re: [Tutor] __init__, default values and dict's

2008-08-14 Thread Kent Johnson
On Thu, Aug 14, 2008 at 6:05 AM, Bart Cramer <[EMAIL PROTECTED]> wrote: > Dear tutors, > > I have the following code snippet: > > class N (object) : > >def __init__ (self, d={}) : >self.d = d > > I assumed that on each call of the __init__ without a dictionary > provided, a

[Tutor] Firefox Bookmarks

2008-08-14 Thread Benjamin Serrato
I was trying to learn python a few months back but was distracted. I was up to OO programming. I don't like the way bookmarks work in Firefox so, I would like to take the bookmark file in Firefox 3 and build a markup file from it that shows all of the bookmarked files under their headers with the

Re: [Tutor] What has Editor X got that PyWin32 hasn't?

2008-08-14 Thread OmerT
On Thu, Aug 14, 2008 at 7:20 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > At 08:58 PM 8/13/2008, bob gailer wrote: >> >> One thing I really like about Python Win is the integrated debugger, which >> takes no time to start up. SPE OTOH uses WinPDB which runs as a separate >> process that takes (in t

[Tutor] __init__, default values and dict's

2008-08-14 Thread Bart Cramer
Dear tutors, I have the following code snippet: class N (object) : def __init__ (self, d={}) : self.d = d n1 = N () n1.d['a'] = 1 n2 = N () n2.d['a'] = 2 print n1.d['a'] print n2.d['a'] I assumed that on each call of the __init__ without a dictionary p