Re: type-checking support in Python?

2008-10-10 Thread Steven D'Aprano
On Tue, 07 Oct 2008 19:36:12 +1300, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, > Gabriel Genellina wrote: > >> As an example, in the oil industry here in my country there is a mix of >> measurement units in common usage. Depth is measured in meters, but >> pump stroke in inches;

Re: HARD REAL TIME PYTHON

2008-10-10 Thread James Mills
On 10/7/08, James Mills <[EMAIL PROTECTED]> wrote: > I shall do some latency benchmarks ok :) Out of curiosity I modifed my bench marking tool for my event/component library (pymills) and here are the results: ~/pymills/examples/event $ ./bench.py -m latency -t 10 Setting up latency Test... Late

Trouble importing module using swig and python

2008-10-10 Thread Basha J P M
I am beginner in python. I am working through the tutorial examples from http://www.swig.org/ and have run into some problems. I took the following command instructions from the tutorial on swig.org: http://www.swig.org/tutorial.html I have written example.c and example.i as described in the abo

Re: how to set the time of a directory?

2008-10-10 Thread Timothy Grant
On Fri, Oct 10, 2008 at 10:16 PM, oyster <[EMAIL PROTECTED]> wrote: > os.utime works only against files. so what to do for a directory? > thanx Not sure why you'd say that. drwxr-xr-x 2 tjg tjg 68 Oct 10 22:23 test ([EMAIL PROTECTED]) python Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:16

Re: Simple Python Project Structure

