Re: [Tutor] noobie question,,,error related

2011-01-31 Thread Timo
On 31-01-11 04:27, walter weston wrote: I get this error when I try and load the datetime module, Traceback (most recent call last): File C:/Python27/TIMED_PROGRAM.py, line 2, in module datetime.ctime() AttributeError: 'module' object has no attribute 'ctime' why is this? The error says

Re: [Tutor] decimal module and precision

2011-01-31 Thread Steven D'Aprano
Richard D. Moores wrote: Python 3.1 The decimal module continues to puzzle me from time to time. Here's one of those. I want to use Alex Martelli's factory function as much as possible. Turns out it has a problem with precision in addition and multiplication.

[Tutor] open linux file browser from nuke python script

2011-01-31 Thread Pete O'Connell
Hi, I am trying to get a python script to open up a file browser window with the location of a folder. I am using kubuntu 10.04. The string that gets created works fine if I paste it into a shell eg: 'kde-open path/to/the/sequence', but it doesn't seem to want to run from within my interpreter

Re: [Tutor] noobie question,,,error related

2011-01-31 Thread Noah Hall
I get this error when I try and load the datetime module, Traceback (most recent call last):   File C:/Python27/TIMED_PROGRAM.py, line 2, in module     datetime.ctime() AttributeError: 'module' object has no attribute 'ctime' Your problem, I guess comes from you having code like the

Re: [Tutor] decimal module and precision

2011-01-31 Thread Richard D. Moores
On Mon, Jan 31, 2011 at 01:32, Steven D'Aprano st...@pearwood.info wrote: Richard D. Moores wrote: Python 3.1 The decimal module continues to puzzle me from time to time. Here's one of those. I want to use Alex Martelli's factory function as much as possible. Turns out it has a problem with

[Tutor] search list with regex

2011-01-31 Thread Elwin Estle
Tcl's list search command has the option to search for a list element that matches a given regex.  Is there something similar in python?  If not, it seems like it should be fairly trivial for me to write my own (just wondering if I would be re-inventing the wheel).

Re: [Tutor] Wrapping my head around global variables!!

2011-01-31 Thread Elwin Estle
I am no Python guru, I haven't even scratched the surface.  And to be honest, I do not know the answer to your question.  It is probably a Python 3.x thing.  I would suggest looking here: http://docs.python.org/modindex.html ...which is for --- On Sun, 1/30/11, Nevins Duret

[Tutor] oops...sorry, just top posted again

2011-01-31 Thread Elwin Estle
...but I have an excuse. I had the thing saved in a drafts folder and just hit send without thinking about it. ...I'll just go super glue broken glass to my hands and sprinkle itching powder all over my body. Is that penance enough? ___

Re: [Tutor] decimal module and precision

2011-01-31 Thread Eike Welk
Hello Richard! In your code: d(123.2345274523452345235432452345) you are entering the number as a `float` and you are loosing the precision already when the code is compiled. To retain the precision all constants must be entered as strings. For illustration see this part of an

[Tutor] Fwd: open linux file browser from nuke python script

2011-01-31 Thread David Abbott
-- Forwarded message -- From: David Abbott da...@pythontoo.com Date: Mon, Jan 31, 2011 at 9:55 AM Subject: Re: [Tutor] open linux file browser from nuke python script To: Pete O'Connell pedrooconn...@gmail.com On Mon, Jan 31, 2011 at 6:42 AM, Pete O'Connell

Re: [Tutor] oops...sorry, just top posted again

2011-01-31 Thread David Hutto
On Mon, Jan 31, 2011 at 8:11 AM, Elwin Estle chrysalis_reb...@yahoo.com wrote: ...but I have an excuse.  I had the thing saved in a drafts folder and just hit send without thinking about it. ...I'll just go super glue broken glass to my hands and sprinkle itching powder all over my body.  

Re: [Tutor] search list with regex

2011-01-31 Thread Wayne Werner
On Mon, Jan 31, 2011 at 7:07 AM, Elwin Estle chrysalis_reb...@yahoo.comwrote: Tcl's list search command has the option to search for a list element that matches a given regex. Is there something similar in python? If not, it seems like it should be fairly trivial for me to write my own (just

Re: [Tutor] decimal module and precision

