Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Antoon Pardon
On 2008-06-03, sturlamolden <[EMAIL PROTECTED]> wrote: > On Jun 2, 12:40 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> I think you completed missed the point. >> >> This is just a proof of concept thing. In a real example there would >> of course no Set en Get methods but just methods that in t

Best way to modify code without breaking stuff.

2008-06-04 Thread Jesse Aldridge
I've got a module that I use regularly. I want to make some extensive changes to this module but I want all of the programs that depend on the module to keep working while I'm making my changes. What's the best way to accomplish this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to modify code without breaking stuff.

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 00:25:19 -0700, Jesse Aldridge wrote: > I've got a module that I use regularly. I want to make some extensive > changes to this module but I want all of the programs that depend on the > module to keep working while I'm making my changes. What's the best way > to accomplish t

Re: Best way to modify code without breaking stuff.

2008-06-04 Thread Ulrich Eckhardt
Jesse Aldridge wrote: > I've got a module that I use regularly. I want to make some extensive > changes to this module but I want all of the programs that depend on > the module to keep working while I'm making my changes. What's the > best way to accomplish this? You simply run the module's uni

Re: Different execution time in python code between embedded or standalone

2008-06-04 Thread Pau Freixes
Hi Gabriel, The source code for embedded mode it's the same, look this code : _nrdigest = 0 _const_b = 20 _f = None _signal = False def handler_alrm(signum, frame): global _signal global _nrdigest global _f _signal = True def try_me(): global _nrdigest global _f g

Re: Database Query Contains Old Data

2008-06-04 Thread M.-A. Lemburg
On 2008-06-03 14:29, James A. Donald wrote: On Tue, 03 Jun 2008 12:07:07 +0200, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: As others have mentioned, in systems that have long running logical transactions, it's usually best to collect the data until the very end and then apply all changes in one

Re: a python phpmyadmin like program

2008-06-04 Thread M.-A. Lemburg
On 2008-06-03 20:49, Gandalf wrote: is their any graphic program for handling sqlite like phpmyadmin or access in python? If you run Firefox: https://addons.mozilla.org/en-US/firefox/addon/5817 -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jun

Re: Help need with subprocess communicate

2008-06-04 Thread Chris
On Jun 4, 9:56 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 3 Jun 2008 23:48:38 -0700 (PDT), [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > > Is there way to configure the stdout buffer size so that it flushes > > earlier.. > > Is there a way to make above mentio

Re: Keep a script running in the background

2008-06-04 Thread M.-A. Lemburg
On 2008-06-04 01:33, Guillermo wrote: These are the basic requirements: Script A must keep a dictionary in memory constantly and script B must be able to access and update this dictionary at any time. Script B will start and end several times, but script A would ideally keep running until it's e

Re: defaultdict.fromkeys returns a surprising defaultdict

2008-06-04 Thread Thomas Bellman
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > That looks reasonable. It appears there is currently no way to do what you > want (apart from using a for loop to set each key) You can do this: >>> d = defaultdict.fromkeys(['x', 'y'], 0) >>> d.default_factory = list >>> d default

Re: Image Processing (batch)

2008-06-04 Thread Thomas Guettler
Weinhandl Herbert schrieb: Thomas Guettler schrieb: Hi, I tried PIL for image batch processing. But somehow I don't like it - Font-Selection: You need to give the name of the font file. - Drawing on an image needs a different object that pasting and saving. - The handbook is from Dec. 2006.

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jun 2008 15:55:38 +1000, Ben Finney wrote: > Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > >> On Wed, 04 Jun 2008 13:50:42 +1000, Ben Finney wrote: >> >> > It seems you [alex23] have a different idea of what unit testing >> > is for from me. >> >> For me it's about finding b

Re: Help need with subprocess communicate

2008-06-04 Thread Nicola Musatti
On Jun 3, 11:04 pm, [EMAIL PROTECTED] wrote: > I'm trying to perform following type of operation from inside a python > script. > 1. Open an application shell (basically a tcl ) > 2. Run some commands on that shell and get outputs from each command > 3. Close the shell [...] > Following is my code:

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Antoon Pardon
On 2008-06-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >>> it makes sense to me to also test if they work as documented. >> >> If they affect the behaviour of some public component, that's where >> the documentation should be. > > As I said they are public themselves for someone. Isn

Re: need help with timezone conversion (unexpected side effect of time.mktime ??)

2008-06-04 Thread Paul Boddie
On 3 Jun, 19:44, Ivan Velev <[EMAIL PROTECTED]> wrote: > > I've tried this with Python 2.3 and 2.4 on Red Hat Enterprise Linux 4 > > and can't reproduce the problem, even with other TZ values such as > > Thanks for the quick reply. > > Can you please let me know what value do you receive during you

Re: Best way to modify code without breaking stuff.

2008-06-04 Thread André Malo
Jesse Aldridge wrote: > I've got a module that I use regularly. I want to make some extensive > changes to this module but I want all of the programs that depend on > the module to keep working while I'm making my changes. What's the > best way to accomplish this? Don't ;-) If the changes are