2008-10-10 Thread Ben Finney
George Sakkis <[EMAIL PROTECTED]> writes: > ''' > The __init__.py files are required to make Python treat the > directories as containing packages; this is done to prevent > directories with a common name, such as "string", from > unintentionally hiding valid modules that occur later on the module

how to set the time of a directory?

2008-10-10 Thread oyster
os.utime works only against files. so what to do for a directory? thanx -- http://mail.python.org/mailman/listinfo/python-list

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 10:54 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > snip > > Last, you > > haven't mentioned an attempt with PyCObject_AsVoidPtr yet: > > > void* PyCObject_AsVoidPtr(PyObject* self) > >     Return the object void * that the PyCObject self was created wi

Re: Using multiprocessing

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 10:48 pm, nhwarriors <[EMAIL PROTECTED]> wrote: > On Oct 10, 10:52 pm, "Aaron \"Castironpi\" Brady" > > > > <[EMAIL PROTECTED]> wrote: > > On Oct 10, 3:32 pm, nhwarriors <[EMAIL PROTECTED]> wrote: > > > > I am attempting to use the (new in 2.6) multiprocessing package to > > > process 2

Re: Simple Python Project Structure

2008-10-10 Thread George Sakkis
On Oct 10, 9:26 pm, jay graves <[EMAIL PROTECTED]> wrote: > On Oct 10, 7:17 pm, amit <[EMAIL PROTECTED]> wrote: > > > How do create my own modules and import them? Right now it works but > > they all have to be in the same directory. For example, > > > project/ > > util/ > > config/ > > ...

Re: Modification of a urllib2 object ?

2008-10-10 Thread George Sakkis
On Oct 10, 6:12 pm, [EMAIL PROTECTED] wrote: > On Oct 10, 1:02 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > On Oct 10, 2:32 pm, [EMAIL PROTECTED] wrote: > > > > I have several ways to the following problem. > > > > This is what I have: > > > > ... > > > import ClientForm > > > import Bea

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Gordon Allott
Aaron "Castironpi" Brady wrote: > > You are hard to follow. There is the 'cast' function, which I've had > some success with, even in adding pointers and offsets. It took a > look at the code for it though, and calling an undocumented version of > it. I can post that later if you don't have luc

Re: Using multiprocessing

2008-10-10 Thread nhwarriors
On Oct 10, 10:52 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Oct 10, 3:32 pm, nhwarriors <[EMAIL PROTECTED]> wrote: > > > > > I am attempting to use the (new in 2.6) multiprocessing package to > > process 2 items in a large queue of items simultaneously. I'd like to > > be able

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 10:37 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Oct 9, 5:30 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > > > > > Is there a canonical way to address the bits in a structure > > like an array or string or struct? > > > Or alternatively, is there a good way

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 9, 5:30 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Is there a canonical way to address the bits in a structure > like an array or string or struct? > > Or alternatively, is there a good way to combine eight > ints that represent bits into one of the bytes in some > array or string

Win32 system admin

2008-10-10 Thread Abah Joseph
Hi everybody... i`m not a prof in english so please read and understand me.. Thank u. Using the win32 python module can we perform every tasks like *gpedit.msc?* i will like to automate tasks like enabling or disaple some of the windows functions. with my basic experince, you can perform importan

Re: Read data from Serial Command

2008-10-10 Thread Grant Edwards
On 2008-10-10, brianrpsgt1 <[EMAIL PROTECTED]> wrote: > Gave that a shot what is happening is that the script is > hanging. Hanging where? Which line? You'd get a lot more helpful answers if you provided details about what your program is doing rather than vague statements like "it doesn't

Re: Using multiprocessing

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 3:32 pm, nhwarriors <[EMAIL PROTECTED]> wrote: > I am attempting to use the (new in 2.6) multiprocessing package to > process 2 items in a large queue of items simultaneously. I'd like to > be able to print to the screen the results of each item before > starting the next one. I'm having

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 7:59 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > Yes, well said.  But no, not true, not necessarily.  You can choose/ > > change return types with your code.  If the call is defined already > > and you can't change the return, just define a new one

Re: self signing a py2exe windows executable

2008-10-10 Thread William Heath
Hi All, I just purchased a code signing certificate from godaddy. It is a .spc. I installed it, I see it in the trusted root authority in the certificates area of ie. By the way I got the self signed approach to work, thanks! Anyway, I am not clear how to proceed as the .spc does not show up in

Re: Using multiprocessing

2008-10-10 Thread Jesse Noller
On Fri, Oct 10, 2008 at 4:32 PM, nhwarriors <[EMAIL PROTECTED]> wrote: > I am attempting to use the (new in 2.6) multiprocessing package to > process 2 items in a large queue of items simultaneously. I'd like to > be able to print to the screen the results of each item before > starting the next on

Re: Simple Python Project Structure

2008-10-10 Thread jay graves
On Oct 10, 7:17 pm, amit <[EMAIL PROTECTED]> wrote: > How do create my own modules and import them? Right now it works but > they all have to be in the same directory. For example, > > project/ > util/ > config/ > tests/ > start.py > You need an __init__.py file (it doesn't matter

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Gordon Allott
Aaron "Castironpi" Brady wrote: > Yes, well said. But no, not true, not necessarily. You can choose/ > change return types with your code. If the call is defined already > and you can't change the return, just define a new one that returns > long. > -- > http://mail.python.org/mailman/listinfo/

Re: Where/how to propose an addition to a standard module?

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 2:10 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > I would like to propose a new method for the string.Template class.   > What's the proper procedure for doing this?  I've joined the python- > ideas list, but that seems to be only for proposed language changes,   > and my idea doesn't req

Re: Porn Addiction Solutions?

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 10:33 am, Aspersieman <[EMAIL PROTECTED]> wrote: > On Fri, 10 Oct 2008 16:11:07 +0200, <[EMAIL PROTECTED]> wrote: > > On Oct 10, 7:03 am, Um Jammer NATTY <[EMAIL PROTECTED]> wrote: > >> On Oct 10, 5:37 am, [EMAIL PROTECTED] wrote: > > >> > It's very simple. You need to know the world is

Python 2.6 json & encoding of datetime.

2008-10-10 Thread David Wilson
Hi there, I've been playing with Python's new json library, and found myself facing a seemingly simple problem: encoding of datetime objects. Some 'jsonlib' that I was using previously was unable to do this, and the new built-in json module shares the same limitation. A bit of googling around bro

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 4:16 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > I see.  If I understand, you have a PyCObject in a dictionary. > > > Look at the 'ctypes' module and try calling PyCObject_AsVoidPtr.  Its > > return type should be 'c_void_p', and you can use 'result

Win32 system administrator gpedit.msc

2008-10-10 Thread Abah Joseph
Hi everybody... i`m not a prof in english so please read and understand me.. Thank u. Using the win32 python module can we perform every tasks like *gpedit.msc?* i will like to automate tasks like enabling or disaple some of the windows functions. with my basic experince, you can perform important

Simple Python Project Structure

2008-10-10 Thread amit
Hi, I recently wrote a fairly complex project in python. It works great and it was completed fairly quickly thanks to python! Anyways, I am in the process of cleaning the code/directory and I had a simple question How do create my own modules and import them? Right now it works but they all

Re: Read data from Serial Command

2008-10-10 Thread brianrpsgt1
That did it! The fix was the '\r' Thanks for the assistance Dennis and Grant! Dennis Lee Bieber wrote: > On Fri, 10 Oct 2008 15:40:08 -0700 (PDT), brianrpsgt1 > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > Again, what is weird is that all works fine in Hyperterminal, bu

Re: How to uninstall/update modules

2008-10-10 Thread Robert Kern
[EMAIL PROTECTED] wrote: Dear All, It seems I don't understand how Python packages are handled. Here's my specific problem * I'm on Win32 * I've installed Enthought Python 2.5 because it got all the numerical stuff included * Later I tried to install Twisted 8.1 Twisted ended up in C:\Python\

Re: python debugger tips?

2008-10-10 Thread aizenman
On Oct 10, 5:58 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > take a look at winpdb (which has no relation with Windows-OS !! > > cheers, > Stef Looks pretty cool; sadly, our sysadmin refuses to install wxwindows, and the commandline version is fairly cryptic... Thanks! Y -- http://mail.python.or

Re: Read data from Serial Command

2008-10-10 Thread brianrpsgt1
Again, what is weird is that all works fine in Hyperterminal, but not with the Python script. brianrpsgt1 wrote: > Gave that a shot what is happening is that the script is > hanging. Does that mean that the write function is not making it > through, thus there is nothing to return? > > > >

Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 10 Okt., 23:04, Terry Reedy <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: > > Me too because I don't get this: > > > "key specifies a function of one argument that is used to extract a > > comparison key from each list element: key=str.lower. The default > > value is None." > > I am not sure

Re: Read data from Serial Command

2008-10-10 Thread brianrpsgt1
Gave that a shot what is happening is that the script is hanging. Does that mean that the write function is not making it through, thus there is nothing to return? Grant Edwards wrote: > On 2008-10-10, brianrpsgt1 <[EMAIL PROTECTED]> wrote: > > Thanks for the message > > > > What exactly i

DNS Zonefile editor

2008-10-10 Thread preacher37
I am looking for a web based zone file editor written in python to be used to allow customers to modify their DNS records in a bind style DNS system. Any info regarding existing projects is appreciated. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Modification of a urllib2 object ?

2008-10-10 Thread vincehofmeister
On Oct 10, 1:02 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Oct 10, 2:32 pm, [EMAIL PROTECTED] wrote: > > > > > I have several ways to the following problem. > > > This is what I have: > > > ... > > import ClientForm > > import BeautifulSoup from BeautifulSoup > > > request = urllib2.Request(

PIL on windows XP x64 (64-bit)?

2008-10-10 Thread Berco Beute
Has anybody here got PIL (the Image lib) working on Windows XP x64 (64- bit)? There is no version available for that platform from pythonware.com. Thanks, 2B -- http://mail.python.org/mailman/listinfo/python-list

Re: Read data from Serial Command

2008-10-10 Thread Grant Edwards
On 2008-10-10, brianrpsgt1 <[EMAIL PROTECTED]> wrote: > Thanks for the message > > What exactly is happening is that the return is "None" for the command > that I am sending. If I connect through Hyperterminal and execute the > 'sh nw enc' command, it returns 'WEP' It looks to me like you're neve

How to uninstall/update modules

2008-10-10 Thread pjacobi . de
Dear All, It seems I don't understand how Python packages are handled. Here's my specific problem * I'm on Win32 * I've installed Enthought Python 2.5 because it got all the numerical stuff included * Later I tried to install Twisted 8.1 Twisted ended up in C:\Python\Lib\site-packages\twisted

Re: python debugger tips?

2008-10-10 Thread Stef Mientki
take a look at winpdb (which has no relation with Windows-OS !! cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: List Order of Initialization

2008-10-10 Thread Ben Finney
SamFeltus <[EMAIL PROTECTED]> writes: > When a list initializes, will it always evaluate in order starting at > element 0 and finishing with the last element? > > def f1(x): > return x + 2 > > def f2(x): > return x * 2 > > def f3(x): > return x * 3 > > the_list = [f1(7), f2(8), f3(

python debugger tips?

2008-10-10 Thread just . another . random . user
Hi All, I'm switching to python from perl, and like the language a ton, but I find pdb and pydb to be vastly inferior debuggers to the perl version. In particular, I've grown very used to stepping into arbitrary functions interactively. For instance, in perl you can do this: casqa1:~> perl -de

Re: Python 2.5.3: call for patches

2008-10-10 Thread Terry Reedy
[EMAIL PROTECTED] wrote: On Oct 7, 9:27 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: In principle, the release will include all changes that are already on the release25-maint branch in subversion [1]. If you think that specific changes should be considered, please create an issue in the bug

Re: List Order of Initialization

2008-10-10 Thread Terry Reedy
Diez B. Roggisch wrote: SamFeltus schrieb: When a list initializes, will it always evaluate in order starting at element 0 and finishing with the last element? def f1(x): return x + 2 def f2(x): return x * 2 def f3(x): return x * 3 the_list = [f1(7), f2(8), f3(4)] Yes. From t

Re: Read data from Serial Command

2008-10-10 Thread brianrpsgt1
Thanks for the message What exactly is happening is that the return is "None" for the command that I am sending. If I connect through Hyperterminal and execute the 'sh nw enc' command, it returns 'WEP' I have confirmed that the serial port is correct and open with the s.isOpen() function. Also

Re: Read data from Serial Command

2008-10-10 Thread Grant Edwards
On 2008-10-10, brianrpsgt1 <[EMAIL PROTECTED]> wrote: > I am new to scripting. I am trying to read the settings from a serial > device using Python. I have been able to successfully connect to the > device and change baud rate settings, ect... with PySerial. I am > trying to send a command to th

Re: indexing arrays

2008-10-10 Thread Terry Reedy
John [H2O] wrote: I'm having trouble slicing arrays: If these are numpy arrays, as appears, rather that array module arrays, then the numpy list might be a better place. In any case, using 'numpy' would have gotten the attention of someone scanning for posts about numpy. I thought I coul

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Gordon Allott
Aaron "Castironpi" Brady wrote: > I see. If I understand, you have a PyCObject in a dictionary. > > Look at the 'ctypes' module and try calling PyCObject_AsVoidPtr. Its > return type should be 'c_void_p', and you can use 'result.value' to > get the original pointer. > -- > http://mail.python.org

Read data from Serial Command

2008-10-10 Thread brianrpsgt1
I am new to scripting. I am trying to read the settings from a serial device using Python. I have been able to successfully connect to the device and change baud rate settings, ect... with PySerial. I am trying to send a command to the serial device and capture the returned info, however, it is

Re: python 3: sorting with a comparison function

2008-10-10 Thread Terry Reedy
Kay Schluehr wrote: Me too because I don't get this: "key specifies a function of one argument that is used to extract a comparison key from each list element: key=str.lower. The default value is None." I am not sure what you do not get, but it should say 'for example, key=str.lower." None

Using multiprocessing

2008-10-10 Thread nhwarriors
I am attempting to use the (new in 2.6) multiprocessing package to process 2 items in a large queue of items simultaneously. I'd like to be able to print to the screen the results of each item before starting the next one. I'm having trouble with this so far. Here is some (useless) example code th

Re: python 3: sorting with a comparison function

2008-10-10 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Kay Schluehr: >> Sometimes it helps when people just make clear how they use technical >> terms instead of invoking vague associations. > > And generally Python docs can enjoy growing few thousands examples... Well, that may not be necessary. But I think that a clear

Re: Modification of a urllib2 object ?

2008-10-10 Thread George Sakkis
On Oct 10, 2:32 pm, [EMAIL PROTECTED] wrote: > I have several ways to the following problem. > > This is what I have: > > ... > import ClientForm > import BeautifulSoup from BeautifulSoup > > request = urllib2.Request('http://form.com/) > > self.first_object = urllib2.open(request) > > soup = Beaut

Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 10 Okt., 20:38, [EMAIL PROTECTED] wrote: > Kay Schluehr: > > > Sometimes it helps when people just make clear how they use technical > > terms instead of invoking vague associations. > > And generally Python docs can enjoy growing few thousands examples... Cleaning up and extending documentatio

Re: Porn Addiction Solutions?

2008-10-10 Thread Reacher
On Oct 8, 2:07 pm, [EMAIL PROTECTED] wrote: > Help, I'm addicted to porn. I've been spending a lot of time > downloading hardcore porn and masturbating to it. It's ruining my > life. I just found out that one of these sites somehow hacked my card > and rang up $5K in charges which they won't even r

Re: Porn Addiction Solutions?

2008-10-10 Thread Aspersieman
On Fri, 10 Oct 2008 16:11:07 +0200, <[EMAIL PROTECTED]> wrote: On Oct 10, 7:03 am, Um Jammer NATTY <[EMAIL PROTECTED]> wrote: On Oct 10, 5:37 am, [EMAIL PROTECTED] wrote: > It's very simple. You need to know the world is much more than the > imaginery life you are looking. Spend some time in t

Set Your EMAIL CLIENT dates correctly.

2008-10-10 Thread Hatem Nassrat
I am sure this has been ranted about. People who have their dates in their client set to 2020 should be banned from using the internet, unless they have a legitimate reason like doing y3k testing on the Python Mailing list. -- Hatem Nassrat -- http://mail.python.org/mailman/listinfo/python-list

Re: Where/how to propose an addition to a standard module?

2008-10-10 Thread Skip Montanaro
> I would like to propose a new method for the string.Template class. What's > the proper procedure for doing this? There is a python-ideas mailing list. I think that's probably the right place to start. If it gets a generally favorable response there, adding a feature request with an implementa

Re: Python 2.5.3: call for patches

2008-10-10 Thread Michael Ströder
[EMAIL PROTECTED] wrote: > On Oct 7, 9:27 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> In principle, the release will include all changes that are already on >> the release25-maint branch in subversion [1]. If you think that specific >> changes should be considered, please create an issue in

Re: How to create a tuple quickly with list comprehension?

2008-10-10 Thread Hatem Nassrat
on Wed Jun 13 10:17:24 CEST 2007, Diez B. Roggisch deets at nospam.web.de wrote: >markacy wrote: > >> On 13 Cze, 09:45, "fdu.xia... at gmail.com" > gmail.com> wrote: >>> Hi all, >>> >>> I can use list comprehension to create list quickly. So I >>> expected that I >>> can created tuple quickly with

Where/how to propose an addition to a standard module?

2008-10-10 Thread Joe Strout
I would like to propose a new method for the string.Template class. What's the proper procedure for doing this? I've joined the python- ideas list, but that seems to be only for proposed language changes, and my idea doesn't require any change to the language at all. From

Re: python 3: sorting with a comparison function

2008-10-10 Thread Paul McGuire
On Oct 10, 12:22 pm, [EMAIL PROTECTED] wrote: > On Oct 10, 8:35 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: > > > > Yes, that's a wonderful thing, because from the code I see around > > > 99.9% of people see the cmp and just use it, totally ignoring

Re: python 3: sorting with a comparison function

2008-10-10 Thread bearophileHUGS
Kay Schluehr: > Sometimes it helps when people just make clear how they use technical > terms instead of invoking vague associations. And generally Python docs can enjoy growing few thousands examples... Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Modification of a urllib2 object ?

2008-10-10 Thread vincehofmeister
I have several ways to the following problem. This is what I have: ... import ClientForm import BeautifulSoup from BeautifulSoup request = urllib2.Request('http://form.com/) self.first_object = urllib2.open(request) soup = BeautifulSoup(self.first_object) forms = ClienForm.ParseResponse(self

Re: Python 2.5.3: call for patches

2008-10-10 Thread troelswh
On Oct 7, 9:27 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > In principle, the release will include all changes that are already on > the release25-maint branch in subversion [1]. If you think that specific > changes should be considered, please create an issue in the bug tracker > [2], and la

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Lie
On Oct 11, 5:27 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > This of course means that there has to be another > thread active to actually do the i/o on a periodic basis, > gathering the outputs and writing them out, and reading > the inputs and scattering them to the various named input >

Re: Get "code object" of class

2008-10-10 Thread Matimus
On Oct 10, 5:50 am, Okko Willeboordse <[EMAIL PROTECTED]> wrote: > To get the "code object" c of my_class I can do; > > c = compile(inspect.getsource(my_class), "

Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 10 Okt., 19:22, [EMAIL PROTECTED] wrote: > On Oct 10, 8:35 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: > > > > Yes, that's a wonderful thing, because from the code I see around > > > 99.9% of people see the cmp and just use it, totally ignoring th

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Lie
On Oct 11, 5:27 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > This of course means that there has to be another > thread active to actually do the i/o on a periodic basis, > gathering the outputs and writing them out, and reading > the inputs and scattering them to the various named input >

Re: urlparse import Faillure

2008-10-10 Thread Wojtek Walczak
On Thu, 9 Oct 2008 22:47:58 -0700 (PDT), Robert Hancock wrote: import CGIHTTPServer ... > ImportError: cannot import name urlparse ... > It points to the third line of the comment. Any ideas on how to > proceed with the debugging? Have you tried getting rid of this comment? I doubt tha

Re: Porn Addiction Solutions?

2008-10-10 Thread John Ladasky
On Oct 8, 12:30 pm, [EMAIL PROTECTED] wrote: > On Oct 8, 3:07 pm, [EMAIL PROTECTED] wrote: > > Any suggestions? Sure -- my suggestion is to post in relevant newsgroups! Rec.music.hip-hop, comp.lang.python, comp.lang.ruby, and alt.comp.freeware are not appropriate places for your inquiries. Alt.su

Re: default value in __init__

2008-10-10 Thread bearophileHUGS
Chris Rebert: > The general idea been discussed ad-nauseum on the list several times > before, including just 2 months ago. See e.g.: Okay, it can't be fixed then. Bye and thank you, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 12:04 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > Did you try: > > > tmp= PyLong_FromLong( ( long ) info.info.x11.display ); > > PyDict_SetItemString (dict, "display", tmp); > > Py_DECREF (tmp); > > > Or also try: > > > PyCObject_AsVoidPtr( tmp ); >

Re: default value in __init__

2008-10-10 Thread Duncan Booth
[EMAIL PROTECTED] wrote: >> I don't think simply re-executing the default argument >> expression on each call works either: that would confuse at least as >> many people as the current system. > > May I ask you why? I think I don't agree, but I am not sure. > My thought (which may well be wrong)

Subprocess problem on multiple OS's

2008-10-10 Thread Amanda Jamin
Subprocess issues with platform independence Postby ajamin on Wed Oct 08, 2008 10:46 am I am writing a python script that will act as a wrapper for another program. The python script will provide the inputs for this program and will verify that the output is correct. The application runs on multip

Re: python 3: sorting with a comparison function

2008-10-10 Thread pruebauno
On Oct 10, 8:35 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: > > > Yes, that's a wonderful thing, because from the code I see around > > 99.9% of people see the cmp and just use it, totally ignoring the > > presence of the 'key' argument, that allows bett

Re: default value in __init__

2008-10-10 Thread Chris Rebert
On Fri, Oct 10, 2008 at 4:36 AM, <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers: >> You mean : "to people that don't bother reading the FineManual *nor* >> searching the newsgroup / ML archives ?" > > Are there ways to change how Python3 manages arguments and functions, > to remove this antifeat

Re: inspect feature

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 3:36 am, Bruno Desthuilliers wrote: > Aaron "Castironpi" Brady a écrit : > > > > > On Oct 9, 3:48 am, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > >> Aaron "Castironpi" Brady a écrit : > > >>> Hello, > >>> The 'inspect' module has this method: > >>> inspect.getargvalues(frame) > >

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Gordon Allott
Aaron "Castironpi" Brady wrote: > Did you try: > > tmp= PyLong_FromLong( ( long ) info.info.x11.display ); > PyDict_SetItemString (dict, "display", tmp); > Py_DECREF (tmp); > > Or also try: > > PyCObject_AsVoidPtr( tmp ); > -- > http://mail.python.org/mailman/listinfo/python-list the problem is

GzipFile(fileobj=sys.stdin) Why not?

2008-10-10 Thread Brian Cole
Appears like a patch was submitted to allow GzipFile to work from pipes long ago. But there's no comment on why this was never accepted. Is there a good reason? http://mail.python.org/pipermail/patches/2006-June/020064.html -Brian -- http://mail.python.org/mailman/listinfo/python-list

Python Boot Camp 11/10-11/14

2008-10-10 Thread Kerri Reno
Anyone thinking about attending the Python Boot Camp at Big Nerd Ranch? This is the time. If they don't get one more person they will cancel the session. So if you're on the fence, take one for the Gipper, and sign up for the November session. http://www.bignerdranch.com/classes/python.shtml K

unified_diff

2008-10-10 Thread [EMAIL PROTECTED]
I can create a unified diff as follows: udiff = difflib.unified_diff(text1, text2) Is there an available function somewhere to apply udiff to text1 and construct text2, like this? text2 = some_func(text1, udiff) Thanks for any clues. -- http://mail.python.org/mailman/listinfo/python-list

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 5:24 am, Gordon Allott <[EMAIL PROTECTED]> wrote: > Hello :) > > The result of various incompatibilities has left me needing to somehow > extract the address that a null pointer is pointing to with the null > pointer being exposed to python via PyCObject_FromVoidPtr > > the code that cre

Re: How to do regular BASH work in Python?

2008-10-10 Thread Michael Torrie
Frantisek Malina wrote: > What is the best way to do the regular bash commands in native python? > > - create directory > - create file > - make a symlink > - copy a file to another directory > - move a file > - set permissions > > I need to write a program that creates real application/FTP accou

Re: Wanted: something more Pythonic than _winreg.

2008-10-10 Thread Mike Driscoll
On Oct 10, 9:44 am, Jonathan Fine <[EMAIL PROTECTED]> wrote: > Hello > > I'm using the _winreg module to change Windows registry settings, but > its rather low level, and I'd prefer to be working with something more > Pythonic. > > Does anyone have any recommendations? > > Jonathan I've used YARW

Re: Wanted: something more Pythonic than _winreg.

2008-10-10 Thread Christian Heimes
Jonathan Fine wrote: Hello I'm using the _winreg module to change Windows registry settings, but its rather low level, and I'd prefer to be working with something more Pythonic. Does anyone have any recommendations? Yeah, please implement a nice wrapper and submit a patch to bugs.python.o

Re: a regular expression problem

2008-10-10 Thread Leefurong
> > I want to use django to dispatch url. > > The url is like /test/Google/6,and my patten is r'^/test/(?P\b\W+ \W should be \w, a typo? :) > > \b)/(?P\d+)$'. > > It works when the string is English(like Google), but fails when the > > string is in foreign language. Try this: r'(?u)^/test/(?P\b\w+\

Re: List Order of Initialization

2008-10-10 Thread Diez B. Roggisch
SamFeltus schrieb: When a list initializes, will it always evaluate in order starting at element 0 and finishing with the last element? def f1(x): return x + 2 def f2(x): return x * 2 def f3(x): return x * 3 the_list = [f1(7), f2(8), f3(4)] Yes. Diez -- http://mail.python.org/m

List Order of Initialization

2008-10-10 Thread SamFeltus
When a list initializes, will it always evaluate in order starting at element 0 and finishing with the last element? def f1(x): return x + 2 def f2(x): return x * 2 def f3(x): return x * 3 the_list = [f1(7), f2(8), f3(4)] -- http://mail.python.org/mailman/listinfo/python-list

Wanted: something more Pythonic than _winreg.

2008-10-10 Thread Jonathan Fine
Hello I'm using the _winreg module to change Windows registry settings, but its rather low level, and I'd prefer to be working with something more Pythonic. Does anyone have any recommendations? Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: FLexible formatted text involving nested lists?

2008-10-10 Thread Tino Wildenhain
Hi, RossRGK wrote: Kerri Reno wrote: Ross, I'm no expert in python, so excuse me if this is inane. What I would do is have fmts be a dictionary where fmts = { 3 = 'oats %0d kilos over %0d days with %0d workers', 2 = 'barley %0d lbs for %0d hours', 1 = 'apples %0d baskets'}

Re: Porn Addiction Solutions?

2008-10-10 Thread pheeh . zero
On Oct 10, 7:03 am, Um Jammer NATTY <[EMAIL PROTECTED]> wrote: > On Oct 10, 5:37 am, [EMAIL PROTECTED] wrote: > > > It's very simple. You need to know the world is much more than the > > imaginery life you are looking. Spend some time in the feet of the > > Lord Jesus who would help you to come out

Re: indexing arrays

2008-10-10 Thread Emily Rodgers
"John [H2O]" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I'm having trouble slicing arrays: > > I thought I could do the following: i = array(range(140,149)) j = array(range(5,20)) a = acc[i,j] > Traceback (most recent call last): > File "", line 1, in > Value

Re: FLexible formatted text involving nested lists?

2008-10-10 Thread RossRGK
davidsands wrote: The tuple() type-conversion function will do what you need: print fmts[0] % tuple(bigList[0]) print fmts[1] % tuple(bigList[1]) print fmts[2] % tuple(bigList[2]) I never thought of the tuple type conversion - that looks promising. Thanks for that! R. -- http://

Re: FLexible formatted text involving nested lists?

2008-10-10 Thread RossRGK
Kerri Reno wrote: Ross, I'm no expert in python, so excuse me if this is inane. What I would do is have fmts be a dictionary where fmts = { 3 = 'oats %0d kilos over %0d days with %0d workers', 2 = 'barley %0d lbs for %0d hours', 1 = 'apples %0d baskets'} then something like

Re: default value in __init__

2008-10-10 Thread bearophileHUGS
Duncan Booth: > You can't just copy the default values on every call: you would still get > people confused by the semantics whether you did a shallow or deep copy or > as now no copy. I think I agree. > I don't think simply re-executing the default argument > expression on each call works eithe

indexing arrays

2008-10-10 Thread John [H2O]
I'm having trouble slicing arrays: I thought I could do the following: >>> i = array(range(140,149)) >>> j = array(range(5,20)) >>> a = acc[i,j] Traceback (most recent call last): File "", line 1, in ValueError: shape mismatch: objects cannot be broadcast to a single shape It's strange, becau

Enormous amount webcams womans showing groupsex. Free

2008-10-10 Thread fernandena
Enormous amount webcams womans showing groupsex. http://sexystory.psend.com/groupsex.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: book recommendation for Python newbie?

2008-10-10 Thread Abah Joseph
Core Python Programming" written by Wesley J. Chun, second edition, Prentice Hall, ISBN 0-13-226993-7, go for it. I`m only a PHP programmer and this book have helped me a lot from basic to advance level. though i`m still reading... On 10/10/08, slais-www <[EMAIL PROTECTED]> wrote: > > Mike Drisc

Re: default value in __init__

2008-10-10 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > Bruno Desthuilliers: >> You mean : "to people that don't bother reading the FineManual *nor* >> searching the newsgroup / ML archives ?" > > Are there ways to change how Python3 manages arguments and functions, > to remove this antifeature of Python, avoiding this commo

  1   2   >