Re: 'indent'ing Python in windows bat

2012-09-17 Thread Dave Angel
On 09/18/2012 01:08 AM, Terry Reedy wrote: > On 9/17/2012 9:08 PM, David Smith wrote: >> Hello, I'm essentially a newbie in Python. >> My problem in searching the archives is not knowing what words to use to >> ask. >> >> I'm converting windows bat files little by little to Python 3 as I find >> ti

Re: 'indent'ing Python in windows bat

2012-09-17 Thread Terry Reedy
On 9/17/2012 9:08 PM, David Smith wrote: Hello, I'm essentially a newbie in Python. My problem in searching the archives is not knowing what words to use to ask. I'm converting windows bat files little by little to Python 3 as I find time and learn Python. The most efficient method for some line

Re: Docstring parsing and formatting

2012-09-17 Thread Terry Reedy
On 9/17/2012 10:03 PM, Ben Finney wrote: Howdy all, Where can I find a standard implementation of the docstring parsing and splitting algorithm from PEP 257? I presume there is something in the code behind help(). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

How to queue functions

2012-09-17 Thread Dhananjay
Dear all, I am trying to use multiprocessing module. I have 5 functions and 2000 input files. First, I want to make sure that these 5 functions execute one after the other. Is there any way that I could queue these 5 functions within the same script ? Next, as there are 2000 input files. I coul

Re: 'indent'ing Python in windows bat

2012-09-17 Thread Chris Rebert
On Mon, Sep 17, 2012 at 8:28 PM, Dennis Lee Bieber wrote: > On Mon, 17 Sep 2012 21:08:32 -0400, David Smith > declaimed the following in gmane.comp.python.general: > >> >> How do I "indent" if I have something like: >> if (sR=='Cope'): sys.exit(1) elif (sR=='Perform') sys.exit(2) else >> sys.exit

Re: 'indent'ing Python in windows bat

2012-09-17 Thread Tim Roberts
David Smith wrote: > >I'm converting windows bat files little by little to Python 3 as I find >time and learn Python. >The most efficient method for some lines is to call Python like: >python -c "import sys; sys.exit(3)" > >How do I "indent" if I have something like: >if (sR=='Cope'): sys.exit(1)

Re: 'indent'ing Python in windows bat

2012-09-17 Thread Roy Smith
In article , Ian Kelly wrote: > On Mon, Sep 17, 2012 at 7:08 PM, David Smith wrote: > > How do I "indent" if I have something like: > > if (sR=='Cope'): sys.exit(1) elif (sR=='Perform') sys.exit(2) else > > sys.exit(3) > > How about: > > if sR == 'Cope': > sys.exit(1) > elif sR == 'Perfor

Re: 'indent'ing Python in windows bat

2012-09-17 Thread Ian Kelly
On Mon, Sep 17, 2012 at 7:08 PM, David Smith wrote: > How do I "indent" if I have something like: > if (sR=='Cope'): sys.exit(1) elif (sR=='Perform') sys.exit(2) else > sys.exit(3) How about: if sR == 'Cope': sys.exit(1) elif sR == 'Perform': sys.exit(2) else: sys.exit(3) I don't re

Docstring parsing and formatting

2012-09-17 Thread Ben Finney
Howdy all, Where can I find a standard implementation of the docstring parsing and splitting algorithm from PEP 257? PEP 257 describes a convention of structure and formatting for docstrings http://www.python.org/dev/peps/pep-0257/>. Docstrings that conform to this convention can therefore be pa

Re: 'indent'ing Python in windows bat

2012-09-17 Thread Dave Angel
On 09/17/2012 09:08 PM, David Smith wrote: > Hello, I'm essentially a newbie in Python. > My problem in searching the archives is not knowing what words to use > to ask. > > I'm converting windows bat files little by little to Python 3 as I > find time and learn Python. > The most efficient method

'indent'ing Python in windows bat

2012-09-17 Thread David Smith
Hello, I'm essentially a newbie in Python. My problem in searching the archives is not knowing what words to use to ask. I'm converting windows bat files little by little to Python 3 as I find time and learn Python. The most efficient method for some lines is to call Python like: python -c "i

