Re: syntax checker in python

2009-08-10 Thread nn
On Aug 7, 4:39 pm, horos11 horo...@gmail.com wrote: ps - I just realized that it isn't enough to do: python -c 'import /path/to/script' since that actually executes any statement inside of the script (wheras all I want to do is check syntax) So - let me reprhase that - exactly how can you

Re: Overlap in python

2009-08-05 Thread nn
On Aug 5, 7:13 am, Marcus Wanner marc...@cox.net wrote: On 8/4/2009 6:09 PM, MRAB wrote:   parts = [(5, 9, a), (7, 10, b), (3, 6, c), (15, 20, d), (18, 23, e)]   parts.sort()   parts [(3, 6, 'c'), (5, 9, 'a'), (7, 10, 'b'), (15, 20, 'd'), (18, 23, 'e')]   # Merge overlapping

Re: strange python scripting error

2009-07-24 Thread nn
On Jul 23, 7:03 pm, Dave Angel da...@ieee.org wrote: Mark Tarver wrote: I have a very strange error.  I have two test python files test.py and python.py which contain the following code #!/usr/bin/python print Content-type: text/html print print html print centerHello,

Re: library search path when compiling python

2009-07-08 Thread nn
On Jul 7, 4:06 pm, Christian Heimes li...@cheimes.de wrote: nn wrote: I am trying to compile python with ssl support but the libraries are not in /usr/lib but in /opt/freeware/lib. How do I add that folder to the default library search path? It looks like configure --libdir=DIR might do

Re: tough-to-explain Python

2009-07-08 Thread nn
On Jul 7, 5:18 pm, kj no.em...@please.post wrote: In mailman.2796.1246997332.8015.python-l...@python.org Chris Rebert c...@rebertia.com writes: You might find the following helpful (partially): http://effbot.org/zone/call-by-object.htm Extremely helpful.  Thanks!  (I learned more from it

library search path when compiling python

2009-07-07 Thread nn
I am trying to compile python with ssl support but the libraries are not in /usr/lib but in /opt/freeware/lib. How do I add that folder to the default library search path? It looks like configure --libdir=DIR might do the job but I don't want to replace the default lib search path, just add an

Re: string character count

2009-06-30 Thread nn
On Jun 30, 1:56 pm, MRAB pyt...@mrabarnett.plus.com wrote: noydb wrote: If I have a string for a file name such that I want to find the number of characters to the left of the dot, how can that be done? I did it this way: x = text12345.txt dot = x.find('.') print dot Was curious

Re: Is this pylint error message valid or silly?

2009-06-19 Thread nn
On Jun 18, 8:56 pm, Matthew Wilson m...@tplus1.com wrote: Here's the code that I'm feeding to pylint:     $ cat f.py     from datetime import datetime     def f(c=today):         if c == today:                     c = datetime.today()         return c.date() And here's what pylint

Re: Is this pylint error message valid or silly?

2009-06-19 Thread nn
On Jun 18, 8:56 pm, Matthew Wilson m...@tplus1.com wrote: Here's the code that I'm feeding to pylint:     $ cat f.py     from datetime import datetime     def f(c=today):         if c == today:                     c = datetime.today()         return c.date() And here's what pylint

Re: Is this pylint error message valid or silly?

2009-06-19 Thread nn
On Jun 18, 8:56 pm, Matthew Wilson m...@tplus1.com wrote: Here's the code that I'm feeding to pylint:     $ cat f.py     from datetime import datetime     def f(c=today):         if c == today:                     c = datetime.today()         return c.date() And here's what pylint

Re: generator expression works in shell, NameError in script

2009-06-18 Thread nn
On Jun 18, 8:38 am, guthrie grguth...@gmail.com wrote: On Jun 17, 6:38 pm, Steven Samuel Cole steven.samuel.c...@gmail.com wrote: Still don't really understand why my initial code didn't work, though... Your code certainly looks reasonable, and looks to me like it should work. The comment

<    1   2