2011-01-31 Thread Richard D. Moores
On Mon, Jan 31, 2011 at 05:24, Eike Welk eike.w...@gmx.net wrote: Hello Richard! In your code:   d(123.2345274523452345235432452345) you are entering the number as a `float` and you are loosing the precision already when the code is compiled. To retain the precision all constants must be

Re: [Tutor] search list with regex

2011-01-31 Thread Elwin Estle
--- On Mon, 1/31/11, Wayne Werner waynejwer...@gmail.com wrote: From: Wayne Werner waynejwer...@gmail.com Subject: Re: [Tutor] search list with regex To: Elwin Estle chrysalis_reb...@yahoo.com Cc: tutor@python.org Date: Monday, January 31, 2011, 10:20 AM On Mon, Jan 31, 2011 at 7:07 AM, Elwin

Re: [Tutor] oops...sorry, just top posted again

2011-01-31 Thread Elwin Estle
--- On Mon, 1/31/11, David Hutto smokefl...@gmail.com wrote: From: David Hutto smokefl...@gmail.com Subject: Re: [Tutor] oops...sorry, just top posted again To: Elwin Estle chrysalis_reb...@yahoo.com Cc: tutor@python.org Date: Monday, January 31, 2011, 10:05 AM On Mon, Jan 31, 2011 at 8:11

Re: [Tutor] oops...sorry, just top posted again

2011-01-31 Thread Karim
Is this a SM forum ? Karim On 01/31/2011 04:05 PM, David Hutto wrote: On Mon, Jan 31, 2011 at 8:11 AM, Elwin Estlechrysalis_reb...@yahoo.com wrote: ...but I have an excuse. I had the thing saved in a drafts folder and just hit send without thinking about it. ...I'll just go super glue

Re: [Tutor] search list with regex

2011-01-31 Thread Alan Gauld
Elwin Estle chrysalis_reb...@yahoo.com wrote parse various text files and my standard method is to slurp the whole thing up into a string variable, then break it up into a list that I can then work on If you read it with readlines() Python will do all of that for you... HTH, -- Alan Gauld

Re: [Tutor] search list with regex

2011-01-31 Thread Elwin Estle
--- On Mon, 1/31/11, Alan Gauld alan.ga...@btinternet.com wrote: From: Alan Gauld alan.ga...@btinternet.com Subject: Re: [Tutor] search list with regex To: tutor@python.org Date: Monday, January 31, 2011, 3:29 PM Elwin Estle chrysalis_reb...@yahoo.com wrote parse various text files

Re: [Tutor] search list with regex

2011-01-31 Thread Steven D'Aprano
Alan Gauld wrote: Elwin Estle chrysalis_reb...@yahoo.com wrote parse various text files and my standard method is to slurp the whole thing up into a string variable, then break it up into a list that I can then work on If you read it with readlines() Python will do all of that for you...

Re: [Tutor] search list with regex

2011-01-31 Thread Steven D'Aprano
Elwin Estle wrote: Tcl's list search command has the option to search for a list element that matches a given regex. Is there something similar in python? Not using regexes. If not, it seems like it should be fairly trivial for me to write my own (just wondering if I would be re-inventing

[Tutor] Need Help in installing MySQLdb-Python

2011-01-31 Thread Victor Binns
I have Python 2.6.3 I went to the following link http://pypi.python.org/pypi/ Found - file (MySQL-python 1.2.3) clicked on file - clicked on (MySQL-python-1.2.3.tar.gz) unzipped the file in a created folder clicked on the file called setup.py following ERROR: Traceback (most recent

Re: [Tutor] Need Help in installing MySQLdb-Python

2011-01-31 Thread Alan Gauld
Victor Binns vic_p...@hotmail.com wrote I have Python 2.6.3 Congratulatons SqlLite should already be installed as part of the standard library. Try: import sqlite3 as sql clicked on the file called setup.py I usually run setup manually rarther than double click... serverKey =

[Tutor] OS dependence of line separators

2011-01-31 Thread Garry Willgoose
I have a code that needs to run on all platforms and generate text output files that can be read on other platforms. I'm a bit confused about how Python handles the age-old end of line character/s problem. I'm familiar with '\n' and '\r\n' dependence of Unix and Windows respectively. Also

[Tutor] Need help on Setup.py

2011-01-31 Thread Victor Binns
I have been trying to add some of the extras with python such as pywin32 and others. when i click on setup.py it does not work. I need help on the problem. Victor___ Tutor maillist - Tutor@python.org To unsubscribe