Re: reportlab and python 3

2012-09-17 Thread Joel Rivera
On 2012-09-17 03:47, Laszlo Nagy wrote: Reportlab is on the wall of shame. http://python3wos.appspot.com/ Is there other ways to create PDF files from python 3? There is pyPdf. I haven't tried it yet, but it seem that it is a low level library. It does not handle "flowables" that are automatical

Re: how to use property?

2012-09-17 Thread Ian Kelly
On Mon, Sep 17, 2012 at 6:26 PM, MRAB wrote: > On 2012-09-18 00:46, Dave Angel wrote: >> An important difference from every other language I've used: The user >> of the attribute does not need to change his code when you decide it >> needs reimplementation as a property. >> >> In C++ and java, fo

Re: how to use property?

2012-09-17 Thread MRAB
On 2012-09-18 00:46, Dave Angel wrote: On 09/17/2012 07:34 PM, Terry Reedy wrote: On 9/17/2012 6:12 PM, Chris Angelico wrote: On Tue, Sep 18, 2012 at 7:55 AM, Fernando Jiménez wrote: Hi guys! I'm noob in python and I would know how to correctly use the property. I have read some things about

Re: splitting numpy array unevenly

2012-09-17 Thread Joshua Landau
On 17 September 2012 23:31, Wanderer wrote: > I need to divide a 512x512 image array with the first horizontal and > vertical division 49 pixels in. Then every 59 pixels in after that. hsplit > and vsplit want to start at the edges and create a bunch of same size > arrays. Is there a command to c

Re: how to use property?

2012-09-17 Thread Dave Angel
On 09/17/2012 07:34 PM, Terry Reedy wrote: > On 9/17/2012 6:12 PM, Chris Angelico wrote: >> On Tue, Sep 18, 2012 at 7:55 AM, Fernando Jiménez >> wrote: >>> Hi guys! >>> >>> I'm noob in python and I would know how to correctly use the >>> property. I >>> have read some things about it but I do not

Re: splitting numpy array unevenly

2012-09-17 Thread Martin De Kauwe
On Tuesday, September 18, 2012 8:31:09 AM UTC+10, Wanderer wrote: > I need to divide a 512x512 image array with the first horizontal and vertical > division 49 pixels in. Then every 59 pixels in after that. hsplit and vsplit > want to start at the edges and create a bunch of same size arrays. Is

Re: how to use property?

2012-09-17 Thread Terry Reedy
On 9/17/2012 6:12 PM, Chris Angelico wrote: On Tue, Sep 18, 2012 at 7:55 AM, Fernando Jiménez wrote: Hi guys! I'm noob in python and I would know how to correctly use the property. I have read some things about it but I do not quite understand. But I think it's a bad habit to use _ to change

Re: Comparing strings from the back?

2012-09-17 Thread Neil Hodgson
Ethan Furman: *plonk* I can't work out who you are plonking. While more than one of the posters on this thread seem worthy of a good plonk, by not including sufficient context, you've left me feeling puzzled. Is there a guideline for this in basic netiquette? Neil -- http://mail.pyt

Re: Using Py_AddPendingCall

2012-09-17 Thread Antoine Pitrou
css322 gmail.com> writes: > > (1) A worker thread calls Py_AddPendingCall and assigns a handler function. > (2) When the Python interpreter runs, it calls the handler function whenever it yields control to another thread Not exactly. As the documentation says: "If successful, func will be called

splitting numpy array unevenly

2012-09-17 Thread Wanderer
I need to divide a 512x512 image array with the first horizontal and vertical division 49 pixels in. Then every 59 pixels in after that. hsplit and vsplit want to start at the edges and create a bunch of same size arrays. Is there a command to chop off different sized arrays? Thanks -- http://

Re: how to use property?

2012-09-17 Thread Chris Angelico
On Tue, Sep 18, 2012 at 7:55 AM, Fernando Jiménez wrote: > Hi guys! > > I'm noob in python and I would know how to correctly use the property. I > have read some things about it but I do not quite understand. > > But I think it's a bad habit to use _ to change the visibility of the > attributes as

Re: how to use property?

