Re: Windows, IDLE, __doc_, other

2009-12-20 Thread Alf P. Steinbach
* W. eWatson: When I use numpy.__doc__ in IDLE under Win XP, I get a heap of words without reasonable line breaks. "\nNumPy\n=\n\nProvides\n 1. An array object of arbitrary homogeneous items\n 2. Fast mathematical operations over arrays\n 3. Linear Algebra, Fourier Transforms, Random N

Re: Mails & encoding

2009-12-20 Thread Gabriel Genellina
En Sun, 20 Dec 2009 07:46:02 -0300, Lord Eldritch escribió: I have a CGI written in Python to process a form a read/write a text file (a minimal database). It runs in a Linux box with and it looks all the encoding is UTF8. [...] - Related to the former one: the CGI sends an email with str

Re: AttributeError: logging module bug ?

2009-12-20 Thread Gabriel Genellina
En Sat, 19 Dec 2009 00:18:26 -0300, Peter escribió: This was somehow unexpected for me, since in a module using logger.py, I could use either import: from mylogger import logger # without package name or from of.mylogger import logger # with package name but this does not seem to work f

Re: How can I get the target platform info of a dll with Python 3.1.1?

2009-12-20 Thread Gabriel Genellina
En Mon, 14 Dec 2009 07:25:45 -0300, W00D00 escribió: On dec. 12, 03:18, "Gabriel Genellina" wrote: En Fri, 11 Dec 2009 16:39:37 -0300, Isti escribió: > I have manydllfiles and I would like to select them into two > different folders (PC and PPC). For this I need to know the target > platfo

Re: Class variables static by default?

2009-12-20 Thread Gabriel Genellina
En Sun, 20 Dec 2009 01:16:16 -0300, Steven D'Aprano escribió: On Sun, 20 Dec 2009 11:44:11 +1100, Lie Ryan wrote: In python, 'class variable' is a variable that belongs to a class; not to the instance and is shared by all instance that belong to the class. Surely, since string variables are

Re: how do I set a Python installation as the default under windows ?

2009-12-20 Thread Sridhar Ratnakumar
On 12/20/2009 1:35 AM, Stef Mientki wrote: Steve Holden wrote: Stef Mientki wrote: hello, I just upgraded from Python 2.5 to 2.6. Most of the things work, but I'm struggling with one issue, when I start Python in a command window, it still uses Python 2.5. Is there a way to get Python 2.6 as

Re: Live Video Capture using Python

2009-12-20 Thread David Lyon
Also try.. http://www.unixuser.org/~euske/python/vnc2flv/index.html On Mon, 21 Dec 2009 11:15:32 +0530, Banibrata Dutta wrote: > Have you searched the archives of this list ? I remember seeing a related > discussion 5-6 months back. > > On Mon, Dec 21, 2009 at 2:35 AM, aditya shukla > wrote: >

Re: Live Video Capture using Python

2009-12-20 Thread Banibrata Dutta
Have you searched the archives of this list ? I remember seeing a related discussion 5-6 months back. On Mon, Dec 21, 2009 at 2:35 AM, aditya shukla wrote: > Hello Guys, > > I am trying to capture images from a live broadcast of a "cricket match" or > say any video using python. I can see the vid

Re: The fun of Python

2009-12-20 Thread Ben Finney
a...@pythoncraft.com (Aahz) writes: > I never called myself a programmer before I learned Python because I > didn't really like it. It took Python to make me realize that > programming *could* be fun, or at least not annoying enough to keep me > from making a career of programming. +1 QOTW --

The fun of Python (was Re: When will Python 3 be fully deployed)

2009-12-20 Thread Aahz
In article , Roy Smith wrote: >In article , a...@pythoncraft.com (Aahz) >wrote: >> >> -- >> Looking back over the years, after I learned Python I realized that I >> never really had enjoyed programming before. > >That's a sad commentary. Python is fun to use, but surely there are other >ways

Re: numpy performance and random numbers

2009-12-20 Thread Rami Chowdhury
On Dec 20, 2009, at 17:41 , Peter Pearson wrote: > On Sun, 20 Dec 2009 07:26:03 +1100, Lie Ryan wrote: >> On 12/20/2009 4:02 AM, Carl Johan Rehn wrote: >> >> Parallel PRNGs are an unsolved problem in computer science. >>> >>> Thanks again for sharing your knowledge. I had no idea. This mea

