[Tutor] question about pylab

2006-10-30 Thread shawn bright
hey there,i am trying to use a graph and chart app called matplotlib, but i cannot figgure out how to have it plot a simple chart over time.the docs say to use the function plot_date() but i cannot seem to get the values to agree. I am sending datetimes to the charting app for x, and the y is a li

Re: [Tutor] Using sys.exit()

2006-10-30 Thread Chris Hengge
Try using SPE, I've really liked it for some of extra features inside it like TODO tags that are automanaged. Also, its written in python, so thats kinda  cool factor. It's also free. On 10/30/06, Dick Moores <[EMAIL PROTECTED]> wrote: At 05:06 PM 10/30/2006, Dick Moores wrote:>I'd like to know ho

Re: [Tutor] Suggestions about documenting a function

2006-10-30 Thread Jorge Azedo
Thanks for your help guys. It will take me some time to understand exactly what you suggested to fix the function (I'm still a newb at this) but thanks for your help. I'll keep you posted on the updates :) ___ Tutor maillist - Tutor@python.org http://

Re: [Tutor] Using sys.exit()

2006-10-30 Thread Dick Moores
At 05:06 PM 10/30/2006, Dick Moores wrote: >I'd like to know how to use sys.exit() to quit a program. > >Here's a simple example: > >import sys > >c = 0 >while True: > c += 1 > if c > 1: > sys.exit() > >Now, this will certainly exit, but not without a lot of extra noise. >Is t

Re: [Tutor] Suggestions about documenting a function

2006-10-30 Thread John Fouhy
On 31/10/06, Jorge Azedo <[EMAIL PROTECTED]> wrote: > def randomList(n1,n2,len): > '''n1-n2 range of numbers, len - length of the final list > > Returns a list''' > > i=0 > rndlist=[] > if len > n2: > return 'The length of the list must be greater than n2' Comment --- t

Re: [Tutor] Running multiple version of Python on 1 windows machine

2006-10-30 Thread Kent Johnson
Todd Dahl wrote: > At work I have installed Python 2.4 but at home I have Python 2.5. > Until this point I didn't think nothing of it but now I have run into > a issue. > > I have some code that I have worked on at work that uses the pySQLite > module which doesn't support 2.5, yet. I can run my c

Re: [Tutor] Suggestions about documenting a function

2006-10-30 Thread Luke Paireepinart
Jorge Azedo wrote: > I'm writing a function that generates a list with user defined length, > that consists only of non-repeating random integers in a user defined range. > Even I don't understand what I just wrote, so I'm just going to post the > code and an example of the results :P > > ## Test

[Tutor] Suggestions about documenting a function

2006-10-30 Thread Jorge Azedo
I'm writing a function that generates a list with user defined length, that consists only of non-repeating random integers in a user defined range. Even I don't understand what I just wrote, so I'm just going to post the code and an example of the results :P ## Test module ## Last revision 31 Oc

[Tutor] Running multiple version of Python on 1 windows machine

2006-10-30 Thread Todd Dahl
At work I have installed Python 2.4 but at home I have Python 2.5. Until this point I didn't think nothing of it but now I have run into a issue. I have some code that I have worked on at work that uses the pySQLite module which doesn't support 2.5, yet. I can run my code at work but I can't even

[Tutor] Using sys.exit()

2006-10-30 Thread Dick Moores
I'd like to know how to use sys.exit() to quit a program. Here's a simple example: import sys c = 0 while True: c += 1 if c > 1: sys.exit() Now, this will certainly exit, but not without a lot of extra noise. Is there a way to use it the way I want to? Maybe with an argum

Re: [Tutor] Does it helps to learn "Regular Expressions" or ...

2006-10-30 Thread Alan Gauld
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote > > Is it useful to know re module and its functions..?? Yes. > Or the string module has enough utilities to accomplish string > manipulation..!!! The string module is deprecated but (most of) its features are now found as methods of string object

Re: [Tutor] am I a dope? - nasty_exception_str =.....

2006-10-30 Thread Alan Gauld
"Michael Daly" <[EMAIL PROTECTED]> wrote > when I tried to start a program called 'zope' that depends on > python, Hmm, Zope is rather more than a mere program. It is a very powerful environment containing lots of fairly sophisticated bits n pieces. Did you read through all the Zope installation

