Re: [Tutor] please help with sqlite replace function

2008-11-06 Thread aivars
John, just to add to my previous post. after copying sqlite3.dll (3.6.2) version into Python25\DLLs directory and running import sqlite3 dir(sqlite3) >>> sqlite3.version '2.3.2' >>> sqlite3.version_info (2, 3, 2) >>> sqlite3.sqlite_version_info (3, 6, 2) >>> sqlite3.sqlite_version '3.6.2' an

[Tutor] Intermediate/advanced concepts

2008-11-06 Thread btkuhn
Hi everyone, I've been teaching myself python for a few months and I'm becoming frustrated because I've kind of hit a wall in terms of learning new information. In an effort to continue to learn I've found some material on more intermediate/advanced topics like linked lists, nodes, trees, etc

Re: [Tutor] please help with sqlite replace function

2008-11-06 Thread aivars
Thanks, John, Yes it seems you are right. The ActiveState python version I have installed have sqlite 2.3.2 only. I find it strange. I see that on a python website there is is a new version Python26 relesed. Should i go on and install Python26? I understand that I can install pure Python from pytho

Re: [Tutor] How to use function from specific module and then switch to other module

2008-11-06 Thread Kent Johnson
On Thu, Nov 6, 2008 at 5:54 PM, Ertl, John C CIV 63134 <[EMAIL PROTECTED]> wrote: > Classification: UNCLASSIFIED > Caveat (s): FOUO > > I have a program that collects weather data from weather models. I > originally had a module that contained a bunch of function that I used. So > I just added it

Re: [Tutor] How to use function from specific module and then switch to other module

2008-11-06 Thread John Fouhy
2008/11/7 Ertl, John C CIV 63134 <[EMAIL PROTECTED]>: > The idea is as I step through a list I want to use a different function > (same name but from a different module) for each element in the list. How > do I have a generic way to do this. > > for example for point 1 I want to use the rain funct

[Tutor] How to use function from specific module and then switch to other module

2008-11-06 Thread Ertl, John C CIV 63134
Classification: UNCLASSIFIED Caveat (s): FOUO   I have a program that collects weather data from weather models.  I originally had a module that contained a bunch of function that I used.  So I just added it to the init of the class I was using and inherited the functions.  That worked great but

Re: [Tutor] please help with sqlite replace function

2008-11-06 Thread John Fouhy
2008/11/7 aivars <[EMAIL PROTECTED]>: > I use python 2.5.2.2 (activestate), WinXP, sqlite version 3.6.2 Hi Aivars, I believe python has its own built-in sqlite, rather than using the version you installed independently. So it is possible that the python version of sqlite is older than 3.6.2 and

[Tutor] please help with sqlite replace function

2008-11-06 Thread aivars
Hello, I am stuck now. I have a sqlite database with a table calendar (which is an auxilary calendar table containing dates, years, months, days) >From sqlite prompt I can run the following query without any problem: SELECT replace( datums,'-','' ) FROM calendar where Y='2008' and M='5' It give

Re: [Tutor] Date validation? Correction

2008-11-06 Thread bob gailer
bob gailer wrote: Eric Dorsey wrote: Greetings, I have a program where I ask a user to enter a date in format -MM-DD, and get a string like: '2008-10-25' Can anyone tell me how I would verify this is a real date before allowing it to be passed on to the next part of the program? Take a

Re: [Tutor] Date validation?

2008-11-06 Thread bob gailer
Eric Dorsey wrote: Greetings, I have a program where I ask a user to enter a date in format -MM-DD, and get a string like: '2008-10-25' Can anyone tell me how I would verify this is a real date before allowing it to be passed on to the next part of the program? Take a look at the time m

Re: [Tutor] Date validation?

2008-11-06 Thread W W
On Thu, Nov 6, 2008 at 1:27 PM, Eric Dorsey <[EMAIL PROTECTED]> wrote: > Greetings,I have a program where I ask a user to enter a date in format > -MM-DD, and get a string like: '2008-10-25' > > Can anyone tell me how I would verify this is a real date before allowing > it to be passed on to t

[Tutor] Date validation?

2008-11-06 Thread Eric Dorsey
Greetings,I have a program where I ask a user to enter a date in format -MM-DD, and get a string like: '2008-10-25' Can anyone tell me how I would verify this is a real date before allowing it to be passed on to the next part of the program? -- (e) ___

Re: [Tutor] Using Python to replace javascript

2008-11-06 Thread Alan Gauld
"Jim Morcombe" <[EMAIL PROTECTED]> wrote Is there any way to write python code inside a HTML page instead of using Javascript? Yes, but only if you a) are using IE as your browser under Windows. b) Have WSH installed c) Have run the scripting activation script in the Pyhonwin package OR you c

Re: [Tutor] Using Python to replace javascript

2008-11-06 Thread Jan Ulrich Hasecke
2008/11/6 Jim Morcombe <[EMAIL PROTECTED]> > Is there any way to write python code inside a HTML page instead of using > Javascript? > There is the KSS project http://kssproject.org/ It uses a css-like markup to write Ajax-functions. juh ___ Tutor mai

Re: [Tutor] Using Python to replace javascript

2008-11-06 Thread bob gailer
Jim Morcombe wrote: Is there any way to write python code inside a HTML page instead of using Javascript? Not yet - not directly. But there is pyjamas - a Python - javascript translator centered around GWT. http://code.google.com/p/pyjamas/ http://groups.google.com/group/pyjamas-dev?hl=en -

[Tutor] Using Python to replace javascript

2008-11-06 Thread Jim Morcombe
Is there any way to write python code inside a HTML page instead of using Javascript? Jim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] using rect.inflate()

2008-11-06 Thread W W
On Wed, Nov 5, 2008 at 8:14 PM, John Fouhy <[EMAIL PROTECTED]> wrote: > 2008/11/6 Christopher Spears <[EMAIL PROTECTED]>: > > I inserted this code snippet into the Spaceship class: > > > > self.rect = self.image.get_rect() > > print self.rect > > self.rect = self.rect.inflate(-50, -50) > > print s

Re: [Tutor] validating decimal class

2008-11-06 Thread A.T.Hofkamp
John Fouhy wrote: 2008/11/6 Brian Lane <[EMAIL PROTECTED]>: But you could also compare it to a known type: if not type(price) is type(decimal.Decimal(0)): print "Not Decimal" Easier to just compare with decimal.Decimal: import decimal d = decimal.Decimal(13) type(d) == decimal.Decimal Tru