Re: Multithreaded python program freezes

2009-12-20 Thread Cameron Simpson
On 20Dec2009 17:36, Andreas R�sdal wrote: | I have some problems with a http proxy which is implemented | in Python 2.6. A few times a day, the proxy begins using 100% CPU | and doesn't work any more. | | I have created a thread dump when the problem occurs here: | http://www.pvv.ntnu.no/~andrear

Re: converting string to a date format

2009-12-20 Thread Ben Finney
tekion writes: > I have this string date format: 24/Nov/2009:10:39:03 -0500 and would > like to convert it to a date format of "2009-11-24 10:39:03". This should, ideally, consist of two separate operations: * parse the string, using a specific format, to create a ‘datetime’ object * c

Re: Windows, IDLE, __doc_, other

2009-12-20 Thread Benjamin Kaplan
On Sun, Dec 20, 2009 at 9:16 PM, W. eWatson wrote: > When I use numpy.__doc__ in IDLE under Win XP, I get a heap of words without > reasonable line breaks. > > "\nNumPy\n=\n\nProvides\n  1. An array object of arbitrary homogeneous > items\n  2. Fast mathematical operations over arrays\n  3. Li

Re: converting string to a date format

2009-12-20 Thread MRAB
tekion wrote: All, I know there is a datetime module for converting and manipulate date format. I have this string date format: 24/Nov/2009:10:39:03 -0500 and would like to convert it to a date format of "2009-11-24 10:39:03". At the moment I am reading datetime module trying to find out if I

Re: Windows, IDLE, __doc_, other

2009-12-20 Thread Lie Ryan
On 12/21/2009 1:19 PM, W. eWatson wrote: When I use numpy.__doc__ in IDLE under Win XP, I get a heap of words without reasonable line breaks. "\nNumPy\n=\n\nProvides\n 1. An array object of arbitrary homogeneous items\n 2. Fast mathematical operations over arrays\n 3. Linear Algebra, F

converting string to a date format

2009-12-20 Thread tekion
All, I know there is a datetime module for converting and manipulate date format. I have this string date format: 24/Nov/2009:10:39:03 -0500 and would like to convert it to a date format of "2009-11-24 10:39:03". At the moment I am reading datetime module trying to find out if I could do it with

Re: Windows, IDLE, __doc_, other

2009-12-20 Thread W. eWatson
Add to this. Isn't there a way to see the arguments and descriptions of functions? -- http://mail.python.org/mailman/listinfo/python-list

Windows, IDLE, __doc_, other

2009-12-20 Thread W. eWatson
When I use numpy.__doc__ in IDLE under Win XP, I get a heap of words without reasonable line breaks. "\nNumPy\n=\n\nProvides\n 1. An array object of arbitrary homogeneous items\n 2. Fast mathematical operations over arrays\n 3. Linear Algebra, Fourier Transforms, Random Number ... Is

Re: numpy performance and random numbers

2009-12-20 Thread Peter Pearson
On Sun, 20 Dec 2009 07:26:03 +1100, Lie Ryan wrote: > On 12/20/2009 4:02 AM, Carl Johan Rehn wrote: > > Parallel PRNGs are an unsolved problem in computer science. >> >> Thanks again for sharing your knowledge. I had no idea. This means >> that if I want to speed up my application I have to go

Re: strptime not strict enough

2009-12-20 Thread Tim Roberts
Chris Rebert wrote: >On Tue, Dec 15, 2009 at 9:47 PM, Tim Roberts wrote: >> Tobias Weber wrote: >>> >>>despite the directives for leading zero stime.strptime('09121', >>>'%y%m%d') returns the first of December. Shouldn't it raise ValueError? >> >> Python merely calls the strptime function in yo

Re: numpy performance and random numbers

2009-12-20 Thread Lie Ryan
On 12/21/2009 1:13 AM, David Cournapeau wrote: But the OP case mostly like falls in your estimated 0.01% case. PRNG quality is essential for reliable Monte Carlo procedures. I don't think long period is enough to guarantee those good properties for // random generators - at least it is not obviou