Re: [Tutor] paypal alternative

2006-10-30 Thread Danny Yoo
On Mon, 30 Oct 2006, Over Stock wrote: > International Money Transfer money transfer. [disgusting advertisement cut] [META: admin] This is crass, and deserves an appropriate response. I'm kicking 'Over Stock' off the python-tutor mailing list. I'm now CCing the other list admins on the ot

Re: [Tutor] documentation/sourceforge bug help

2006-10-30 Thread C or L Smith
Danny Yoo wrote: | On Mon, 30 Oct 2006, C or L Smith wrote: | || Can anyone help me figure out how to actually get logged in so I can || file the report? | | Do you happen to have cookies disabled? You might need to enable | them, since that's what SF will use to track your login status. I'm |

Re: [Tutor] Matching on multiple log lines

2006-10-30 Thread Matthew Warren
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Kent Johnson > Sent: 30 October 2006 11:55 > Cc: tutor@python.org > Subject: Re: [Tutor] Matching on multiple log lines > > wesley chun wrote: > >> so it's guaranteed that 'Writing Message to' > >>

[Tutor] paypal alternative

2006-10-30 Thread Over Stock
International Money Transfer money transfer. Send money to anyone with an email address! http://www.vegacash.com/ paypal alternative ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] problem importing class

2006-10-30 Thread Danny Yoo
> This only works for code that is in a package, when you want to import a > module in the same package. It doesn't work for code that is not in a > package. For example, > > F:\Tutor>cat site.py > print 'imported site.py' > > F:\Tutor>cat siteimporter.py > from __future__ import absolute_import >

Re: [Tutor] python decorators

2006-10-30 Thread euoar
Kent Johnson escribió: > euoar wrote: >> Could somebody explain or point to a good place to learn what are >> python decorators, and when should they be used? > > http://www.python.org/doc/2.4.4/whatsnew/node6.html > http://wiki.python.org/moin/PythonDecoratorLibrary > http://www.phyast.pitt.edu/~

Re: [Tutor] line number when reading files using csv module

2006-10-30 Thread Kent Johnson
Duncan Gibson wrote: > Duncan Gibson wrote: >>> import csv >>> >>> class MyReader(object): >>> >>> def __init__(self, inputFile): >>> self.reader = csv.reader(inputFile, delimiter=' ') >>> self.lineNumber = 0 >>> >>> def __iter__(self): >>>

Re: [Tutor] documentation/sourceforge bug help

2006-10-30 Thread Senthil_OR
C or L Smith wrote: > I know this is off topic, but can anyone give me a hand? I have a > sourceforge account. I want to make a correction to the python > documentation. I click on the appropriate link at the bottom of the > documentation page and then the bug tracker link on the page that I > am s

Re: [Tutor] problem importing class

2006-10-30 Thread Kent Johnson
Danny Yoo wrote: >>> This isn't the first time this kind of problem has hit people. This >>> problem is well known and is the subject of a Python Enhancement Proposal >>> (PEP 328). If you're using Python 2.5, you can use a new feature called >>> 'absolute_import' to avoid the import problem. Se

Re: [Tutor] basic question ...

2006-10-30 Thread Kent Johnson
Danny Yoo wrote: > If you want to get an overview of the extent of Python's library, try the > table of contents: > > http://www.python.org/doc/lib/ > > There's a heck of a lot of stuff there, so asking someone to memorize it > is ridiculous. Still, it can help to scan through it sometime

Re: [Tutor] python decorators

2006-10-30 Thread Kent Johnson
euoar wrote: > Could somebody explain or point to a good place to learn what are python > decorators, and when should they be used? http://www.python.org/doc/2.4.4/whatsnew/node6.html http://wiki.python.org/moin/PythonDecoratorLibrary http://www.phyast.pitt.edu/~micheles/python/documentation.html

Re: [Tutor] Does it helps to learn "Regular Expressions" or ...

2006-10-30 Thread Asrarahmed Kadri
Thanks a lot, Danny. Yeah, my goal is to do XML parsing and for that I will be using ElementTree. As you pointed out, regular expressions are very powerful, so I better get some idea of about them.   Cheers. Asrarahmed  On 10/30/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > Is it useful to know re mod