Zipfile module errors

2008-06-04 Thread jwesonga
Hi, I have a python script that supposed to go through a folder, pick the zipped files, unzip them and process the data inside. I'm not sure where i'm going wrong with this script because it all seems correct: #! /usr/bin/env python import zipfile import os from elementtree import ElementTree as

Re: Best way to modify code without breaking stuff.

2008-06-04 Thread Ulrich Eckhardt
André Malo wrote: > As mentioned in another posting revision control is a good thing as well. > Not just for that task. From my point of view revision control is not a question but a fact. Seriously, if you are not using any RCS already, it is about time you start doing so. I even use it for my pr

Problem with PEXPECT in Python

2008-06-04 Thread Mallikarjun Melagiri
Hi Noah, I am new to python. I'm trying to use pexpect. Following is my problem definition: I should have a script on my machine A, which should 'ssh' to machine B and from there it shud copy a file to machine C thru 'scp'. Please help me. Regards M

Re: Best way to modify code without breaking stuff.

2008-06-04 Thread Carl Banks
On Jun 4, 3:25 am, Jesse Aldridge <[EMAIL PROTECTED]> wrote: > I've got a module that I use regularly. I want to make some extensive > changes to this module but I want all of the programs that depend on > the module to keep working while I'm making my changes. What's the > best way to accomplish

Re: Best way to modify code without breaking stuff.

2008-06-04 Thread Carl Banks
On Jun 4, 3:44 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On Wed, 04 Jun 2008 00:25:19 -0700, Jesse Aldridge wrote: > > I've got a module that I use regularly. I want to make some extensive > > changes to this module but I want all of the programs that depend on the > > module to keep workin

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread NickC
On May 26, 7:32 am, "Joe P. Cool" <[EMAIL PROTECTED]> wrote: > I saw this "don't need it" pattern in discussions about the ternary > "if..else" expression and about "except/finally on the same block > level". > Now Python has both. if/else was added solely because people kept coming up with ways o

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread NickC
On May 26, 2:49 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > I am also bothered a bit by the seeming inconsistency of the rules for > the single underscore. When used at file scope, they make the variable > or function invisible outside the module, but when used at class > scope, the "underscored" va

Re: Best way to modify code without breaking stuff.

2008-06-04 Thread Paul Rubin
Jesse Aldridge <[EMAIL PROTECTED]> writes: > I've got a module that I use regularly. I want to make some extensive > changes to this module but I want all of the programs that depend on > the module to keep working while I'm making my changes. What's the > best way to accomplish this? Do you mea

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Paul Rubin
NickC <[EMAIL PROTECTED]> writes: > if/else was added solely because people kept coming up with ways of > embedding a pseudo conditional inside expressions and writing buggy > code in the process. All it really saves you in practice is a bit of > vertical whitespace, so, no, you still don't need it

Re: defaultdict.fromkeys returns a surprising defaultdict