2012-09-17 Thread Dave Angel
On 09/17/2012 05:55 PM, Fernando Jiménez wrote: > Hi guys! > > I'm noob in python and I would know how to correctly use the property. I > have read some things about it but I do not quite understand. > > I found this: > > class C(object): > def __init__(self): > self._x = None > > @

how to use property?

2012-09-17 Thread Fernando Jiménez
Hi guys! I'm noob in python and I would know how to correctly use the property. I have read some things about it but I do not quite understand. I found this: class C(object): def __init__(self): self._x = None @property def x(self): """I'm the 'x' property."""

Re: using text file to get ip address from hostname

2012-09-17 Thread Thomas Rachel
Am 15.09.2012 18:20 schrieb Dan Katorza: hello again friends, thanks for everyone help on this. i guess i figured it out in two ways. the second one i prefer the most. i will appreciate if someone can give me some tips. thanks again so... ---

Re: Comparing strings from the back?

2012-09-17 Thread Ethan Furman
*plonk* -- http://mail.python.org/mailman/listinfo/python-list

Hiring Python Developer @ CA, USA

2012-09-17 Thread nithinmoha
Job Title: Python Django Consultant Location: Scotts Valley, CA Duration: Long Term / Full Time Must: • Python - Must be an export in this language. They currently use Python 2.7 • Proficient in Unix and source code versioning - They run RedHat and Fedora on the servers and developm

Hiring Python Developer @ CA, USA

2012-09-17 Thread nithinmoha
-- http://mail.python.org/mailman/listinfo/python-list

Re: gc.get_objects()

2012-09-17 Thread Oscar Benjamin
On 2012-09-17, Matteo Boscolo wrote: > from my gc.get_object() > I extract the sub system of the object that I would like to delete: > > this is the object: > Class name > win32com.gen_py.F4503A16-F637-11D2-BD55-00500400405Bx0x1x0.ITDProperty.ITDProperty > that is traked and the reference are: >

Re: gc.get_objects()

2012-09-17 Thread Matteo Boscolo
from my gc.get_object() I extract the sub system of the object that I would like to delete: this is the object: Class name win32com.gen_py.F4503A16-F637-11D2-BD55-00500400405Bx0x1x0.ITDProperty.ITDProperty that is traked and the reference are: get_referents >>>

Re: gc.get_objects()

2012-09-17 Thread Chris Angelico
On Tue, Sep 18, 2012 at 12:16 AM, Steven D'Aprano wrote: > The __del__ method does not delete an object. Remember, objects are only > deleted when there are no references to it. Otherwise you could have some > code that tries to use a deleted object, and you would get a system crash > or BSOD. Th

Re: Obnoxious postings from Google Groups (was: datetime issue)

2012-09-17 Thread Jamie Paul Griffin
[ Joel Goldstick wrote on Sun 16.Sep'12 at 11:57:56 -0400 ] > email client to python-list@python.org If using Windows I would certainly use Thunderbird or even slrn news reader - I believe there is a version for Windows. Or you could install Interix subsystem which provides UNIX tools for Wind

Re: Decorators not worth the effort

2012-09-17 Thread Jean-Michel Pichavant
- Original Message - > Jean-Michel Pichavant wrote: [snip] > One minor note, the style of decorator you are using loses the > docstring > (at least) of the original function. I would add the > @functools.wraps(func) > decorator inside your decorator. Is there a way to not loose the funct

Re: gc.get_objects()

2012-09-17 Thread Steven D'Aprano
On Mon, 17 Sep 2012 14:42:56 +0200, Matteo Boscolo wrote: > Hi All, > > I'm facing some trouble with a win32com application, it seems, that some > com object (win32com) are still in the gc.get_objetc() list, even if I > set to non the objetc and I'm out of the scope of that objects. You can't se

gedit : gdp : python word completion

2012-09-17 Thread Mayuresh Kathe
has anyone got the above working? -- http://mail.python.org/mailman/listinfo/python-list

gc.get_objects()

2012-09-17 Thread Matteo Boscolo
Hi All, I'm facing some trouble with a win32com application, it seems, that some com object (win32com) are still in the gc.get_objetc() list, even if I set to non the objetc and I'm out of the scope of that objects. What I'm try to do is to remove this object from the list. but I do know ho

Re: Python garbage collector/memory manager behaving strangely

2012-09-17 Thread Dave Angel
On 09/17/2012 07:47 AM, Steven D'Aprano wrote: > On Mon, 17 Sep 2012 06:46:55 -0400, Dave Angel wrote: > >> On 09/16/2012 11:25 PM, alex23 wrote: >>> def readlines(f): >>> lines = [] >>> while "f is not empty": >>> line = f.readline() >>> if not line: bre

Re: Python garbage collector/memory manager behaving strangely

2012-09-17 Thread Steven D'Aprano
On Mon, 17 Sep 2012 06:46:55 -0400, Dave Angel wrote: > On 09/16/2012 11:25 PM, alex23 wrote: >> def readlines(f): >> lines = [] >> while "f is not empty": >> line = f.readline() >> if not line: break >> if len(line) > 2 and line[-2:] == '|\n

RE: Python garbage collector/memory manager behaving strangely

2012-09-17 Thread Jadhav, Alok
Thanks for your valuable inputs. This is very helpful. -Original Message- From: Python-list [mailto:python-list-bounces+alok.jadhav=credit-suisse@python.org] On Behalf Of Dave Angel Sent: Monday, September 17, 2012 6:47 PM To: alex23 Cc: python-list@python.org Subject: Re: Python gar

Re: Python garbage collector/memory manager behaving strangely

2012-09-17 Thread Dave Angel
On 09/16/2012 11:25 PM, alex23 wrote: > On Sep 17, 12:32 pm, "Jadhav, Alok" > wrote: >> - As you have seen, the line separator is not '\n' but its '|\n'. >> Sometimes the data itself has '\n' characters in the middle of the line >> and only way to find true end of the line is that previous charact

reportlab and python 3

2012-09-17 Thread Laszlo Nagy
Reportlab is on the wall of shame. http://python3wos.appspot.com/ Is there other ways to create PDF files from python 3? There is pyPdf. I haven't tried it yet, but it seem that it is a low level library. It does not handle "flowables" that are automatically split across pages. It does not han

Re: Python presentations

2012-09-17 Thread Alexander Blinne
On 16.09.2012 19:35, Steven D'Aprano wrote: > On Sun, 16 Sep 2012 18:13:36 +0200, Alexander Blinne wrote: >> def powerlist2(x,n): >> if n==1: >> return [1] >> p = powerlist3(x,n-1) >> p.append(p[-1]*x) >> return p > > Is that a typo? I think you mean to make a recursive cal

Re: Obnoxious postings from Google Groups (was: datetime issue)

2012-09-17 Thread Gene Heskett
On Sunday 16 September 2012 12:29:39 pandora.ko...@gmail.com did opine: > > > http://mail.python.org/mailman/listinfo/python-list > > > > email client to python-list@python.org > > wait a minute! i must use my ISP's news server and then post o > comp.lang.python no? No. > What is python-list@p

Re: Moving folders with content

2012-09-17 Thread Laszlo Nagy
On 2012-09-15 06:36, jyoun...@kc.rr.com wrote: Hello, I am working in both OS X Snow Leopard and Lion (10.6.8 and 10.7.4). I'm simply wanting to move folders (with their content) from various servers to the hard drive and then back to different directories on the servers. I want to be careful n

Re: Batching HTTP requests with httplib (Python 2.7)

2012-09-17 Thread Xavier Combelle
instead of Le 14/09/2012 12:56, Dwight Hutto a écrit : service_num_list = [num for num in range(0,5)] for service_num in service_num_list: eval("web_service_call%i(%i)" % (service_num,service_num)) service_num_list = [num for num in range(0,5)] for service_num in service_num_list:

BDFL Rossenbom, was Re: pythonOCC examples doesn't work?

2012-09-17 Thread Peter Otten
Dwight Hutto wrote: >>> Alan Gauld quotes, "Putting on my moderator's hat", sometimes. >>> is as you describe, a monarchy whose head but seldom exercises power; >>> >>> >>> I think it's Rossenbom(or whoever the creator of the interpreter >>> written in C is), "who says benevolent dictator for