Re: C Structure rebuild with ctypes

2009-12-20 Thread Mark Tolonen
"Georg" wrote in message news:7p6ksnfkg...@mid.individual.net... Hi All, I need to use a library written in C. The routine "int func (int handle, int *numVars, char ***varNames, int **varTypes)" expects a complex object: " ... Variable names are structured as an array of *numVars pointer

Re: Anybody use web2py?

2009-12-20 Thread mdipierro
People seem to think that because web2py has a default for almost everything (part of its design) than you must use the default. - There is a web based IDE but you *can* use the shell instead (like you do in Django) - There are migrations but you *can* disable then (and it works like Django that d

Re: When will Python 3 be fully deployed

2009-12-20 Thread Roy Smith
In article , a...@pythoncraft.com (Aahz) wrote: > Looking back over the years, after I learned Python I realized that I > never really had enjoyed programming before. That's a sad commentary. Python is fun to use, but surely there are other ways you can enjoy programming? The first thing I le

Re: PyQt Signals and multiple sources

2009-12-20 Thread Zabin
On Dec 21, 11:15 am, "John Posner" wrote: > On Sun, 20 Dec 2009 16:59:11 -0500, Zabin wrote: > > I am beginner in programming in pyqt. I have been trying to call the > > same function from multiple events- but each event results in a > > different instance of the function. I am just unable to fig

Re: PyQt Signals and multiple sources

2009-12-20 Thread John Posner
On Sun, 20 Dec 2009 16:59:11 -0500, Zabin wrote: I am beginner in programming in pyqt. I have been trying to call the same function from multiple events- but each event results in a different instance of the function. I am just unable to figure out how to retrieve the source which calls the fun

PyQt Signals and multiple sources

2009-12-20 Thread Zabin
I am beginner in programming in pyqt. I have been trying to call the same function from multiple events- but each event results in a different instance of the function. I am just unable to figure out how to retrieve the source which calls the function: My source signal declarations are as below: Q

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Dave Angel
Victor Subervi wrote: Inelegant. This will be elegant: ourFile = string.split(__file__, "/") p = ourFile[len(ourFile) - 1] p = p[: - 3] site = ourFile[4][:-10] if site != '': site = site[:-1] from this import that(site) Now it's automated. V Amazing. When trying to split a path string

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Victor Subervi
On Sun, Dec 20, 2009 at 3:26 PM, Stephen Hansen wrote: > On Sun, Dec 20, 2009 at 11:01 AM, Victor Subervi > wrote: > >> If you want a piece of code to have a variable number of differing >>> behaviors, that's something you can handle in many elegant ways. That's >>> something inheritance is good

Re: How Do I...?

2009-12-20 Thread Tim Chase
Victor Subervi wrote: The aim was not arrogance, but expression of exasperation "Walk a mile in my mocassins." You can't do it. I'm an artist. I think out of my right hemisphere, not my left like you. You couldn't possibly understand. [snip] Thank you for your help anyway. Thank you for your

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Tim Chase
Victor Subervi wrote: On Sun, Dec 20, 2009 at 1:20 PM, Stephen Hansen wrote: Of course, I can pass the page name as a parameter, but that's not elegant. That is precisely what it is in fact-- elegant; it is non-elegant to have magical behavior where what 'imports' something somehow changes or

Re: Anybody use web2py?

2009-12-20 Thread Baron
> If all > web2py offers is default views, then it may be good for proof of concept > projects, however I can't see in my right mind, proofing an application, > and then turning around to write it in django because more than the > defaults is needed. You *can* customize web2py views ... > Why doe

Live Video Capture using Python

2009-12-20 Thread aditya shukla
Hello Guys, I am trying to capture images from a live broadcast of a "cricket match" or say any video using python. I can see the video in the browser.My aim is to capture the video at any moment and create an images.Searching on google turns up http://videocapture.sourceforge.net/ .I am not sure

Re: console command to get the path of a function

2009-12-20 Thread pograph
On Dec 20, 12:02 pm, Terry Reedy wrote: > On 12/20/2009 7:45 AM, mattia wrote: > > > Hi all, is there a way in the python shell to list the path of a library > > function (in order to look at the source code?). > > On Windows and I believe other systems, for the stdlib, 'import x' > imports .../Py

Re: how to go back from 2.6.4 to 2.6.2 under windows ?

2009-12-20 Thread Stef Mientki
So I guess this is a reasonable approach, and all libraries should work well, unless one of these libraries has a work around for one of the bugs fixed between 2.6.2 and 2.6.4. Let VPython people know about this problem. People should be able to run it on the latest patched 2.6. Well thi

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Stephen Hansen
On Sun, Dec 20, 2009 at 11:01 AM, Victor Subervi wrote: > If you want a piece of code to have a variable number of differing >> behaviors, that's something you can handle in many elegant ways. That's >> something inheritance is good for, with a core default behavior represented >> in one class and

Re: how to go back from 2.6.4 to 2.6.2 under windows ?

2009-12-20 Thread Terry Reedy
On 12/20/2009 2:59 PM, Stef Mientki wrote: Benjamin Kaplan wrote: On Sun, Dec 20, 2009 at 9:26 AM, Stef Mientki wrote: hello, I've just upgraded my system from Python 2.5 to 2.6.4, and installed the latest packages of a lot of libraries. Now one essential package (VPython) only works with Py

Re: Anybody use web2py?

2009-12-20 Thread mdipierro
The concept of distributed transaction does not make sense on GAE because there is only one datastore. It supports regular transactions on GAE to the extent that GAE supports them but you have to use the GAE run_in_transaction API explictely. It does support distributed transactions with multiple

Re: IDLE issue

2009-12-20 Thread Terry Reedy
On 12/20/2009 12:17 PM, Mohamed Musthafa Safarulla wrote: I have python 2.5 ...but when i open it, i get the below error messages Socker Error: Connection refused and IDLE's subprocess didnt make connection. Either IDLE can't start subprocess or personal firewall software is blocking the conne

Re: console command to get the path of a function

2009-12-20 Thread Terry Reedy
On 12/20/2009 7:45 AM, mattia wrote: Hi all, is there a way in the python shell to list the path of a library function (in order to look at the source code?). On Windows and I believe other systems, for the stdlib, 'import x' imports .../Pythonx.y/Lib/x -- http://mail.python.org/mailman/lis

Re: how to go back from 2.6.4 to 2.6.2 under windows ?

2009-12-20 Thread Stef Mientki
Benjamin Kaplan wrote: On Sun, Dec 20, 2009 at 9:26 AM, Stef Mientki wrote: hello, I've just upgraded my system from Python 2.5 to 2.6.4, and installed the latest packages of a lot of libraries. Now one essential package (VPython) only works with Python 2.6.2. I tried to install Python 2.6

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Victor Subervi
On Sun, Dec 20, 2009 at 1:20 PM, Stephen Hansen wrote: > On Sun, Dec 20, 2009 at 3:05 AM, Victor Subervi > wrote: > >> Of course, I can pass the page name as a parameter, but that's not >> elegant. >> > > That is precisely what it is in fact-- elegant; it is non-elegant to have > magical behavior

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Stephen Hansen
On Sun, Dec 20, 2009 at 3:05 AM, Victor Subervi wrote: > Of course, I can pass the page name as a parameter, but that's not elegant. > That is precisely what it is in fact-- elegant; it is non-elegant to have magical behavior where what 'imports' something somehow changes or determines how that s

Re: Python3.1: gzip encoding with UTF-8 fails

2009-12-20 Thread Mark Tolonen
"Diez B. Roggisch" wrote in message news:7p7328f3r1r2...@mid.uni-berlin.de... Johannes Bauer schrieb: > Hello group, > > with this following program: > > #!/usr/bin/python3 > import gzip > x = gzip.open("testdatei", "wb") > x.write("ä") > x.close() > > I get a broken .gzip file when decompressin

Re: Where is my namespace?

2009-12-20 Thread Aahz
In article <00a7037c$0$15659$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: >> 2009/12/7 vsoler : >>> >>> 3. Mark says: The from statement is really an assignment to names in >>> the importer's scope--a name-copy operation, not a name aliasing.   I >>> don't fully understand what he means. C

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread MRAB
Victor Subervi wrote: Hi; I'm looking for something like os.environ['HTTP_REFERER'] but for python scripts. That is, if I have a script that is imported by another script, how can I have the script that is being imported determine which script imported it? I don't know whether that's possible (

IDLE issue

2009-12-20 Thread Mohamed Musthafa Safarulla
I have python 2.5 ...but when i open it, i get the below error messages Socker Error: Connection refused and IDLE's subprocess didnt make connection. Either IDLE can't start subprocess or personal firewall software is blocking the connection. Have someone encountered this issue? Please help.

Re: Invalid syntax error

2009-12-20 Thread Todd A. Jacobs
On Sun, Dec 20, 2009 at 08:40:05AM -0500, Ray Holt wrote: > Why am I getting an invalid syntax error on the following: > os.chdir(c:\\Python_Modules). The error message says the colon after c You need to pass either a string literal or a variable. If you're passing a string, like you are trying t

Re: os.starfile() linux

2009-12-20 Thread Todd A. Jacobs
On Mon, Nov 30, 2009 at 05:35:31PM +, joao abrantes wrote: > to open a new shell and to put the output of the new python program > there.. The subprocess module is probably what you want. -- "Oh, look: rocks!" -- Doctor Who, "Destiny of the Daleks" -- http://mail.python.org/mailma

Re: When will Python 3 be fully deployed

2009-12-20 Thread Aahz
In article , Ned Deily wrote: >In article <4b20ac0a$0$1596$742ec...@news.sonic.net>, > John Nagle wrote: >> >> I'd argue against using Python 2.6 for production work. Either use >> Python 2.5, which is stable, or 3.x, which is bleeding-edge. 2.6 >> has some of the features of Python 3.x, but n

Re: problem with cheetah

2009-12-20 Thread mlowicki
On Dec 20, 4:54 pm, "Diez B. Roggisch" wrote: > mlowicki schrieb: > > > Hi!, i get such error when I try to install cheetah: > > > sudo easy_install cheetah > > Searching for cheetah > > Readinghttp://pypi.python.org/simple/cheetah/ > > Readinghttp://www.CheetahTemplate.org/ > > Readinghttp://sour

Re: opening a connection to quickbooks

2009-12-20 Thread Aahz
In article , wrote: > >Has anyone ever attempted to work with quickbooks in a real time fashion? I >need some advise. I'm trying to work out a way to have real time >updates/inserts/and queries. I'd also like not to use all the user >licenses. But... > >I have discovered that opening a connectio

Re: Python3.1: gzip encoding with UTF-8 fails

2009-12-20 Thread Diez B. Roggisch
Johannes Bauer schrieb: Hello group, with this following program: #!/usr/bin/python3 import gzip x = gzip.open("testdatei", "wb") x.write("ä") x.close() I get a broken .gzip file when decompressing: $ cat testdatei |gunzip ä gzip: stdin: invalid compressed data--length error As it only happe

Multithreaded python program freezes

2009-12-20 Thread Andreas Røsdal
Hello, I have some problems with a http proxy which is implemented in Python 2.6. A few times a day, the proxy begins using 100% CPU and doesn't work any more. I have created a thread dump when the problem occurs here: http://www.pvv.ntnu.no/~andrearo/thread-dump.html This is a thread dump duri

Re: how to go back from 2.6.4 to 2.6.2 under windows ?

2009-12-20 Thread Benjamin Kaplan
On Sun, Dec 20, 2009 at 9:26 AM, Stef Mientki wrote: > hello, > > I've just upgraded my system from Python 2.5 to 2.6.4, > and installed the latest packages of a lot of libraries. > > Now one essential package (VPython) only works with Python 2.6.2. > I tried to install Python 2.6.2 over this 2.6.

Re: Creating Classes

2009-12-20 Thread Steve Holden
Dave Angel wrote: [...] > We were talking about 2.x And I explicitly mentioned 3.x because if > one develops code that depends on old-style classes, they'll be in > trouble with 3.x, which has no way to specify old-style classes. In > 3.x, all classes are new-style. And although it'll no longer

Python3.1: gzip encoding with UTF-8 fails

2009-12-20 Thread Johannes Bauer
Hello group, with this following program: #!/usr/bin/python3 import gzip x = gzip.open("testdatei", "wb") x.write("ä") x.close() I get a broken .gzip file when decompressing: $ cat testdatei |gunzip ä gzip: stdin: invalid compressed data--length error As it only happens with UTF-8 characters,

Re: problem with cheetah

2009-12-20 Thread Diez B. Roggisch
mlowicki schrieb: Hi!, i get such error when I try to install cheetah: sudo easy_install cheetah Searching for cheetah Reading http://pypi.python.org/simple/cheetah/ Reading http://www.CheetahTemplate.org/ Reading http://sourceforge.net/project/showfiles.php?group_id=28961 Reading http://www.che

Re: Invalid syntax error

2009-12-20 Thread D'Arcy J.M. Cain
On Sun, 20 Dec 2009 08:40:05 -0500 "Ray Holt" wrote: > Why am I getting an invalid syntax error on the following: > os.chdir(c:\\Python_Modules). The error message says the colon after c is You forgot the quotes around the string. I am not on Windows but I think the following will all work. os.

Re: console command to get the path of a function

2009-12-20 Thread Dave Angel
mattia wrote: Hi all, is there a way in the python shell to list the path of a library function (in order to look at the source code?). Thanks, Mattia If you know what module it's in, you can use themodule.__file__ But realize that this will only work if the module has been imported

Re: comparing dialects of csv-module

2009-12-20 Thread Malte Dik
quote: d = csv.Sniffer().sniff("1,2,3") def eq(a, b, attributes=[name for name in dir(d) if not > name.startswith("_")]): > ... return all(getattr(a, n, None) == getattr(b, n, None) for n in > attributes) Only change I made is substituting "dir(csv.excel)" or "dir(csv.Dialect)" for

problem with cheetah

2009-12-20 Thread mlowicki
Hi!, i get such error when I try to install cheetah: sudo easy_install cheetah Searching for cheetah Reading http://pypi.python.org/simple/cheetah/ Reading http://www.CheetahTemplate.org/ Reading http://sourceforge.net/project/showfiles.php?group_id=28961 Reading http://www.cheetahtemplate.org/ Be

how to go back from 2.6.4 to 2.6.2 under windows ?

2009-12-20 Thread Stef Mientki
hello, I've just upgraded my system from Python 2.5 to 2.6.4, and installed the latest packages of a lot of libraries. Now one essential package (VPython) only works with Python 2.6.2. I tried to install Python 2.6.2 over this 2.6.4 installation, and indeed the readme file says it's 2.6.2, but t

Re: numpy performance and random numbers

2009-12-20 Thread David Cournapeau
On Sun, Dec 20, 2009 at 6:47 PM, Lie Ryan wrote: > On 12/20/2009 2:53 PM, sturlamolden wrote: >> >> On 20 Des, 01:46, Lie Ryan  wrote: >> >>> Not necessarily, you only need to be certain that the two streams don't >>> overlap in any reasonable amount of time. For that purpose, you can use >>> a PR

Re: Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-20 Thread Alf P. Steinbach
Hi, 10 details I forgot in my first response... * John Posner: [...] Chapter 2, which current runs 98 pages! The chapter 2 PDF I posted on http://tinyurl.com/programmingbookP3> was and is (it's not been updated) 101 pages, with an "-EOT-" at page 102. I suspect you may have read the previ

Re: Invalid syntax error

2009-12-20 Thread Xavier Ho
Putting quotemarks "" around the path would be a good start, I think. Cheers, Xav On Sun, Dec 20, 2009 at 11:40 PM, Ray Holt wrote: > Why am I getting an invalid syntax error on the following: > os.chdir(c:\\Python_Modules). The error message says the colon after c is > invalid syntax. Why is

Invalid syntax error

2009-12-20 Thread Ray Holt
Why am I getting an invalid syntax error on the following: os.chdir(c:\\Python_Modules). The error message says the colon after c is invalid syntax. Why is it saying this when I am trying to change directory to c:\Python_Modules. Thanks, Ray -- http://mail.python.org/mailman/listinfo/python-list

Re: console command to get the path of a function

2009-12-20 Thread Peter Otten
mattia wrote: > Il Sun, 20 Dec 2009 13:53:18 +0100, Irmen de Jong ha scritto: > >> On 12/20/2009 1:45 PM, mattia wrote: >>> Hi all, is there a way in the python shell to list the path of a >>> library function (in order to look at the source code?). >>> >>> Thanks, Mattia >> >> something like th

Re: console command to get the path of a function

2009-12-20 Thread mattia
Il Sun, 20 Dec 2009 13:53:18 +0100, Irmen de Jong ha scritto: > On 12/20/2009 1:45 PM, mattia wrote: >> Hi all, is there a way in the python shell to list the path of a >> library function (in order to look at the source code?). >> >> Thanks, Mattia > > something like this? > > >>> import inspe

Re: console command to get the path of a function

2009-12-20 Thread mattia
Il Sun, 20 Dec 2009 13:53:18 +0100, Irmen de Jong ha scritto: > On 12/20/2009 1:45 PM, mattia wrote: >> Hi all, is there a way in the python shell to list the path of a >> library function (in order to look at the source code?). >> >> Thanks, Mattia > > something like this? > > >>> import inspe

Re: py itertools?

2009-12-20 Thread mattia
Il Sun, 20 Dec 2009 03:49:35 -0800, Chris Rebert ha scritto: >> On Dec 19, 12:48 pm, Chris Rebert wrote: >>> On Sat, Dec 19, 2009 at 2:54 AM, mattia wrote: >>> > Hi all, I need to create the permutation of two strings but without >>> > repeat the values, e.g. 'ab' for me is equal to 'ba'. Here i

Re: console command to get the path of a function

2009-12-20 Thread Irmen de Jong
On 12/20/2009 1:45 PM, mattia wrote: Hi all, is there a way in the python shell to list the path of a library function (in order to look at the source code?). Thanks, Mattia something like this? >>> import inspect >>> import os >>> inspect.getsourcefile(os.path.split) 'C:\\Python26\\lib\\ntpa

C Structure rebuild with ctypes

2009-12-20 Thread Georg
Hi All, I need to use a library written in C. The routine "int func (int handle, int *numVars, char ***varNames, int **varTypes)" expects a complex object: " ... Variable names are structured as an array of *numVars pointers, each pointing to a char string containing a variable name, and *var

console command to get the path of a function

2009-12-20 Thread mattia
Hi all, is there a way in the python shell to list the path of a library function (in order to look at the source code?). Thanks, Mattia -- http://mail.python.org/mailman/listinfo/python-list

Re: How Do I...?

2009-12-20 Thread Steve Holden
Victor Subervi wrote: > On Sat, Dec 19, 2009 at 8:04 PM, Steve Holden, Chairman, PSF > mailto:chair...@python.org>> wrote: > > Well, if we were looking for arrogance we could easily interpret that > last statement as such. Please remember that although we are mainly > left-brain types

Re: tarfiles usage on python 2.4.4

2009-12-20 Thread yousay
On Dec 19, 9:27 am, tekion wrote: > All, > I am using tarfile module and my python is version 2.4.4.  When I call > method extractall, I am getting error method does not exist. Could > someone confirm if the method exist on python 2.4.4? Thanks dir(tarfile) check if is exist -- http://mail.pytho

Re: py itertools?

2009-12-20 Thread Chris Rebert
> On Dec 19, 12:48 pm, Chris Rebert wrote: >> On Sat, Dec 19, 2009 at 2:54 AM, mattia wrote: >> > Hi all, I need to create the permutation of two strings but without >> > repeat the values, e.g. 'ab' for me is equal to 'ba'. Here is my >> > solution, but maybe the python library provides somethin

Re: Import Problem

2009-12-20 Thread Chris Rebert
On Sun, Dec 20, 2009 at 3:34 AM, Victor Subervi wrote: > But I get this error: > > /var/www/html/angrynates.com/cart/createTables2.py >   263 >   264 ''' >   265 >   266 createTables2() >   267 > createTables2 = >  /var/www/html/angrynates.com/cart/createTables2.py in createTables2() >   105   

Import Problem

2009-12-20 Thread Victor Subervi
Hi; I have this import statement: from particulars import storePrimaryStandAlone, addStore, ourStores particulars.py has this code: def addStore(): return 'jewelry' def ourStores(): return ['products', 'prescriptions'] def storePrimaryStandAlone(): return 'prescriptions' But I get this

Re: py itertools?

2009-12-20 Thread Parker
>>> a = 'qwerty' >>> b = '^%&$#' >>> c = [(x,y) for x in a for y in b] >>> c [('q', '^'), ('q', '%'), ('q', '&'), ('q', '$'), ('q', '#'), ('w', '^'), ('w', '%'), ('w', '&'), ('w', '$'), ('w', '#'), ('e', '^'), ('e', '%'), ('e', '&'), ('e', '$'), ('e', '#'), ('r', '^'), ('r', '%'), ('r', '&'), ('r',

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Victor Subervi
On Sun, Dec 20, 2009 at 5:18 AM, Chris Rebert wrote: > On Sun, Dec 20, 2009 at 2:06 AM, Victor Subervi > wrote: > > Hi; > > I'm looking for something like os.environ['HTTP_REFERER'] but for python > > scripts. That is, if I have a script that is imported by another script, > how > > can I have t

Re: Mails & encoding

2009-12-20 Thread Chris Rebert
On Sun, Dec 20, 2009 at 2:46 AM, Lord Eldritch wrote: > - When I have: > > ttext='áá' > > I get a warning sendinme to this page > > http://www.python.org/peps/pep-0263.html > > Should I understand that PEP has been already implemented and follow it? Yes. Cheers, Chris -- http://blog.reb

Mails & encoding

2009-12-20 Thread Lord Eldritch
I have a CGI written in Python to process a form a read/write a text file (a minimal database). It runs in a Linux box with and it looks all the encoding is UTF8. Now I have two questions: - When I have: ttext='áá' I get a warning sendinme to this page http://www.python.org/peps/pep-0

Re: Class variables static by default?

2009-12-20 Thread Steven D'Aprano
On Sat, 19 Dec 2009 20:28:07 -0800, Chris Rebert wrote: >> Surely, since string variables are strings, and float variables are >> floats, and bool variables are bools, and module variables are modules, >> a class variable will be a class and an instance variable will be an >> instance? > > As the

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Chris Rebert
On Sun, Dec 20, 2009 at 2:06 AM, Victor Subervi wrote: > Hi; > I'm looking for something like os.environ['HTTP_REFERER'] but for python > scripts. That is, if I have a script that is imported by another script, how > can I have the script that is being imported determine which script imported > it

Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Victor Subervi
Hi; I'm looking for something like os.environ['HTTP_REFERER'] but for python scripts. That is, if I have a script that is imported by another script, how can I have the script that is being imported determine which script imported it? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-l

Re: Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-20 Thread Steven D'Aprano
On Sun, 20 Dec 2009 08:29:43 +0100, Alf P. Steinbach wrote: > I recently (just weeks > ago) was astounded to see that a C++ "expert" thought that Java had pass > by reference, apparently because in Java only references are passed > around. The Java community, for some bizarre reason, has a tenden

Re: numpy performance and random numbers

2009-12-20 Thread Lie Ryan
On 12/20/2009 2:53 PM, sturlamolden wrote: On 20 Des, 01:46, Lie Ryan wrote: Not necessarily, you only need to be certain that the two streams don't overlap in any reasonable amount of time. For that purpose, you can use a PRNG that have extremely high period like Mersenne Twister and puts the

Re: how do I set a Python installation as the default under windows ?

2009-12-20 Thread Stef Mientki
Steve Holden wrote: Stef Mientki wrote: hello, I just upgraded from Python 2.5 to 2.6. Most of the things work, but I'm struggling with one issue, when I start Python in a command window, it still uses Python 2.5. Is there a way to get Python 2.6 as my default Python environment ? thanks,

Re: How Do I...?

2009-12-20 Thread Victor Subervi
On Sat, Dec 19, 2009 at 8:04 PM, Steve Holden, Chairman, PSF < chair...@python.org> wrote: > Well, if we were looking for arrogance we could easily interpret that > last statement as such. Please remember that although we are mainly > left-brain types on this list some of us do have artistic and m