2008-06-04 Thread Raymond Hettinger
On Jun 3, 1:11 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I used defaultdict.fromkeys to make a new defaultdict instance, but I > was surprised by behavior: > >     >>> b = defaultdict.fromkeys(['x', 'y'], list) > >     >>> b >     defaultdict(None, {'y': , 'x': }) > >     >>> b['x'] >     >

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread NickC
On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: > What is it about leading underscores that bothers me? To me, they are > like a small pebble in your shoe while you are on a hike. Yes, you can > live with it, and it does no harm, but you still want to get rid of it. With leading underscore

Re: defaultdict.fromkeys returns a surprising defaultdict

2008-06-04 Thread Raymond Hettinger
On Jun 3, 1:11 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I used defaultdict.fromkeys to make a new defaultdict instance, but I > was surprised by behavior: >     >>> b = defaultdict.fromkeys(['x', 'y'], list) >     >>> b >     defaultdict(None, {'y': , 'x': }) One other thought: Even after

new to python, looking for streams clues

2008-06-04 Thread Thierry
Hello peoples, As I said, I'm new to python, and particularly to XML generation in python. Using the 4suite XML package, I have been able to produce XML, but only directly to STDOUT. Refering to the 4suite markupWriter refrence, the class needs a stream to output the generated XML, and if none is

Re: How to make py2.5 distutil to use VC2005?

2008-06-04 Thread Christian Heimes
甜瓜 schrieb: > Howdy, > This problem have puzzled me for a long time. I usually use > python2.5 in Windows, while VC2005 is installed. > However python25.lib is compiled by VC2003. When I use disutil to > build some C extensions, it complaints that > there is no VC2003. > Well, IMO, the form

Re: Zipfile module errors

2008-06-04 Thread John Machin
On Jun 4, 8:06 pm, jwesonga <[EMAIL PROTECTED]> wrote: > Hi, > > I have a python script that supposed to go through a folder, pick the > zipped files, unzip them and process the data inside. I'm not sure > where i'm going wrong with this script because it all seems correct: Nothing is ever as it s

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread NickC
On May 25, 8:01 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > > Python was not really written with 'difficult' customers in mind ;-) > > True. It's extremely suited to what we do though.Minor difficulties > like this are vastly outweighed by advantages. The difficulties are > real though. It's interes

Re: new to python, looking for streams clues

2008-06-04 Thread Diez B. Roggisch
Thierry wrote: > Hello peoples, > > As I said, I'm new to python, and particularly to XML generation in > python. > Using the 4suite XML package, I have been able to produce XML, but > only directly to STDOUT. > > Refering to the 4suite markupWriter refrence, the class needs a stream > to output

Re: new to python, looking for streams clues

2008-06-04 Thread Bruno Desthuilliers
Thierry a écrit : Hello peoples, As I said, I'm new to python, and particularly to XML generation in python. Using the 4suite XML package, I have been able to produce XML, but only directly to STDOUT. Refering to the 4suite markupWriter refrence, the class needs a stream to output the generated

Re: "Faster" I/O in a script

2008-06-04 Thread Kris Kennaway
Gary Herron wrote: [EMAIL PROTECTED] wrote: On Jun 2, 2:08 am, "kalakouentin" <[EMAIL PROTECTED]> wrote: Do you know a way to actually load my data in a more "batch-like" way so I will avoid the constant line by line reading? If your files will fit in memory, you can just do text =

Re: defaultdict.fromkeys returns a surprising defaultdict

2008-06-04 Thread cokofreedom
> > No need. The patch would be rejected. It would break existing code > that uses default.fromkeys() as designed and documented. > Perhaps that could be useful, so that future questions or posts on the matter could instantly be directed to the rejected patch? -- http://mail.python.org/mailman/l

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread NickC
On Jun 4, 4:41 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Guido has been known to change his mind, which is an admirabele quality, > but it does show that at some point he rejected a good idea or accepted > a bad idea. And sometimes the person that talked him into accepting the bad idea in the

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Ben Finney
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > On Wed, 04 Jun 2008 15:55:38 +1000, Ben Finney wrote: > > > By definition, "private" functions are not part of the publicly > > documented behaviour of the unit. Any behaviour exhibited by some > > private component is seen externally as a be

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread NickC
On Jun 4, 9:24 pm, Paul Rubin wrote: > NickC <[EMAIL PROTECTED]> writes: > > if/else was added solely because people kept coming up with ways of > > embedding a pseudo conditional inside expressions and writing buggy > > code in the process. All it really saves you in pra

