execnet-1.0.5 released: doc finalization fixes

2010-02-08 Thread holger krekel
execnet is a small and stable pure-python library for working with local or remote clusters of Python interpreters, with ease. It supports seamless instantiation of and interaction with remote interpreters through the 'ssh' command line tool. It supports Python 2.4-3.1, Jython-2.5.1 and

ANN: PyBindGen 0.14

2010-02-08 Thread Gustavo Carneiro
PyBindGen is a Python module that is geared to generating C/C++ code that binds a C/C++ library for Python. It does so without extensive use of either C++ templates or C pre-processor macros. It has modular handling of C/C++ types, and can be easily extended with Python plugins. The generated code

[ANN] Leipzig Python User Group - Meeting, February 9, 2010, 08:00pm

2010-02-08 Thread Mike Müller
=== Leipzig Python User Group === We will meet on Tuesday, February 9 8:00 pm at the training center of Python Academy in Leipzig, Germany ( http://www.python-academy.com/center/find.html ). Stefan Schwarzer will rehearse his presentation for the Chemnitzer Linux Tage titled Robustere

[ANN] Next Meeting of pyCologne, February, 10th

2010-02-08 Thread Thomas Lenarz
Hello, The next meeting of pyCologne will take place Wednesday, February, 10th starting about 6.30 pm - 6.45 pm at Room 0.14, Benutzerrechenzentrum (RRZK-B) University of Cologne, Berrenrather Str. 136, 50937 Köln, Germany Agenda: -editmoin (Reimar Bauer) -Using MoinMoin-Templates (Reimar

Re: Modifying Class Object

2010-02-08 Thread Gerard Flanagan
Arnaud Delobelle wrote: Alf P. Steinbach al...@start.no writes: * Chris Rebert: On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test: def __init__(self,

Re: SQLite3: preventing new file creation

2010-02-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gnarlodious wrote: Every time I say something like: connection=sqlite3.connect(file) sqlite creates a new database file. Can this behavior be suppressed through SQLite? Or am I forced to check for the file existing first? This is due to the

Re: execute sqlite3 dot commands in python

2010-02-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 gintare statkute wrote: Does anybody know if it possible to execute sqlite3 dot commands in python? The dot commands are parsed and executed by different code not part of the standard SQLite library. However if you want interactive shell

Re: Help with regex search-and-replace (Perl to Python)

2010-02-08 Thread Anthra Norell
Schif Schaf wrote: On Feb 7, 8:57 am, Tim Chase python.l...@tim.thechases.com wrote: Steve Holden wrote: Really? Under what circumstances does a simple one-for-one character replacement operation fail? Failure is only defined in the clarified context of what the OP wants :)

Re: ctypes Structure serialization

2010-02-08 Thread rych
OK, an easier question, hopefully. How to unpack all fields from ctypes Structure line by line and save into the name-value pairs? -- http://mail.python.org/mailman/listinfo/python-list

The Case For Do-Once

2010-02-08 Thread Lawrence D'Oliveiro
I wrote my first Python extension library over the last couple of weeks. I took note of all the recommendations to keep track of reference counts, to ensure that objects were not disposed when they shouldn’t be, and were when they should. However, the example code seems to use gotos. And the

Re: Executing Commands From Windows Service

2010-02-08 Thread T
Thanks for the suggestions - I think my next step is to try running it under an admin user account, as you guys both mentioned. Alf - you're absolutely right, Microsoft has srvany.exe, which allows you to run any EXE as a Windows service. I've done this in the past, but it's more of a hack..so

Re: xmlrpc slow in windows 7 if hostnames are used

2010-02-08 Thread Pete Forman
Gabriel Genellina gagsl-...@yahoo.com.ar writes: En Sat, 06 Feb 2010 22:15:48 -0300, Jean-Michel Pichavant jeanmic...@sequans.com escribió: I'm puzzled. Unless my english is failing me, everything would be solved using hostnames if I follow you. Why don't you do that ? I am no network/IP

Re: python admin abuse complaint

2010-02-08 Thread John Bokma
Daniel Fetchinson fetchin...@googlemail.com writes: One more thing: Yeah, one more thing: since you are all for a better community why not reply without quoting the entire message? Just quote enough to provide some decent context. Xah is just a spammer. It amazes me how often people want to

Re: python admin abuse complaint

2010-02-08 Thread Steven D'Aprano
On Sun, 07 Feb 2010 13:57:13 +0100, Daniel Fetchinson wrote: having a single c.l.p clown is tolerable if it makes him happy. Why should we care about his happiness if it comes at the expense of the happiness of hundreds of other people? I mean, if he decided that his happiness was best

Re: Executing Commands From Windows Service

2010-02-08 Thread Sean DiZazzo
It's working fine when I run it via servicename debug - that's how I was testing before.  It's when I start the service that it fails - and you can see that, when you run it with debug, plink.exe runs under my username.  When I run it as a service, it runs under System... You can have the

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread Stefan Behnel
Paul Rubin, 04.02.2010 02:51: John Nagle writes: Analysis of each domain is performed in a separate process, but each process uses multiple threads to read process several web pages simultaneously. Some of the threads go compute-bound for a second or two at a time as they parse web

Re: Modifying Class Object

2010-02-08 Thread Duncan Booth
T misceveryth...@gmail.com wrote: Oops, this one was my fault - the object I was having the issues with was actually a shelve file, not a dictionary..so just re-assigning the variable isn't working, but re-writing the object to the shelve file does. So in this case, is there any way to just

Re: threading+popen2 hang

2010-02-08 Thread lofic
On 7 fév, 17:00, a...@pythoncraft.com (Aahz) wrote: In article 188bfb67-3334-4325-adfc-3fa4d28f0...@d27g2000yqn.googlegroups.com, lofic  louis.coill...@gmail.com wrote: Works fine on RHEL5/python 2.4.3 Hangs on RHEL4/python 2.3.4 Then use Python 2.4 -- surely you don't expect anyone to

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread Paul Rubin
Stefan Behnel stefan...@behnel.de writes: Well, if multi-core performance is so important here, then there's a pretty simple thing the OP can do: switch to lxml. http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ Well, lxml is uses libxml2, a fast XML parser written in C,

Re: intolerant HTML parser

2010-02-08 Thread Stefan Behnel
Jim, 06.02.2010 20:09: I generate some HTML and I want to include in my unit tests a check for syntax. So I am looking for a program that will complain at any syntax irregularities. First thing to note here is that you should consider switching to an HTML generation tool that does this

Re: The Case For Do-Once

2010-02-08 Thread Stefan Behnel
Lawrence D'Oliveiro, 08.02.2010 09:53: I wrote my first Python extension library over the last couple of weeks. I took note of all the recommendations to keep track of reference counts, to ensure that objects were not disposed when they shouldn’t be, and were when they should. This sounds

Re: Import question

2010-02-08 Thread Andrew Degtiariov
2010/2/6 Gabriel Genellina gagsl-...@yahoo.com.ar En Fri, 05 Feb 2010 13:21:47 -0300, Andrew Degtiariov andrew.degtiar...@gmail.com escribió: Code of our project has split into several packages and we deploy the project using buildout. All worked fine until I need to dynamically inspect

Re: How to print all expressions that match a regular expression

2010-02-08 Thread Gabriel Genellina
En Mon, 08 Feb 2010 02:17:59 -0300, hzh...@gmail.com hzh...@gmail.com escribió: Please check out this example on the pyparsing wiki, invRegex.py:http://pyparsing.wikispaces.com/file/view/invRegex.py. This code implements a generator that returns successive matching strings for the given

Re: intolerant HTML parser

2010-02-08 Thread Lawrence D'Oliveiro
In message 4b6fd672$0$6734$9b4e6...@newsspool2.arcor-online.net, Stefan Behnel wrote: Jim, 06.02.2010 20:09: I generate some HTML and I want to include in my unit tests a check for syntax. So I am looking for a program that will complain at any syntax irregularities. First thing to note

Re: How to print all expressions that match a regular expression

2010-02-08 Thread Gabriel Genellina
En Mon, 08 Feb 2010 02:17:59 -0300, hzh...@gmail.com hzh...@gmail.com escribió: Please check out this example on the pyparsing wiki, invRegex.py:http://pyparsing.wikispaces.com/file/view/invRegex.py. This code implements a generator that returns successive matching strings for the given

Re: convention for documenting function parameters in doc strings

2010-02-08 Thread Jean-Michel Pichavant
danielx wrote: Is there a convention for how to document function (or method) parameters in doc strings? Recently, I've been doing alot of PHP programming, and in PHPdoc, you'd do it like this: /* * @param type $foo Description. * * @return type Description. */ function bar($foo) { ... }

Re: intolerant HTML parser

2010-02-08 Thread Stefan Behnel
Lawrence D'Oliveiro, 08.02.2010 11:19: In message 4b6fd672$0$6734$9b4e6...@newsspool2.arcor-online.net, Stefan Behnel wrote: Jim, 06.02.2010 20:09: I generate some HTML and I want to include in my unit tests a check for syntax. So I am looking for a program that will complain at any

use strings to call functions

2010-02-08 Thread Klaus Neuner
Hello, I am writing a program that analyzes files of different formats. I would like to use a function for each format. Obviously, functions can be mapped to file formats. E.g. like this: if file.endswith('xyz'): xyz(file) elif file.endswith('abc'): abc(file) ... Yet, I would prefer to

Re: use strings to call functions

2010-02-08 Thread Bruno Desthuilliers
Klaus Neuner a écrit : Hello, I am writing a program that analyzes files of different formats. I would like to use a function for each format. Obviously, functions can be mapped to file formats. E.g. like this: if file.endswith('xyz'): xyz(file) elif file.endswith('abc'): abc(file)

Create a backslash-escaped version of a string?

2010-02-08 Thread boblatest
Hello, I'd like to have control characters in a string to be converted to their backslash-escaped counterparts. I looked in the encoders section of the string module but couldn't find anything appropriate. I could write it myself but I'm sure something of the sort exists. The hypothetical method

speed of server

2010-02-08 Thread Bujji
hi all, how to find the speed of a particular server ( suppose it is hosting a site yahoo.com) how can i find it using python script whether it is slow or faster on that time help me thanks Bujji -- http://mail.python.org/mailman/listinfo/python-list

Re: Create a backslash-escaped version of a string?

2010-02-08 Thread Chris Rebert
On Mon, Feb 8, 2010 at 3:14 AM, boblatest boblat...@googlemail.com wrote: Hello, I'd like to have control characters in a string to be converted to their backslash-escaped counterparts. I looked in the encoders section of the string module but couldn't find anything appropriate. I could

Re: use strings to call functions

2010-02-08 Thread Klaus Neuner
A file extension is not necessarily 3 chars long. No, of course not. But it is, if I choose to use only (self-made) file endings that are 3 chars long. Anyway, it was just an example. handlers = {     .txt : handle_txt,     .py : handle_py,     # etc     } That is exactly what I would

Re: use strings to call functions

2010-02-08 Thread Dave Angel
Klaus Neuner wrote: Hello, I am writing a program that analyzes files of different formats. I would like to use a function for each format. Obviously, functions can be mapped to file formats. E.g. like this: if file.endswith('xyz'): xyz(file) elif file.endswith('abc'): abc(file) ...

Re: use strings to call functions

2010-02-08 Thread Wojciech Muła
Klaus Neuner klausneune...@googlemail.com wrote: handlers = {     .txt : handle_txt,     .py : handle_py,     # etc     } That is exactly what I would like to avoid: Having to map the function 'handle_txt' to '.txt'. Firstly, because I don't want to repeat anything and secondly,

Re: use strings to call functions

2010-02-08 Thread Tim Golden
On 08/02/2010 11:26, Klaus Neuner wrote: A file extension is not necessarily 3 chars long. No, of course not. But it is, if I choose to use only (self-made) file endings that are 3 chars long. Anyway, it was just an example. handlers = { .txt : handle_txt, .py : handle_py, #

Re: Modifying Class Object

2010-02-08 Thread Steve Holden
Steven D'Aprano wrote: On Sun, 07 Feb 2010 22:03:06 -0500, Steve Holden wrote: Alf: This topic was discussed at great, nay interminable, length about a year ago. I'd appreciate it if you would search the archives and read what was said then rather than hashing the whole topic over again to

Re: use strings to call functions

2010-02-08 Thread Jean-Michel Pichavant
Klaus Neuner wrote: Hello, I am writing a program that analyzes files of different formats. I would like to use a function for each format. Obviously, functions can be mapped to file formats. E.g. like this: if file.endswith('xyz'): xyz(file) elif file.endswith('abc'): abc(file) ...

Re: Modifying Class Object

2010-02-08 Thread Steve Holden
Alf P. Steinbach wrote: * Steve Holden: [...] Alf: This topic was discussed at great, nay interminable, length about a year ago. I'd appreciate it if you would search the archives and read what was said then rather than hashing the whole topic over again to nobody's real advantage. Well

Re: use strings to call functions

2010-02-08 Thread Stefan Behnel
Klaus Neuner, 08.02.2010 11:57: I am writing a program that analyzes files of different formats. I would like to use a function for each format. Obviously, functions can be mapped to file formats. E.g. like this: if file.endswith('xyz'): xyz(file) elif file.endswith('abc'):

Re: Modifying Class Object

2010-02-08 Thread Steve Holden
Gerard Flanagan wrote: Arnaud Delobelle wrote: Alf P. Steinbach al...@start.no writes: * Chris Rebert: On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test:

Re: use strings to call functions

2010-02-08 Thread Steve Holden
Klaus Neuner wrote: A file extension is not necessarily 3 chars long. No, of course not. But it is, if I choose to use only (self-made) file endings that are 3 chars long. Anyway, it was just an example. handlers = { .txt : handle_txt, .py : handle_py, # etc } That

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread Antoine Pitrou
Le Tue, 02 Feb 2010 15:02:49 -0800, John Nagle a écrit : I know there's a performance penalty for running Python on a multicore CPU, but how bad is it? I've read the key paper (www.dabeaz.com/python/GIL.pdf), of course. It would be adequate if the GIL just limited Python to running on one

Re: Calendar GUI

2010-02-08 Thread jfabiani
Jean-Michel Pichavant wrote: Michael Torrie wrote: Gabriel wrote: On Fri, Feb 5, 2010 at 9:08 PM, William Gaggioli wgaggi...@gmail.com wrote: I'm working on setting up some software for a Peruvian non-profit to help them organize their incoming volunteers. One of the features I'd

Python User Group near Cheltenham, UK ?

2010-02-08 Thread Timothy W. Grove
Anyone know of an 'active' Python User Group near Cheltenham, UK? I spotted one in Birmingham (http://www.pywm.eu), but would like one a little closer ... :-) Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Python User Group near Cheltenham, UK ?

2010-02-08 Thread Tim Golden
On 08/02/2010 14:22, Timothy W. Grove wrote: Anyone know of an 'active' Python User Group near Cheltenham, UK? I spotted one in Birmingham (http://www.pywm.eu), but would like one a little closer ... :-) Don't think there's anything further west than Northants / W. Midlands. There are Open

Re: C/C++ Import

2010-02-08 Thread 7H3LaughingMan
The folder does contain a file named '__init__.py'. However it contains nothing inside of the file. On Feb 8, 12:42 am, Austin Bingham austin.bing...@gmail.com wrote: Does the 'python' directory contain a file named '__init__.py'? This is required to let that directory act as a package

Re: Simple question about Queue.Queue and threads

2010-02-08 Thread Steven
On Feb 5, 7:45 am, Frank Millman fr...@chagford.com wrote: Hi all Assume you have a server process running, a pool of worker threads to perform tasks, and aQueue.Queue() to pass the tasks to the workers. In order to shut down the server cleanly, you want to ensure that the workers have all

Re: use strings to call functions

2010-02-08 Thread Gerard Flanagan
Klaus Neuner wrote: Hello, I am writing a program that analyzes files of different formats. I would like to use a function for each format. Obviously, functions can be mapped to file formats. E.g. like this: if file.endswith('xyz'): xyz(file) elif file.endswith('abc'): abc(file) ...

Re: Modifying Class Object

2010-02-08 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Steve Holden: [...] Alf: This topic was discussed at great, nay interminable, length about a year ago. I'd appreciate it if you would search the archives and read what was said then rather than hashing the whole topic over again to nobody's real

Re: method names nounVerb or verbNoun

2010-02-08 Thread Wanderer
On Feb 5, 5:21 pm, Wanderer wande...@dialup4less.com wrote: On Feb 5, 4:53 pm, Chris Rebert c...@rebertia.com wrote: On Fri, Feb 5, 2010 at 1:49 PM, Wanderer wande...@dialup4less.com wrote: On Feb 5, 3:26 pm, Chris Rebert c...@rebertia.com wrote: On Fri, Feb 5, 2010 at 11:53 AM,

Re: Create a backslash-escaped version of a string?

2010-02-08 Thread boblatest
On Feb 8, 12:28 pm, Chris Rebert c...@rebertia.com wrote: print a.encode(string-escape) How could I miss that? I was on that doc page already. Should have typed /escape in the browser ;-) Thanks, robert -- http://mail.python.org/mailman/listinfo/python-list

Re: [PyOpenGL-Users] Mouse wheel events?

2010-02-08 Thread Gary Herron
Craig Berry wrote: On Sun, Feb 7, 2010 at 22:26, Gary Herron gher...@islandtraining.com wrote: Didn't I answer this already? If you did, for whatever reason I didn't see it; I just rechecked my inbox to be sure. Thanks for doing so again! I assume, given the list we're on, that

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread J Kenneth King
Paul Rubin no.em...@nospam.invalid writes: Stefan Behnel stefan...@behnel.de writes: Well, if multi-core performance is so important here, then there's a pretty simple thing the OP can do: switch to lxml. http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ Well, lxml is

Re: threading+popen2 hang

2010-02-08 Thread Aahz
In article 2542cf60-a193-4087-a1fe-1d60ee13c...@v25g2000yqk.googlegroups.com, lofic louis.coill...@gmail.com wrote: On 7 f=E9v, 17:00, a...@pythoncraft.com (Aahz) wrote: In article 188bfb67-3334-4325-adfc-3fa4d28f0...@d27g2000yqn.googlegroups= .com, lofic =A0louis.coill...@gmail.com wrote:

Re: Executing Commands From Windows Service

2010-02-08 Thread T
On Feb 8, 1:28 am, Sean DiZazzo half.ital...@gmail.com wrote: On Feb 7, 4:57 pm, T misceveryth...@gmail.com wrote: Thanks for the suggestions -  I think my next step is to try running it under an admin user account, as you guys both mentioned.  Alf - you're absolutely right, Microsoft has

Re: C/C++ Import

2010-02-08 Thread Terry Reedy
On 2/7/2010 10:56 PM, 7H3LaughingMan wrote: To make the background information short, I am trying to take a program that uses Python for scripting and recompile it for Linux since it originally was built to run on Win32. The program itself was designed to be able to be compiled on Linux and

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread John Krukoff
On Mon, 2010-02-08 at 01:10 -0800, Paul Rubin wrote: Stefan Behnel stefan...@behnel.de writes: Well, if multi-core performance is so important here, then there's a pretty simple thing the OP can do: switch to lxml. http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/

Re: Your beloved python features

2010-02-08 Thread mk
Steven D'Aprano wrote: On Fri, 05 Feb 2010 18:29:07 +0100, mk wrote: Ethan Furman wrote: http://www1.american.edu/academic.depts/cas/econ/faculty/isaac/ choose_python.pdf Choose to get your difficult questions about threads in Python ignored. Oh well.. With an attitude like that,

Re: Modifying Class Object

2010-02-08 Thread T
On Feb 8, 4:00 am, Duncan Booth duncan.bo...@invalid.invalid wrote: T misceveryth...@gmail.com wrote: Oops, this one was my fault - the object I was having the issues with was actually a shelve file, not a dictionary..so just re-assigning the variable isn't working, but re-writing the

Re: intolerant HTML parser

2010-02-08 Thread Phlip
Stefan Behnel wrote: I don't read it that way. There's a huge difference between - generating HTML manually and validating (some of) it in a unit test and - generating HTML using a tool that guarantees correct HTML output the advantage of the second approach being that others have

Re: Modifying Class Object

2010-02-08 Thread Duncan Booth
T misceveryth...@gmail.com wrote: Duncan - Thanks for your help. So each of the shelve entries I'm modifying look something like this: myshelve[key] TestClassObject(param1, param2, param3, param4, param5, etc.). In this case, with quite a few parameters, would you suggest setting

Re: intolerant HTML parser

2010-02-08 Thread Phlip
and the tweak is: parser = etree.HTMLParser(recover=False) return etree.HTML(xml, parser) That reduces tolerance. The entire assert_xml() is (apologies for wrapping lines!): def _xml_to_tree(self, xml): from lxml import etree self._xml = xml

Re: Modifying Class Object

2010-02-08 Thread Diez B. Roggisch
Am 08.02.10 02:51, schrieb Alf P. Steinbach: * Chris Rebert: On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test: def __init__(self, param1, param2, param3):

Re: Modifying Class Object

2010-02-08 Thread Alf P. Steinbach
* Diez B. Roggisch: Am 08.02.10 02:51, schrieb Alf P. Steinbach: * Chris Rebert: On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test: def __init__(self,

Re: Import question

2010-02-08 Thread Gabriel Genellina
En Mon, 08 Feb 2010 06:37:53 -0300, Andrew Degtiariov andrew.degtiar...@gmail.com escribió: 2010/2/6 Gabriel Genellina gagsl-...@yahoo.com.ar En Fri, 05 Feb 2010 13:21:47 -0300, Andrew Degtiariov andrew.degtiar...@gmail.com escribió: Code of our project has split into several packages and we

Re: use strings to call functions

2010-02-08 Thread OdarR
On 8 fév, 11:57, Klaus Neuner klausneune...@googlemail.com wrote: Hello, I am writing a program that analyzes files of different formats. I would like to use a function for each format. Obviously, functions can be mapped to file formats. E.g. like this: if file.endswith('xyz'):    

Re: use strings to call functions

2010-02-08 Thread Gary Herron
OdarR wrote: On 8 fév, 11:57, Klaus Neuner klausneune...@googlemail.com wrote: Hello, I am writing a program that analyzes files of different formats. I would like to use a function for each format. Obviously, functions can be mapped to file formats. E.g. like this: if

setuptools/distutil and pywin32

2010-02-08 Thread Giampaolo Rodola'
Hi, I have a program which requires pywin32 as a dependancy and I'd like to make setuptools automatically retrieve it from internet and install it. My setup.py script looks like this: from setuptools import setup setup( ... ... install_requires = ['pywin32']

Re: Your beloved python features

2010-02-08 Thread geremy condra
On Mon, Feb 8, 2010 at 12:07 PM, mk mrk...@gmail.com wrote: Steven D'Aprano wrote: On Fri, 05 Feb 2010 18:29:07 +0100, mk wrote: Ethan Furman wrote: http://www1.american.edu/academic.depts/cas/econ/faculty/isaac/ choose_python.pdf Choose to get your difficult questions about threads in

Does anyone have a Python Logic Map/Flow Chart? (Example Provided)

2010-02-08 Thread spike
Has anyone been able to come across a Python logic map or flow chart? An example can be seen here on the right: http://en.wikipedia.org/wiki/Usenet This would be very helpful for users. -- http://mail.python.org/mailman/listinfo/python-list

Python Logic Map/Logic Flow Chart. (Example Provided)

2010-02-08 Thread spike
Has anyone been able to come across a Python logic map or Python logic flow chart? An example can be seen on the right under History: http://en.wikipedia.org/wiki/Usenet#History This would be very helpful for all users. -- http://mail.python.org/mailman/listinfo/python-list

Awful book warning: How to think like a (Python) programmer - non-working examples

2010-02-08 Thread Dave Peterson
Page 7: Very first example doesn't compile: syntax error Pate 11: 2nd example: syntax error Page 12, printing digits: syntax error Page 13, printing a number: syntax error page 14, statements: syntax error -- http://mail.python.org/mailman/listinfo/python-list

Re: Awful book warning: How to think like a (Python) programmer - non-working examples

2010-02-08 Thread Benjamin Kaplan
On Mon, Feb 8, 2010 at 3:36 PM, Dave Peterson inva...@gmail.com wrote: Page 7: Very first example doesn't compile: syntax error Pate 11: 2nd example: syntax error Page 12, printing digits: syntax error Page 13, printing a number: syntax error page 14, statements: syntax error Let me guess,

Re: Awful book warning: How to think like a (Python) programmer - non-working examples

2010-02-08 Thread Robert Kern
On 2010-02-08 14:36 PM, Dave Peterson wrote: Page 7: Very first example doesn't compile: syntax error Pate 11: 2nd example: syntax error Page 12, printing digits: syntax error Page 13, printing a number: syntax error page 14, statements: syntax error This book was written for the 2.x versions

Re: Awful book warning: How to think like a (Python) programmer - non-working examples

2010-02-08 Thread Andrej Mitrovic
The book covers Python 2.x syntax. You might have downloaded Python 3.1, which has different syntax then Python 2.x. From what I can tell, the first example on page 7 is print 1 + 1. Try issuing this command: print(1 + 1) If everything goes well, and you get '2' as the answer, then you're

glibc detected double free or corruption

2010-02-08 Thread Aryeh Leib Taurog
I'm encountering the following error on my fastcgi web server and would greatly appreciate ANY pointers for debugging/fixing this problem. *** glibc detected *** /usr/bin/python2.5: double free or corruption (fasttop): 0x08b47d60 *** If I don't set MALLOC_CHECK_ then the server just hangs and

Re: Awful book warning: How to think like a (Python) programmer - non-working examples

2010-02-08 Thread David Malcolm
On Mon, 2010-02-08 at 12:53 -0800, Andrej Mitrovic wrote: The book covers Python 2.x syntax. You might have downloaded Python 3.1, which has different syntax then Python 2.x. From what I can tell, the first example on page 7 is print 1 + 1. Try issuing this command: print(1 + 1) If

Re: Simulating logging.exception with another traceback

2010-02-08 Thread Vinay Sajip
On Feb 7, 11:22 am, Joan Miller pelok...@gmail.com wrote: I would want to get the output from `logging.exception` but with traceback from the caller function (I've already all that information). This would be the error withlogging.exception: ERROR:   PipeError('/bin/ls

Ternary plus

2010-02-08 Thread Martin Drautzburg
Just for the hell of it ... I can easily define __plus__() with three parameters. If the last one is optional the + operation works as expected. Is there a way to pass the third argument to + -- http://mail.python.org/mailman/listinfo/python-list

Re: Ternary plus

2010-02-08 Thread Robert Kern
On 2010-02-08 14:59 PM, Martin Drautzburg wrote: Just for the hell of it ... I can easily define __plus__() with three parameters. If the last one is optional the + operation works as expected. Is there a way to pass the third argument to + No. -- Robert Kern I have come to believe that the

Re: Awful book warning: How to think like a (Python) programmer - non-working examples

2010-02-08 Thread Andrej Mitrovic
On Feb 8, 10:14 pm, David Malcolm dmalc...@redhat.com wrote: On Mon, 2010-02-08 at 12:53 -0800, Andrej Mitrovic wrote: The book covers Python 2.x syntax. You might have downloaded Python 3.1, which has different syntax then Python 2.x. From what I can tell, the first example on page 7 is

Re: use strings to call functions

2010-02-08 Thread Aahz
In article 0efe23a6-b16d-4f92-8bc0-12d056bf5...@z26g2000yqm.googlegroups.com, OdarR olivier.da...@gmail.com wrote: and with eval(), did you try ? WARNING: eval() is almost always the wrong answer to any question -- Aahz (a...@pythoncraft.com) * http://www.pythoncraft.com/

Re: Python Logic Map/Logic Flow Chart. (Example Provided)

2010-02-08 Thread Gary Herron
spike wrote: Has anyone been able to come across a Python logic map or Python logic flow chart? An example can be seen on the right under History: http://en.wikipedia.org/wiki/Usenet#History This would be very helpful for all users. Huh??? What aspect of Python were you thinking of

Re: Import question

2010-02-08 Thread Andrew Degtiariov
Those are called namespace packages. Zope and Plone (ab)use them extensively. The intended usage is to break up a big, monolithic package [0] in parts that can be distributed independently. To implement a namespace package, you need an empty __init__.py file with only these lines [1]: from

Re: use strings to call functions

2010-02-08 Thread OdarR
On 8 fév, 22:28, a...@pythoncraft.com (Aahz) wrote: In article 0efe23a6-b16d-4f92-8bc0-12d056bf5...@z26g2000yqm.googlegroups.com, OdarR  olivier.da...@gmail.com wrote: and with eval(), did you try ? WARNING: eval() is almost always the wrong answer to any question warning : it works !

Read PGM's with more than 256 range in PIL1.1.7

2010-02-08 Thread Davo
I have a PGM format image file with 4096 range. When I reads it with PIL, I get an image with 8-bit values and alternate columns are zero. Does PIL support reading and writing PGM's with more than 8-bits? Davo -- http://mail.python.org/mailman/listinfo/python-list

Re: Stephen -- Bruce?

2010-02-08 Thread Mensanator
On Feb 8, 3:02 am, Stefan Behnel stefan...@behnel.de wrote: Mensanator, 05.02.2010 00:36: On Feb 4, 5:13 pm, Alf P. Steinbach wrote: What's this about all the Stephen'ses here? Shouldn't it be Bruce? Of course. We just call everyone Stephen to avoid confusion. Some people even manage

Re: equivalent of Ruby's Pathname?

2010-02-08 Thread Aahz
In article dcace5fc-5ae9-4756-942d-6da7da2f6...@s36g2000prh.googlegroups.com, Sean DiZazzo half.ital...@gmail.com wrote: On Feb 3, 6:08=A0pm, alex23 wuwe...@gmail.com wrote: There was also a PEP with another possible implementation: http://www.python.org/dev/peps/pep-0355/ Why did Path() get

Re: use strings to call functions

2010-02-08 Thread Aahz
In article 5790c33c-13d0-4596-91b0-b3c9aeebf...@f8g2000yqn.googlegroups.com, OdarR olivier.da...@gmail.com wrote: On 8 f=E9v, 22:28, a...@pythoncraft.com (Aahz) wrote: In article 0efe23a6-b16d-4f92-8bc0-12d056bf5...@z26g2000yqm.googlegroups= .com, OdarR =A0olivier.da...@gmail.com wrote: and

Re: Your beloved python features

2010-02-08 Thread MRAB
geremy condra wrote: On Mon, Feb 8, 2010 at 12:07 PM, mk mrk...@gmail.com wrote: Steven D'Aprano wrote: On Fri, 05 Feb 2010 18:29:07 +0100, mk wrote: Ethan Furman wrote: http://www1.american.edu/academic.depts/cas/econ/faculty/isaac/ choose_python.pdf Choose to get your difficult

Re: equivalent of Ruby's Pathname?

2010-02-08 Thread Phlip
On Feb 8, 2:36 pm, a...@pythoncraft.com (Aahz) wrote: There was also a PEP with another possible implementation: http://www.python.org/dev/peps/pep-0355/ Why did Path() get rejected?  Is it the idea itself, or just the approach that was used?  What are the complaints? You should search

Re: Your beloved python features

2010-02-08 Thread Aahz
In article 28c6967f-7637-4823-aee9-15487e1ce...@o28g2000yqh.googlegroups.com, Julian maili...@julianmoritz.de wrote: I want to design a poster for an open source conference, the local usergroup will have a table there, and in the past years there were some people that came to the python-table

Re: Building a multiline string

2010-02-08 Thread Aahz
In article cd36d2f3-fdd0-4dd0-ad60-d4d7500e3...@l26g2000yqd.googlegroups.com, lallous lall...@lgwm.org wrote: x = ( line1 # can use comments line2 line3 ) You should indent the second and following lines (I changed the name to xyz to make clear that the following lines use a regular Python

ANN: obfuscate

2010-02-08 Thread Steven D'Aprano
I am pleased to announce the first public release of obfuscate 0.2.2a. http://pypi.python.org/pypi/obfuscate/0.2.2a obfuscate is a pure-Python module providing classical encryption algorithms suitable for obfuscating and unobfuscating text. obfuscate includes the following ciphers: - Caesar,

Re: ANN: obfuscate

2010-02-08 Thread Christian Heimes
Steven D'Aprano schrieb: I am pleased to announce the first public release of obfuscate 0.2.2a. http://pypi.python.org/pypi/obfuscate/0.2.2a obfuscate is a pure-Python module providing classical encryption algorithms suitable for obfuscating and unobfuscating text. obfuscate includes

Re: equivalent of Ruby's Pathname?

2010-02-08 Thread Carl Banks
On Feb 4, 7:10 pm, Sean DiZazzo half.ital...@gmail.com wrote: On Feb 3, 6:08 pm, alex23 wuwe...@gmail.com wrote: On Feb 4, 8:47 am, Phlip phlip2...@gmail.com wrote: Yes, calling os.path.walk() and os.path.join() all the time on raw strings is fun, but I seem to recall from my Ruby

Re: ANN: obfuscate

2010-02-08 Thread geremy condra
On Mon, Feb 8, 2010 at 6:46 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: I am pleased to announce the first public release of obfuscate 0.2.2a. http://pypi.python.org/pypi/obfuscate/0.2.2a obfuscate is a pure-Python module providing classical encryption algorithms suitable

Re: Modifying Class Object

2010-02-08 Thread Alf P. Steinbach
* alex23: Alf P. Steinbach al...@start.no wrote: Hm. While most everything I've seen at effbot.org has been clear and to the point, that particular article reads like a ton of obfuscation. Must. Resist. Ad hominem. Python passes pointers by value, just as e.g. Java does. There, it needed

Re: Read PGM's with more than 256 range in PIL1.1.7

2010-02-08 Thread Chris Colbert
According the pil manual it handles PGM files with '1', 'L', or 'RGB' data which leads me to believe 16bit data is not supported. You CAN write your own decoder for that though: http://www.pythonware.com/library/pil/handbook/decoder.htm It would be trivial to write a decoder for the pgm format.

  1   2   3   >