Re: [Tutor] Does it helps to learn "Regular Expressions" or ...

2006-10-30 Thread Danny Yoo
> Is it useful to know re module and its functions..?? HI Asrarahmed, Yes. Most people find them to be invaluable in their day-to-day work. The problem is that they're powerful enough that they look like an all-in-one tool: it's tempting to use them, even when they are the wrong tool for the

Re: [Tutor] documentation/sourceforge bug help

2006-10-30 Thread Danny Yoo
On Mon, 30 Oct 2006, C or L Smith wrote: > Can anyone help me figure out how to actually get logged in so I can > file the report? Do you happen to have cookies disabled? You might need to enable them, since that's what SF will use to track your login status. I'm getting the feeling that i

[Tutor] Does it helps to learn "Regular Expressions" or ...

2006-10-30 Thread Asrarahmed Kadri
Hi Folks,   Is it useful to know re module and its functions..??   Or the string module has enough utilities to accomplish string manipulation..!!!   Any suggestions??   Regards, Asrarahmed -- To HIM you shall return. ___ Tutor maillist - Tutor@python.

Re: [Tutor] Matching on multiple log lines

2006-10-30 Thread Kent Johnson
wesley chun wrote: >> so it's guaranteed that 'Writing Message to' >> will always be followed by 'TRANSPORT_STREAM_ID' >> before the next occurrence of 'Writing Message to' >> and all text between can be ignored, >> and we increment the counter if and only if >> there is a newline immediately after

Re: [Tutor] name is not defined error (fwd)

2006-10-30 Thread Kent Johnson
Danny Yoo wrote: > > -- Forwarded message -- > Date: Sun, 29 Oct 2006 12:33:58 -0500 > From: Kristinn Didriksson <[EMAIL PROTECTED]> > To: Danny Yoo <[EMAIL PROTECTED]> > Subject: Re: [Tutor] name is not defined error > > Hi Danny, > Thanks :) > The program works now. I'll take a

[Tutor] documentation/sourceforge bug help

2006-10-30 Thread C or L Smith
I know this is off topic, but can anyone give me a hand? I have a sourceforge account. I want to make a correction to the python documentation. I click on the appropriate link at the bottom of the documentation page and then the bug tracker link on the page that I am sent to which takes me to

Re: [Tutor] re-import

2006-10-30 Thread Kent Johnson
Glenn T Norton wrote: > jhl wrote: > >> Hi- >> >> How is the 1st import of a module removed so that new edits on the >> module can be re-imported? >> > Read about reload here: > http://docs.python.org/lib/built-in-funcs.html Make sure you understand the limitations of reload(). In particular, n

Re: [Tutor] automatically add it to all the classes

2006-10-30 Thread Kent Johnson
anil maran wrote: > All the classes in my webpy application have the following lines > is there anyway to automatically add it to all the classes in code.py, > user.py > If it is too basic, please pardon my naivette. > thanks > John > These are the lines shared by all classes, >@checkaccess(a

[Tutor] am I a dope? - nasty_exception_str =.....

2006-10-30 Thread Michael Daly
Hello python tutor when I tried to start a program called 'zope' that depends on python, I got this message at the bottom of a lot of 'traceback'*, and 'zope' didn't start: nasty_exception_str = Exception.__str__.im_func AttributeError: 'wrapper_descriptor' object has no attribute 'im_func' zope

Re: [Tutor] line number when reading files using csv module

2006-10-30 Thread Duncan Gibson
Duncan Gibson wrote: > > > > import csv > > > > class MyReader(object): > > > > def __init__(self, inputFile): > > self.reader = csv.reader(inputFile, delimiter=' ') > > self.lineNumber = 0 > > > > def __iter__(self): > > self.

Re: [Tutor] automatically add it to all the classes

2006-10-30 Thread Alan Gauld
"anil maran" <[EMAIL PROTECTED]> wrote > All the classes in my webpy application have the following lines > is there anyway to automatically add it to all the classes in > code.py, > user.py Without more information about your application we can't give a definitive answer. But if they inherit f