Earn = 10,000 US Dollars per month without Investment.

2008-06-04 Thread mcashcash
You Have Finally Found It Earn!! = 10,000 US Dollars per month without Investment Genuine Lifetime Income!! http://seniorfriendfinder.com/go/g970599-pmem http://seniorfriendfinder.com/go/g970599-pct http://seniorfriendfinder.com/go/g970599-brk http://alt.com/go/g900909-ppc http://govindswamy-govin

Earn = 10,000 US Dollars per month without Investment.

2008-06-04 Thread mcashcash
You Have Finally Found It Earn!! = 10,000 US Dollars per month without Investment Genuine Lifetime Income!! http://seniorfriendfinder.com/go/g970599-pmem http://seniorfriendfinder.com/go/g970599-pct http://seniorfriendfinder.com/go/g970599-brk http://alt.com/go/g900909-ppc http://govindswamy-govin

Earn = 10,000 US Dollars per month without Investment.

2008-06-04 Thread mcashcash
You Have Finally Found It Earn!! = 10,000 US Dollars per month without Investment Genuine Lifetime Income!! http://seniorfriendfinder.com/go/g970599-pmem http://seniorfriendfinder.com/go/g970599-pct http://seniorfriendfinder.com/go/g970599-brk http://alt.com/go/g900909-ppc http://govindswamy-govin

Earn = 10,000 US Dollars per month without Investment.

2008-06-04 Thread mcashcash
You Have Finally Found It Earn!! = 10,000 US Dollars per month without Investment Genuine Lifetime Income!! http://seniorfriendfinder.com/go/g970599-pmem http://seniorfriendfinder.com/go/g970599-pct http://seniorfriendfinder.com/go/g970599-brk http://alt.com/go/g900909-ppc http://govindswamy-govin

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread NickC
On Jun 4, 9:56 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Those unit tests should *not*, though, exercise anything but the > public API, otherwise they're breaking encapsulation. Their assertion > should continue to be just as true after a refactoring of the internal > components as before. Pytho

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Antoon Pardon
On 2008-06-04, NickC <[EMAIL PROTECTED]> wrote: > On May 26, 7:32 am, "Joe P. Cool" <[EMAIL PROTECTED]> wrote: >> I saw this "don't need it" pattern in discussions about the ternary >> "if..else" expression and about "except/finally on the same block >> level". >> Now Python has both. > > if/else w

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Antoon Pardon
On 2008-06-04, NickC <[EMAIL PROTECTED]> wrote: > On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: >> What is it about leading underscores that bothers me? To me, they are >> like a small pebble in your shoe while you are on a hike. Yes, you can >> live with it, and it does no harm, but you

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread cokofreedom
> > But the leading underscore doesn't tell you whether it is your own > private date, which you can use a you see fit, or those of someone > else, which you have to be very carefull with. > > -- > Antoon Pardon Well how is that different from public accessor and mutators of private variables? --

Re: Help need with subprocess communicate

2008-06-04 Thread Ali
On Jun 3, 10:04 pm, [EMAIL PROTECTED] wrote: > I'm trying to perform following type of operation from inside a python > script. > 1. Open an application shell (basically a tcl ) > 2. Run some commands on that shell and get outputs from each command > 3. Close the shell > > I could do it using commu

Re: Best way to modify code without breaking stuff.

2008-06-04 Thread Henrique Dante de Almeida
On Jun 4, 4:44 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On Wed, 04 Jun 2008 00:25:19 -0700, Jesse Aldridge wrote: > > I've got a module that I use regularly.  I want to make some extensive > > changes to this module but I want all of the programs that depend on the > > module to keep workin

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Antoon Pardon
On 2008-06-04, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> But the leading underscore doesn't tell you whether it is your own >> private date, which you can use a you see fit, or those of someone >> else, which you have to be very carefull with. >> >> -- >> Antoon Pardon > > Well how is that

Re: Handling some isolated iso-8859-1 characters

2008-06-04 Thread Daniel Mahoney
> No, it's not you, those headers are formatted following RFC 2047 > > Python already has support for that format, use the email.header class, > see Excellent, that's exactly what I was looking for.

Re: Handling some isolated iso-8859-1 characters

2008-06-04 Thread Daniel Mahoney
> ... print ord(c), unicodedata.name(c) > ... > 65 LATIN CAPITAL LETTER A > 110 LATIN SMALL LETTER N > 97 LATIN SMALL LETTER A > 239 LATIN SMALL LETTER I WITH DIAERESIS > 115 LATIN SMALL LETTER S Looks like I need to explore the unicodedata class. Thanks! -- http://mail.python.org/mailman/listin

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: > By definition, "private" functions are not part of the publicly > documented behaviour of the unit. Any behaviour exhibited by some > private component is seen externally as a behaviour of some public > component. You know t

Training Class in July

2008-06-04 Thread Steve Holden
Holden Web is holding the second of its public "Introduction to Python" classes on July 8-10 in Springfield, VA (just outside Washington, DC). The class is described briefly at http://holdenweb.com/py/introclass/ and the current schedule is at http://holdenweb.com/py/training/ Bookings a

Trying to extend Python with C: undefined reference to `Py_BuildValue'

2008-06-04 Thread spectrumdt
Hello. I am trying to extend Python with some C code. I made a trivial "Hello World" program in C that I am trying to wrap in "boilerplate" for inclusion in a Python program. But I can't compile the C code. The C compiler cannot find the required function `Py_BuildValue'. My C code looks li

Re: Handling some isolated iso-8859-1 characters

2008-06-04 Thread Max M
Daniel Mahoney skrev: The interesting patch is the string that reads "=?iso-8859-1?Q?Ana=EFs?=". An HTML rendering of what this string should look would be "Anaïs". There is a mention of email headers and unicode in the end of this article: http://mxm-mad-science.blogspot.com/2008/03/python-

Re: new to python, looking for streams clues

2008-06-04 Thread Thierry
On Jun 4, 1:50 pm, Bruno Desthuilliers wrote: > Thierry a écrit : > > > > > Hello peoples, > > > As I said, I'm new to python, and particularly to XML generation in > > python. > > Using the 4suite XML package, I have been able to produce XML, but > > only directly to STDOUT. > > > Refering to the

Re: printf in python

2008-06-04 Thread gianluca
On 4 Giu, 03:46, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 03 Jun 2008 10:28:57 -0300, gianluca <[EMAIL PROTECTED]> > escribió: > > > > >> > > On Mon, 2 Jun 2008 00:32:33 -0700 (PDT), gianluca > >> <[EMAIL PROTECTED]> > >> > > declaimed the following in comp.lang.python: > > >> > > >

Re: Trying to extend Python with C: undefined reference to `Py_BuildValue'

2008-06-04 Thread Christian Heimes
[EMAIL PROTECTED] schrieb: > Can anyone help? I am including Python.h, so why does it not find > Py_BuildValue? Read your error message again. It says the dynamic linker (ld) can't find the name. You have to link against the Python library. Christian -- http://mail.python.org/mailman/listinfo

Re: How to make py2.5 distutil to use VC2005?

2008-06-04 Thread David Cournapeau
On Wed, Jun 4, 2008 at 11:38 AM, 甜瓜 <[EMAIL PROTECTED]> wrote: >Well, IMO, the format of binary files generated by VC2003 and > VC2005 is compatible in most cases. Problem arise with the C runtime, not with object file format. In particular, python uses the C api for file handling, and the st

Re: SocketServer, its offspring, and threads

2008-06-04 Thread darel . finkbeiner
On May 25, 10:40 am, eliben <[EMAIL PROTECTED]> wrote: > Hello, > > I have a small wxPython application. Today I was trying to add some > RPC capability to it, so I implemented an instance of > SimpleXMLRPCServer that runs in a separate thread when invoked and > answers requests. > > All went fine

Take 5-10 min survey on animals, technology, and nature for a $20 Barnes&Noble gift certificate

2008-06-04 Thread aw
Hello, I am a psychology student at University of Chicago conducting a survey on animals, technology, and nature. It takes only 5-10 minutes to complete and every 20th participant will be emailed a $20 gift certificate to Barnes & Noble. This should be an interesting opportunity to learn things

Distributing 2 python modules with incompatible API

2008-06-04 Thread mathieu
hi there, As far as I understand python is not using the usual UNIX system of soname when two libraries provide incompatible API. So let say I have a _foo.so version 1.2 and 2.0, all I can (should do) is move them underneath a subdirectory in site-package: pythonX.Y/site-package/foo1.2/_foo.s

how to combine 2 program?

2008-06-04 Thread agus
i am a newbe in pyhton. i am using "Twisted Network Programming Essentials By Abe Fettig" as my tutorial. in that tutorial, i found 2 example, IMAPDOWNLOAD.py and requesthandler.py my problem is how to combine those program become one program, so that i can input the imapdownload inputs via web?

Re: How to perform a nonblocking read from a process

2008-06-04 Thread sturlamolden
On Jun 4, 8:45 am, [EMAIL PROTECTED] wrote: > I've to admit I'm a newbie to this kind of programming... > what if I have to run thousands of these commands...it doesn't make > sense to create > thousands of threads.. > Is there a way that above mentioned piece of code be made to worked... Are yo

Re: printf in python

2008-06-04 Thread Ivan Illarionov
On Mon, 02 Jun 2008 00:32:33 -0700, gianluca wrote: > Hy, I've a problem with may python library generated with swig from C > code. I works and I can access all function but a simèple function that > print a string don't work's. > The function is like this: > int PrintTEST() > { > printf("TE

Re: Trying to extend Python with C: undefined reference to `Py_BuildValue'

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 05:57:20 -0700, spectrumdt wrote: > Hello. > > I am trying to extend Python with some C code. I made a trivial > "Hello World" program in C that I am trying to wrap in "boilerplate" for > inclusion in a Python program. But I can't compile the C code. The C > compiler cannot

Re: printf in python

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 14:10:51 +, Ivan Illarionov wrote: > On Mon, 02 Jun 2008 00:32:33 -0700, gianluca wrote: > >> Hy, I've a problem with may python library generated with swig from C >> code. I works and I can access all function but a simèple function >> that print a string don't work's. >

How to make one program connect to more than one TCP?

2008-06-04 Thread agus
The questions: I am using twisted to make program that can download IMAP email. after that, downloaded email is parsed, then posted to nntp server. my problem is how to make one progam connect to more than one tcp? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to make one program connect to more than one TCP?

2008-06-04 Thread Laszlo Nagy
[EMAIL PROTECTED] wrote: The questions: I am using twisted to make program that can download IMAP email. after that, downloaded email is parsed, then posted to nntp server. my problem is how to make one progam connect to more than one tcp? Create more sockets, connect to the server multiple t

Re: ctypes, function pointers and a lot of trouble

2008-06-04 Thread Nick Craig-Wood
Matt <[EMAIL PROTECTED]> wrote: > Hm, thanks, now I can access my data in the functions and also write > them but the program keeps terminating right at the point when the > "open" function finishes. Unfortunately everything closes and I get no > error messages. > > I did some additional w

Re: How to perform a nonblocking read from a process

2008-06-04 Thread Nick Craig-Wood
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to perform following operation from inside the python > script > 1. Open a shell ( start a process ) > 2. Send command1 to the process > 3. Get output from the process > 4. Send command2 to the process > 5. Get output from the

Exit from os.chroot()

2008-06-04 Thread support.intranet
Hello! I'm writing a small script and I need to call the os.chroot function. The problem is, a few lines below I need to call a program in /usr/bin. Is there a way to exit from the chroot, or to limit the chroot to a single function or thread? Thanks in advance -- http://mail.python.org/mailman

Re: can python do some kernel stuff?

2008-06-04 Thread Grant Edwards
>> The answer is yes. IPC and py-pf are examples. If you don't >> think of packet filtering as kernel coding, I can understand. >> But clearly the Python interfaces to fork(), waitpid(), >> signal(), alarm() and so forth are forays into the once >> private garden of C. The routines listed above

Re: Distributing 2 python modules with incompatible API

2008-06-04 Thread Diez B. Roggisch
mathieu wrote: > hi there, > > As far as I understand python is not using the usual UNIX system of > soname when two libraries provide incompatible API. So let say I have > a _foo.so version 1.2 and 2.0, all I can (should do) is move them > underneath a subdirectory in site-package: > > pyth

Re: Exit from os.chroot()

2008-06-04 Thread Wolfgang Draxinger
support.intranet wrote: > Hello! I'm writing a small script and I need to call the > os.chroot function. The problem is, a few lines below I need to > call a program in /usr/bin. Is there a way to exit from the > chroot, or to limit the chroot to a single function or thread? > Thanks in advance N

ANN: Sydebar 1.0 - A browser sidebar generator for Python documentation

2008-06-04 Thread Remy Blank
Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable I am pleased to announce the first release of Sydebar, a browser sidebar = generator for Python documentation. For the impatient, sample outputs=20 for all Python versions ever released can be

Re: Zipfile module errors

2008-06-04 Thread John Machin
jwesonga wrote: I've added the line to the script, added a zipped file into the folder. I've made sure the file exists. The error is now this: Please get some clues: (1) Don't reply off-list unless specifically invited. (2) Don't top-post. (3) Do read and try to understand *all* of each reply t

Embedding python a la erb

2008-06-04 Thread PAolo
hello, is there any other tool for embedding python as erb (for ruby) or empy do. In particular I am not too happy about the way loops are made @[for i in range(10)]@ xxx @(i) @[end for] which is different form the way other code is delimited @{print 1+1} I think in PHP there is not this diffe

Re: Trying to extend Python with C: undefined reference to `Py_BuildValue'

2008-06-04 Thread spectrumdt
On Jun 4, 4:13 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > Hi! Your C code contains too many errors. I'm lazy to comment them all. > > 2. create 'buildme.py' file with this content: > Thanks for the replies. Maybe I should have read the rest of the guide to extending Python with C before whi

Re: Import, site packages, my modules, Windows vs. Linux

2008-06-04 Thread John Ladasky
On Jun 3, 6:52 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > John Ladasky <[EMAIL PROTECTED]> writes: > > I want to know what is the *recommended* way to integrate my own > > personal modules with Python. Thanks! > > You want the 'distutils' documentation > http://www.python.org/doc/lib/module-distu

Re: can python do some kernel stuff?

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 09:41:07 -0500, Grant Edwards wrote: >>> The answer is yes. IPC and py-pf are examples. If you don't think of >>> packet filtering as kernel coding, I can understand. But clearly the >>> Python interfaces to fork(), waitpid(), signal(), alarm() and so forth >>> are forays int

Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread spectrumdt
Hello. I am trying to extend my Python program with some C code. This thread is sort of a follow-up to another thread of mine, linked below. I don't know what the conventions are in this newsgroup about creating new threads vs. staying in existing ones, but I figured I'd rather make a new o

Re: re

2008-06-04 Thread David C. Ullrich
Actually using regular expressions for the first time. Is there something that allows you to take the union of two character sets, or append a character to a character set? Say I want to replace 'disc' with 'disk', but only when 'disc' is a complete word (don't want to change 'discuss' to 'diskuss

Re: can python do some kernel stuff?

2008-06-04 Thread Grant Edwards
On 2008-06-04, Ivan Illarionov <[EMAIL PROTECTED]> wrote: >> Didn't somebody once demonstrate how to put a VM into kernel >> space so that you could write kernel code in Python? Maybe it >> was just a discussion about how it could be done in theory. >> >> There have been a few JVM-in-hardware pr

Re: Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread Gerhard Häring
[EMAIL PROTECTED] wrote: Hello. I am trying to extend my Python program with some C code. [...] Anyway, my question is this: When compiling my C code to include in Python, using a Python script with the function distutils.core.setup... can I choose which C compiler to use? On my system it

[XP] Batch-print bunch of RTF files?

2008-06-04 Thread [EMAIL PROTECTED]
Hello, I have about two hundred individual RTF files to print from an XP host. Word 2000 doesn't seem to have this feature, so I'm looking for a way to print those RTF files from an ActivePython script. Would someone have some working code handy? Thank you. -- http://mail.python.org/mailm

Re: Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread spectrumdt
On Jun 4, 6:25 pm, Gerhard Häring <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >   Hello. > > >   I am trying to extend my Python program with some C code. [...] > >   Anyway, my question is this: When compiling my C code to include in > > Python, using a Python script with the function

Re: Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 09:12:18 -0700, spectrumdt wrote: > Hello. > > I am trying to extend my Python program with some C code. > > This thread is sort of a follow-up to another thread of mine, linked > below. I don't know what the conventions are in this newsgroup about > creating new threads

Re: Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 09:12:18 -0700, spectrumdt wrote: > Hello. > > I am trying to extend my Python program with some C code. > > This thread is sort of a follow-up to another thread of mine, linked > below. I don't know what the conventions are in this newsgroup about > creating new threads

Re: Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 09:12:18 -0700, spectrumdt wrote: > Hello. > > I am trying to extend my Python program with some C code. > > This thread is sort of a follow-up to another thread of mine, linked > below. I don't know what the conventions are in this newsgroup about > creating new threads

Re: [XP] Batch-print bunch of RTF files?

2008-06-04 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hello, I have about two hundred individual RTF files to print from an XP host. Word 2000 doesn't seem to have this feature, so I'm looking for a way to print those RTF files from an ActivePython script. Would someone have some working code handy? Thank you. Su

Re: Exit from os.chroot()

2008-06-04 Thread support . intranet
On 4 Giu, 17:08, Wolfgang Draxinger <[EMAIL PROTECTED]> wrote: > support.intranet wrote: > > Hello! I'm writing a small script and I need to call the > > os.chroot function. The problem is, a few lines below I need to > > call a program in /usr/bin. Is there a way to exit from the > > chroot, or to

Re: re

2008-06-04 Thread Diez B. Roggisch
David C. Ullrich schrieb: Actually using regular expressions for the first time. Is there something that allows you to take the union of two character sets, or append a character to a character set? Say I want to replace 'disc' with 'disk', but only when 'disc' is a complete word (don't want to

Re: can python do some kernel stuff?

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 11:24:11 -0500, Grant Edwards wrote: >> I can't understand why somebody might want to do kernel stuff in >> Python. > > we choose to put Python in kernel-space and do the other things, not > because they are easy, but because they are hard, because that goal > will

Re: Batch-print bunch of RTF files?

2008-06-04 Thread [EMAIL PROTECTED]
On Jun 4, 12:26 pm, "[EMAIL PROTECTED]" wrote: > Hello, > > I have about two hundred individual RTF files to print from an > XP host. Word 2000 doesn't seem to have this feature, so I'm looking > for a way to print those RTF files from an ActivePython script. Would > someone have some work

Re: re

2008-06-04 Thread Russell Blau
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > David C. Ullrich schrieb: >> Say I want to replace 'disc' with 'disk', but only >> when 'disc' is a complete word (don't want to change >> 'discuss' to 'diskuss'.) The following seems almost >> right: >> >> [^a-zA-Z

Re: Books for programmers

2008-06-04 Thread Tommy Nordgren
On 3 jun 2008, at 09.22, V wrote: Hi, I'm a C++, Java and C programmer, and I'm searching for a (preferably printed) book that teaches me the "Python idioms", i.e. the "Python way" of doing something. Ideally, I'm searching for a book like "Effective C++" or "Effective Java", that does not lo

Re: re

2008-06-04 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > David C. Ullrich schrieb: > > Actually using regular expressions for the first > > time. Is there something that allows you to take the > > union of two character sets, or append a character to > > a character set? >

Re: ANN: Sydebar 1.0 - A browser sidebar generator for Python documentation

2008-06-04 Thread Remy Blank
(I apologize for the poorly formatted message. Something between my news client and the server decided, besides delaying the message for over 17 hours, to add an empty line for every line of text, which obviously messed up some headers. Here's the content again, and hopefully this message comes

  1   2   >