Re: fft of a dat file?

2009-03-24 Thread Steven D'Aprano
On Wed, 25 Mar 2009 11:26:00 +0530, Soumen banerjee wrote: > Hello, > I'm kind of new to python and i wanted to do a little project, make a > frequency plot of some wav audio. I have been following this webpage > http://www.acronymchile.com/sigproc.html and have got to the making of a > dat file c

fft of a dat file?

2009-03-24 Thread Soumen banerjee
Hello, I'm kind of new to python and i wanted to do a little project, make a frequency plot of some wav audio. I have been following this webpage http://www.acronymchile.com/sigproc.html and have got to the making of a dat file containing the samples and time of sampling. The question here is how d

Re: garbage collection / reference cycles (cont.)

2009-03-24 Thread Aaron Brady
On Mar 25, 12:11 am, Aaron Brady wrote: > Hello, > > I am posting the code I mentioned on Saturday that collects garbage > and cyclic garbage in a flattened two-step process.  The code takes > 122 lines incl. comments, with 100 in tests.  It should be in a reply > to this. > > My aim is a buffer-l

garbage collection / reference cycles (cont.)

2009-03-24 Thread Aaron Brady
Hello, I am posting the code I mentioned on Saturday that collects garbage and cyclic garbage in a flattened two-step process. The code takes 122 lines incl. comments, with 100 in tests. It should be in a reply to this. My aim is a buffer-like object which can contain reference-counted objects.

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Carl Banks
On Mar 24, 8:32 pm, Istvan Albert wrote: > On Mar 24, 9:35 pm, Maxim Khitrov wrote: > > > Works perfectly fine with relative imports. > > This only demonstrates that you are not aware of what the problem > actually is. > > Try using relative imports so that it works when you import the module > i

Tkinter - Multiple Tk() instances/mainloops in one process?

2009-03-24 Thread Gregory Sheaffer
I've been working on a Python project for several weeks involving a client for connecting to an AIM distribution server and holding multiple conversations in separate windows. Without getting into a lot of detail, the basic main program loop is while(1) on message recieved

Re: Async serial communication/threads sharing data

2009-03-24 Thread John Nagle
Jean-Paul Calderone wrote: On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood wrote: Jean-Paul Calderone wrote: [snip] After bringing in all the heavy machinery of Twisted, you're still polling at 10Hz. That's disappointing. John Nagle -- http://mail.pyth

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Istvan Albert
On Mar 24, 9:35 pm, Maxim Khitrov wrote: > Works perfectly fine with relative imports. This only demonstrates that you are not aware of what the problem actually is. Try using relative imports so that it works when you import the module itself. Now run the module as a program. The same module t

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Steve Holden
CinnamonDonkey wrote: > Top responses guys! This has all helped increadibly. > > Bearophile, > > My applogies if I have offended you, but: > > 1. "I can't know much about you from the start" - Is kind of my point. > Perhaps it would be better to avoid jumping to conclusions and pre- > judging so

Re: Why am I getting "[10263 refs]"?

2009-03-24 Thread Christian Heimes
Russ P. wrote: > I am running 2.5.2 on Red Hat 5. I am getting many printouts of > reference counts, such as > > [10263 refs] > > I do not recall ever seeing this until recently. Why am I getting > this? Thanks. You are using a debug build of Python. Christian -- http://mail.python.org/mailman

Re: Translating unicode data

2009-03-24 Thread John Machin
On Mar 24, 10:30 am, Scott David Daniels wrote: > CaptainMcCrank wrote: > > Hi list, > > > I'm struggling with a problem analyzing large amounts of unicode data > > in an http wireshark capture. > > I've solved the problem with the interpreter, but I'm not sure how to > > do this in an automated f

Why am I getting "[10263 refs]"?

2009-03-24 Thread Russ P.
I am running 2.5.2 on Red Hat 5. I am getting many printouts of reference counts, such as [10263 refs] I do not recall ever seeing this until recently. Why am I getting this? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Maxim Khitrov
On Tue, Mar 24, 2009 at 8:57 PM, Istvan Albert wrote: > Does it not bother you that a module that uses relative imports cannot > be run on its own anymore? $ python --help -m mod : run library module as a script (terminates option list) $ python -m some.module.name Works perfectly fine with re

Re: Best GUI toolkit with Table support

2009-03-24 Thread John Fabiani
deech wrote: > Hi all, > I am making a cross-platform frontend to a sqlite3 database. Which > python GUI toolkit has the best table support? Tkinter doesn't seem to > support them (without additional package installation). > > The issue is that the application must run off a flash drive with a >

Re: Python 3 consistency proposal

2009-03-24 Thread Terry Reedy
gert wrote: On Mar 25, 1:23 am, Steven D'Aprano wrote: On Tue, 24 Mar 2009 16:45:26 -0700, gert wrote: Rename all built in classes with a capital letter example Str() Int() Object() Make () optional for a function definition class Test: pass def test: pass Any chance Guido would approv

Re: Python 3 consistency proposal

2009-03-24 Thread Ben Finney
Steven D'Aprano writes: > If you *are* willing to do the work, the chances would still be > pretty slim. Guido has just rejected a patch adding PEP 8 compliant > aliases for types like datetime […] As Guido has quoted before, "A > foolish consistency is the hobgoblin of little minds". Indeed, th

Re: blocked on futex

2009-03-24 Thread msoulier
On Mar 20, 10:22 am, a...@pythoncraft.com (Aahz) wrote: > How many processes do you have running?  What kind of guarantee do you One process. No threads, no forking. > have that there's only one process if you think there should be only one? > What's on the other side of the socket?  If there's n

Re: Python 3 consistency proposal

2009-03-24 Thread gert
On Mar 25, 1:23 am, Steven D'Aprano wrote: > On Tue, 24 Mar 2009 16:45:26 -0700, gert wrote: > > Rename all built in classes with a capital letter example Str() Int() > > Object() > > > Make () optional for a function definition class Test: > >     pass > > > def test: > >     pass > > > Any chanc

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Istvan Albert
On Mar 24, 3:16 pm, "Gabriel Genellina" wrote: > Did you know, once a module is imported by the first time yeah yeah, could we not get sidetracked with details that are not relevant? what it obviously means is to import it in all of your modules that need to access to relative paths > I don't u

Re: file open fails.

2009-03-24 Thread Rhodri James
On Tue, 24 Mar 2009 22:48:30 -, Wes James wrote: On Tue, Mar 24, 2009 at 4:32 PM, Wes James wrote: \T might mean the same thing as \t (tab), but I thought it would be different... I guess not: http://docs.python.org/reference/lexical_analysis.html#string-literals Wonder why when I d

Re: file open fails.

2009-03-24 Thread Steven D'Aprano
On Tue, 24 Mar 2009 16:48:30 -0600, Wes James wrote: > On Tue, Mar 24, 2009 at 4:32 PM, Wes James wrote: >> On Tue, Mar 24, 2009 at 4:04 PM, Scott David Daniels >> wrote: >>> Atul. wrote: >> >> >> >>> In your case, '\r' is a return (a single character), not two >>> characters long. I think its

Re: setting directory mod date

2009-03-24 Thread MRAB
Gabriel Genellina wrote: En Tue, 24 Mar 2009 19:10:50 -0300, MRAB escribió: jyoun...@kc.rr.com wrote: I've got some Python code (2.5.1) that's compressing folders on a Windows machine. When the directories get compressed, their modification date changes. Is it possible to grab the modific

Re: Python 3 consistency proposal

2009-03-24 Thread Steven D'Aprano
On Tue, 24 Mar 2009 16:45:26 -0700, gert wrote: > Rename all built in classes with a capital letter example Str() Int() > Object() > > Make () optional for a function definition class Test: > pass > > def test: > pass > > Any chance Guido would approve this :-) Unless you're volunteeri

Re: setting directory mod date

2009-03-24 Thread Gabriel Genellina
En Tue, 24 Mar 2009 19:10:50 -0300, MRAB escribió: jyoun...@kc.rr.com wrote: I've got some Python code (2.5.1) that's compressing folders on a Windows machine. When the directories get compressed, their modification date changes. Is it possible to grab the modification date of the fol

Re: Problem Python 2.6.1 vs 2.6 & pyWin32

2009-03-24 Thread John Machin
Martin v. Löwis v.loewis.de> writes: > > > Sorry for not being explicit. With "installer" I meant the binary > > Windows installer you create with command "python setup.py > > bdist_wininst". In the past we've been able to use > > "package-version.win32.exe" files created with Python 2.5 on olde

Re: iPython 0.9.1 install under XP -- R6034

2009-03-24 Thread Esmail
Hello David, David Cournapeau wrote: If you need ipython quickly, I would simply try building the installer myself from sources - as ipython does not have dependency and is pure python, it should be straightfoward to do a > python setup.py bdist_wininst, Thanks for the suggestion, it seem

Re: Best GUI toolkit with Table support

2009-03-24 Thread Todd Whiteman
deech wrote: Hi all, I am making a cross-platform frontend to a sqlite3 database. Which python GUI toolkit has the best table support? Tkinter doesn't seem to support them (without additional package installation). The issue is that the application must run off a flash drive with a vanilla Pytho

Re: Python 3 consistency proposal

2009-03-24 Thread Daniel Fetchinson
> Rename all built in classes with a capital letter > example Str() Int() Object() Why? > Make () optional for a function definition > class Test: > pass > > def test: > pass Why? > Any chance Guido would approve this :-) In my estimation, the chance that Guido would approve this is le

Python 3 consistency proposal

2009-03-24 Thread gert
Rename all built in classes with a capital letter example Str() Int() Object() Make () optional for a function definition class Test: pass def test: pass Any chance Guido would approve this :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Style question - defining immutable class data members

2009-03-24 Thread Aahz
In article , Maxim Khitrov wrote: > >Very simple question on the preferred coding style. I frequently write >classes that have some data members initialized to immutable values. >For example: > >class Test(object): >def __init__(self): >self.some_value = 0 >self.another_value

Re: file open fails.

2009-03-24 Thread Wes James
On Tue, Mar 24, 2009 at 4:32 PM, Wes James wrote: > On Tue, Mar 24, 2009 at 4:04 PM, Scott David Daniels > wrote: >> Atul. wrote: > > > >> In your case, '\r' is a return (a single character), not two >> characters long. I think its sad that 'C:\Thesis' doesn't cause >> an error because there is

Re: debuglevel for a HTTP request

2009-03-24 Thread cgoldberg
> It doesn't show the debug output, any ideas? I think like this: opener = urllib2.build_opener(urllib2.HTTPHandler(debuglevel=1)) -- http://mail.python.org/mailman/listinfo/python-list

Re: file open fails.

2009-03-24 Thread Wes James
On Tue, Mar 24, 2009 at 4:04 PM, Scott David Daniels wrote: > Atul. wrote: > In your case, '\r' is a return (a single character), not two > characters long. I think its sad that 'C:\Thesis' doesn't cause > an error because there is no such character as '\T', but I am > probably excessively peda

[ANN] mlabwrap-1.0.1 released

2009-03-24 Thread Alexander Schmolck
Mlabwrap allows pythonistas to interface to Matlab(tm) in a very straightforward fashion: >>> from mlabwrap import mlab >>> mlab.eig([[0,1],[1,1]]) array([[-0.61803399], [ 1.61803399]]) More at . Mlabwrap 1.0.1 is just a maintenance release

Re: file open fails.

2009-03-24 Thread MRAB
Atul. wrote: Hi I am using IDLE on Windows Vista and I have a small code. title = 'C:\Thesis\refined_title.txt' file = open(title) I get the following error from Python. file = open(title) IOError: [Errno 22] invalid mode ('r') or filename: 'C:\\Thesis \refined_title.txt' Now, I can not

Re: setting directory mod date

2009-03-24 Thread MRAB
jyoun...@kc.rr.com wrote: I've got some Python code (2.5.1) that's compressing folders on a Windows machine. When the directories get compressed, their modification date changes. Is it possible to grab the modification date of the folder before it's compressed, and then set it's modification

Re: file open fails.

2009-03-24 Thread Scott David Daniels
Atul. wrote: title = 'C:\Thesis\refined_title.txt' file = open(title) I get the following error from Python. file = open(title) IOError: [Errno 22] invalid mode ('r') or filename: 'C:\\Thesis \refined_title.txt' Now, I can not understand the problem here ... Repesat to yourself 1e4 tmes:

Re: PEP 3143: Standard daemon process library

2009-03-24 Thread Ben Finney
Jean-Paul Calderone writes: > On Tue, 24 Mar 2009 15:42:46 +1100, Ben Finney > wrote: > >That sounds rather more specific than is needed for the generic > >library being proposed here. I'm wary of adding features to an API > >that is already quite complex. > > > >Isn't setting the EUID and EGID

file open fails.

2009-03-24 Thread Atul.
Hi I am using IDLE on Windows Vista and I have a small code. title = 'C:\Thesis\refined_title.txt' file = open(title) I get the following error from Python. file = open(title) IOError: [Errno 22] invalid mode ('r') or filename: 'C:\\Thesis \refined_title.txt' Now, I can not understand the

Re: minor revision encoded in SONAME in libpython.so

2009-03-24 Thread Martin v. Löwis
> So, for example, if I upgrade to libpython2.6.so.1.1 How do you do that? There won't ever be such a library. They will always be called libpython2.6.so.1.0. So no, no minor revision gets encoded into the SONAME. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: autocomplete and printing

2009-03-24 Thread Gabriel Genellina
En Tue, 24 Mar 2009 17:56:26 -0300, vikram moule escribió: Q1. I want to access a database and just by pressing the first alphabet will showup a dropdown list of all the words starting from that alphabet how can I do that ? ( I know how to access the database but the further problem is un

autocomplete and printing

2009-03-24 Thread vikram moule
Q1. I want to access a database and just by pressing the first alphabet will showup a dropdown list of all the words starting from that alphabet how can I do that ? ( I know how to access the database but the further problem is unsolved hence) Q2. How can I print a document for example bill or

debuglevel for a HTTP request

2009-03-24 Thread Carbon Man
#Python 2.5 # from Dive Into Python 11.5 import httplib httplib.HTTPConnection.debuglevel = 1 import urllib2 request = urllib2.Request('http://localhost/test/atom.xml') opener = urllib2.build_opener() feeddata = opener.open(request).read() It doesn't show the debug output, any ideas? -- http:/

setting directory mod date

2009-03-24 Thread jyoung79
I've got some Python code (2.5.1) that's compressing folders on a Windows machine. When the directories get compressed, their modification date changes. Is it possible to grab the modification date of the folder before it's compressed, and then set it's modification date back to it's origina

Re: Bash-like brace expansion

2009-03-24 Thread Paul McGuire
On Mar 24, 12:39 pm, Peter Waller wrote: > > Maybe I might re-implement this with pyparsing and some unit tests. > In your pyparsing efforts, you might draw some insights from this regex inverter (that is, given an re such as "[AB]\d", returns "A0" through "B9") on the pyparsing wiki: http://pyp

Re: Best GUI toolkit with Table support

2009-03-24 Thread Stef Mientki
deech wrote: Hi all, I am making a cross-platform frontend to a sqlite3 database. Which python GUI toolkit has the best table support? Tkinter doesn't seem to support them (without additional package installation). The issue is that the application must run off a flash drive with a vanilla Pytho

Re: Unit testing frameworks

2009-03-24 Thread Gabriel Genellina
En Tue, 24 Mar 2009 09:06:47 -0300, escribió: I am looking for a unit testing framework for Python. I am aware of nose, but was wondering if there are any others that will automatically find and run all tests under a directory hierarchy. All known testing tools (and some unknown too): http:/

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Gabriel Genellina
En Tue, 24 Mar 2009 09:01:01 -0300, R. David Murray escribió: CinnamonDonkey wrote: On 23 Mar, 18:57, bearophileh...@lycos.com wrote: > CinnamonDonkey: > > >what makes something a package? > > If you don't know what a package is, then maybe you don't need > packages. Thanx for taking the tim

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Gabriel Genellina
En Tue, 24 Mar 2009 12:49:08 -0300, Istvan Albert escribió: On Mar 23, 10:16 am, CinnamonDonkey wrote: I'm fairly new to Python so I still have a lot to learn. But I'd like to know how to correectly use relative imports. Relative imports are *fundamentally* broken in python. You will soon

Best GUI toolkit with Table support

2009-03-24 Thread deech
Hi all, I am making a cross-platform frontend to a sqlite3 database. Which python GUI toolkit has the best table support? Tkinter doesn't seem to support them (without additional package installation). The issue is that the application must run off a flash drive with a vanilla Python install on bo

Re: Bash-like brace expansion

2009-03-24 Thread Peter Waller
Heh, thanks :) Unit tests did cross my mind. I was kicking myself for not starting out with them, there were several regressions during development, and there could well still be lurking corner cases ;) I've since heard that a 'better way' would be to use pyparsing. Also, I saw that python has dr

Re: Does Python have certificate?

2009-03-24 Thread Steve Holden
Johannes Bauer wrote: > Sebastian Bassi schrieb: > >> No, there is no certification for Python. Maybe in the future... > > I'll hand out the "Johannes Bauer Python Certificate of Total > Awesomeness" for anyone who can write a hello world in python and hands > me $25000 in cash. > > This whole "

Re: Unit testing frameworks

2009-03-24 Thread pruebauno
On Mar 24, 8:06 am, grkunt...@gmail.com wrote: > I am looking for a unit testing framework for Python. I am aware of > nose, but was wondering if there are any others that will > automatically find and run all tests under a directory hierarchy. > > Thanks, Ralph *Nose *Trial *py.test -- http://mai

Re: Async serial communication/threads sharing data

2009-03-24 Thread John Nagle
Hendrik van Rooyen wrote: "Nick Craig-Wood" wrote: I wrote a serial port to TCP proxy (with logging) with twisted. The problem I had was that twisted serial ports didn't seem to have any back pressure. Not sure if this is Twisted's fault - do python sockets have automatic back pressure?

Re: install pyPgSQL on Windows for python 2.5

2009-03-24 Thread someon
On Mar 24, 4:57 pm, Dietmar Schwertberger wrote: > someone wrote: > > Hi, > > > does anyone know how to install pyPgSQL on Windows? There is no > > package for Python 2.5 on Homepage: > > I've installed newest Visual C++ Studio 2008 from Microsoft, but still > > no luck > > Hello Pet, > > you need

minor revision encoded in SONAME in libpython.so

2009-03-24 Thread szager
I'm wondering why the SONAME in libpython.so has a minor revision encoded in it; for example (on Linux): $ readelf -d libpython2.6.so | grep SONAME 0x000e (SONAME) Library soname: [libpython2.6.so.1.0] Because of this, if I compile an app against this library (with '-L/ u

Re: parsing tab separated data efficiently into numpy/pylab arrays

2009-03-24 Thread mapb81
You could take a look/use the very handy csv2rec function in matplotlib.mlab, which creates numpy struct arrays. Marco On Mar 13, 10:19 pm, per wrote: > hi all, > > what's the most efficient / preferred python way ofparsingtab > separated data intoarrays? for example if i have a file containing

Re: Translating unicode data

2009-03-24 Thread CaptainMcCrank
On Mar 23, 4:16 pm, Peter Otten <__pete...@web.de> wrote: > CaptainMcCrank wrote: > > I'm struggling with a problem analyzing large amounts of unicode data > > in an http wireshark capture. > > I've solved the problem with the interpreter, but I'm not sure how to > > do this in an automated fashion

Re: Appending to sys.path

2009-03-24 Thread Peter Otten
mhearne808[insert-at-sign-here]gmail[insert-dot-here]com wrote: > I have an application where I would like to append to the python path > dynamically. Below is a test script I wrote. Here's what I thought > would happen: > > 1) I run this script in a folder that is NOT already in PYTHONPATH > 2

Re: install pyPgSQL on Windows for python 2.5

2009-03-24 Thread Dietmar Schwertberger
someone wrote: Hi, does anyone know how to install pyPgSQL on Windows? There is no package for Python 2.5 on Homepage: I've installed newest Visual C++ Studio 2008 from Microsoft, but still no luck Hello Pet, you need Visual Studio 2003 to compile extensions for Python 2.5 If you want, I c

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Istvan Albert
On Mar 23, 10:16 am, CinnamonDonkey wrote: > I'm fairly new to Python so I still have a lot to learn. But I'd like > to know how to correectly use relative imports. Relative imports are *fundamentally* broken in python. You will soon see that code using relative import will break if you attempt

Appending to sys.path

2009-03-24 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I have an application where I would like to append to the python path dynamically. Below is a test script I wrote. Here's what I thought would happen: 1) I run this script in a folder that is NOT already in PYTHONPATH 2) The script creates a subfolder called foo. 3) The script creates a file cal

Transition from urllibs to browser and keep session alive

2009-03-24 Thread JReed
Hello, I currently have a script that uses httplib2 to navigate through a website and collect some cookies manually along the way. It is an https that requires a logon, then i navigate through a few pages and the end result is to dump some info into a javascript and i display the returned html in

Re: PEP 3143: Standard daemon process library

2009-03-24 Thread Floris Bruynooghe
On Mar 21, 11:06 pm, Ben Finney wrote: > Floris Bruynooghe writes: > > Had a quick look at the PEP and it looks very nice IMHO. > > Thank you. I hope you can try the implementation and report feedback > on that too. > > > One of the things that might be interesting is keeping file > > descriptors

Re: iPython 0.9.1 install under XP -- R6034

2009-03-24 Thread David Cournapeau
On Tue, Mar 24, 2009 at 9:36 PM, Esmail wrote: > Hello all, > > I am having problems trying installing iPython under XP. > It works great under Linux and it would be great if I could > also use it when I have to be in Windows. > > XP Professional SP2 + SP3 (tried different systems), > iPython-0.9.

Re: Unit testing frameworks

2009-03-24 Thread Maxim Khitrov
On Tue, Mar 24, 2009 at 8:06 AM, wrote: > I am looking for a unit testing framework for Python. I am aware of > nose, but was wondering if there are any others that will > automatically find and run all tests under a directory hierarchy. Have you already looked at the unittest module? Below is t

Re: Does Python have certificate?

2009-03-24 Thread MRAB
Johannes Bauer wrote: Sebastian Bassi schrieb: No, there is no certification for Python. Maybe in the future... I'll hand out the "Johannes Bauer Python Certificate of Total Awesomeness" for anyone who can write a hello world in python and hands me $25000 in cash. This whole "certified fooba

Re: Bash-like brace expansion

2009-03-24 Thread Nick Craig-Wood
Peter Waller wrote: > Okay, I got fed up with there not being any (obvious) good examples of > how to do bash-like brace expansion in Python, so I wrote it myself. > Here it is for all to enjoy! Interesting! Might I suggest some unit tests? You can then test all the corner cases (unmatched b

Re: Another of those "is" issues.

2009-03-24 Thread J. Cliff Dyer
On Fri, 2009-03-20 at 11:20 -0700, Emanuele D'Arrigo wrote: > Hi everybody, > > I was unit testing some code today and I eventually stumbled on one of > those "is" issues quickly solved replacing the "is" with "==". Still, > I don't quite see the sense of why these two cases are different: > > >>

Re: Unit testing frameworks

2009-03-24 Thread andrew cooke
grkunt...@gmail.com wrote: > I am looking for a unit testing framework for Python. I am aware of > nose, but was wondering if there are any others that will > automatically find and run all tests under a directory hierarchy. not exactly a framework, but useful while working on small projects - you

Re: Unit testing frameworks

2009-03-24 Thread Jean-Paul Calderone
On Tue, 24 Mar 2009 05:06:47 -0700 (PDT), grkunt...@gmail.com wrote: I am looking for a unit testing framework for Python. I am aware of nose, but was wondering if there are any others that will automatically find and run all tests under a directory hierarchy. One such tool is trial, http://twi

Re: PEP 3143: Standard daemon process library

2009-03-24 Thread Jean-Paul Calderone
On Tue, 24 Mar 2009 15:42:46 +1100, Ben Finney wrote: Jean-Paul Calderone writes: [snip] An additional feature which would be useful for the library to provide, however, would be the setting of euid and egid instead of uid and gid. This is necessary, for example, to write an SSH daemon whic

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread CinnamonDonkey
Top responses guys! This has all helped increadibly. Bearophile, My applogies if I have offended you, but: 1. "I can't know much about you from the start" - Is kind of my point. Perhaps it would be better to avoid jumping to conclusions and pre- judging someones abilities simply because they are

Re: Wiki syntax available when publishing on pypi

2009-03-24 Thread andrew cooke
it's some form of restructured text, which is described at http://docutils.sourceforge.net/rst.html however, there seem to be various implementations; i don't know if pypi exactly follows what is described there (i know i had a small problem with some detail being inconsistent with that conventio

Wiki syntax available when publishing on pypi

2009-03-24 Thread Luca
A non python, but pypi only related question: Where I can find a reference guide about all what I can do with the text infos about a pypi egg published? Looking at others guys code I lear how to make links, bold text, italic, lists... For example one time I found how to insert an image in the text

Re: Bash-like brace expansion

2009-03-24 Thread Ben Finney
Peter Waller writes: > Okay, yuck. I didn't realise that posting would mangle the code so > badly. Is there any better way to attach code? Yes: Use a news client other than Google Groups. > I'm using google groups. Fix that, first. -- \ “Are you pondering what I'm pondering?” “I think s

Re: Bash-like brace expansion

2009-03-24 Thread Tino Wildenhain
Peter Waller wrote: Okay, I got fed up with there not being any (obvious) good examples of how to do bash-like brace expansion in Python, so I wrote it myself. Here it is for all to enjoy! If anyone has any better solutions or any other examples of how to do this, I'd be glad to hear from them.

Re: Query regarding Python sybase module

2009-03-24 Thread skip
Srini> Does Sybase Python driver module implement multiple result sets Srini> from a single command? I've used it to get multiple result sets from stored procedures, so I guess the answer would be "yes". Something like this: >>> params = curs.callproc('stored_procedure', params)

Re: Bash-like brace expansion

2009-03-24 Thread Peter Waller
What one really wants is a re option capable of handling recursive structures, something along the lines of what PHP has: http://uk2.php.net/manual/en/regexp.reference.php Under the 'Recursive Patterns' heading. As far as I am aware, no such thing exists for Python (yet?). 2009/3/24 Peter Waller

Re: Bash-like brace expansion

2009-03-24 Thread Peter Waller
2009/3/24 Tino Wildenhain > > > The simple {foo} expansion you mention should be quite easily handled > with re.sub and a function as argument. So not much more then a few > lines of code. Could this approach be made to handle recursive expansion? From the example with the script: pprint(BraceE

Re: Bash-like brace expansion

2009-03-24 Thread bearophileHUGS
Peter Waller: > Is there any better way to attach code? This is a widely used place (but read the "contract"/disclaimer first): http://code.activestate.com/recipes/langs/python/ Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread bearophileHUGS
CinnamonDonkey: > It is neither constructive nor educational. > > It's a bit like saying "If you don't know what a function is, then > maybe you don't need it. ... have you tried having a single block of > code?" > > The point of people coming to these forums is to LEARN and share > knowledge. Perh

iPython 0.9.1 install under XP -- R6034

2009-03-24 Thread Esmail
Hello all, I am having problems trying installing iPython under XP. It works great under Linux and it would be great if I could also use it when I have to be in Windows. XP Professional SP2 + SP3 (tried different systems), iPython-0.9.1, Python 2.6.1 During "Please wait while running postinsta

Re: Bash-like brace expansion

2009-03-24 Thread Peter Waller
Okay, yuck. I didn't realise that posting would mangle the code so badly. Is there any better way to attach code? I'm using google groups. On Mar 24, 12:28 pm, Peter Waller wrote: > Okay, I got fed up with there not being any (obvious) good examples of > how to do bash-like brace expansion in Pyt

Bash-like brace expansion

2009-03-24 Thread Peter Waller
Okay, I got fed up with there not being any (obvious) good examples of how to do bash-like brace expansion in Python, so I wrote it myself. Here it is for all to enjoy! If anyone has any better solutions or any other examples of how to do this, I'd be glad to hear from them. #~ BraceExpand.py - B

Re: Does Python have certificate?

2009-03-24 Thread ajaksu
"Hendrik van Rooyen" wrote: > I like the idea, but I would suggest that the award be > limited to the first 100 participants and that the title be: > > Very Important Python Early Responder I'd pay good money for that if the 'I' could be customized to stand for Ignorant :) Daniel -- http://mail.p

Re: file.read() doesn't read the whole file

2009-03-24 Thread Sreejith K
> It's not a redirect to a file.  Fuse calls the 'read' function on the > class, the read function does a 'return' of the data, and fuse passes > the data up through the OS layer to be the result of the 'read' call > made by less. By redirection I meant reading the snapshot file instead of the ori

user site-packages, --prefix, --home and friends

2009-03-24 Thread R. David Murray
Carl wrote: > I am very confused by PEP-370 per-user site-packages. It is not > mentioned at all in the document about installing Python modules : > http://docs.python.org/3.0/install/index.html. > > It seems that --home or --prefix already provide per-user site- > packages capability. Can someon

Re: file.read() doesn't read the whole file

2009-03-24 Thread Sreejith K
On Mar 24, 4:45 pm, "R. David Murray" wrote: > Sreejith K wrote: > > On Mar 24, 2:12 pm, Ant wrote: > > > On Mar 24, 7:59 am, Sreejith K wrote: > > > ... > > > > > data is the whole file, but 'less' gives only the two lines... > > > > From this statement (that you are using less), it appears th

Unit testing frameworks

2009-03-24 Thread grkuntzmd
I am looking for a unit testing framework for Python. I am aware of nose, but was wondering if there are any others that will automatically find and run all tests under a directory hierarchy. Thanks, Ralph -- http://mail.python.org/mailman/listinfo/python-list

install pyPgSQL on Windows for python 2.5

2009-03-24 Thread someone
Hi, does anyone know how to install pyPgSQL on Windows? There is no package for Python 2.5 on Homepage: http://sourceforge.net/project/showfiles.php?group_id=16528&package_id=20458&release_id=423036 I've tried to install running: python setup.py install But getting errors python setup.py install

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread R. David Murray
Top posting corrected for clarity. CinnamonDonkey wrote: > On 23 Mar, 18:57, bearophileh...@lycos.com wrote: > > CinnamonDonkey: > > > > >what makes something a package? > > > > If you don't know what a package is, then maybe you don't need > > packages. > > > > In your project is it possible to

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Maxim Khitrov
On Tue, Mar 24, 2009 at 5:05 AM, CinnamonDonkey wrote: > Thanx Max - your explanation sorted it :-), and a big thank you to > everyone else also! > > >From the various posts, Python considers any directory containing the > __init__.py file to be a package. The top level package is the highest > di

Re: how to get the summarized text from a given URL?

2009-03-24 Thread Peter Otten
Rama Vadakattu wrote: > Is there any python library to solve the below problem? > > FOr the below URL : > -- > http://tinyurl.com/dzcwbg > > Summarized text is : > --- > By Roy Mark With sales plummeting and its smart phones failing to woo > new cu

Re: What's the difference between generating a value and returning a value?

2009-03-24 Thread Dave Angel
Clearly, there's no difference, from the wording you quoted. He uses three words more or less interchangeably, "produced", "generated" and "returned." The distinction he's making is not between these words, but between the built-in functions, which are already returning values, and the ones

Re: file.read() doesn't read the whole file

2009-03-24 Thread R. David Murray
Sreejith K wrote: > On Mar 24, 2:12 pm, Ant wrote: > > On Mar 24, 7:59 am, Sreejith K wrote: > > ... > > > > > data is the whole file, but 'less' gives only the two lines... > > > > From this statement (that you are using less), it appears that you are > > redirecting sys.stdout to a file or sim

importing modules from alternate path

2009-03-24 Thread R. David Murray
=?UTF-8?Q?Alexandru__Mo=C8=99oi?= wrote: > I'm trying with no succes to load modules from an alternate path. When > installing to default location (no --home specifed) everything works > as expected. > > $ python setup.py install --home=~ > running install > running build > running build_ext > ru

Re: What's the difference between generating a value and returning a value?

2009-03-24 Thread Daniel Dalton
On Mon, Mar 23, 2009 at 03:12:19PM -0700, grocery_stocker wrote: > So what's the difference between generating a value and returning a > value? Well when you return, you would use the "return" keyword, I would imagine... I guess generating could mean many things, you can generate a value by operat

how to get the summarized text from a given URL?

2009-03-24 Thread Rama Vadakattu
Is there any python library to solve the below problem? FOr the below URL : -- http://tinyurl.com/dzcwbg Summarized text is : --- By Roy Mark With sales plummeting and its smart phones failing to woo new customers, Sony Ericsson follows its warning

What's the difference between generating a value and returning a value?

2009-03-24 Thread grocery_stocker
Taken from the url http://openbookproject.net/thinkCSpy/ch05.xhtml#index15 "The built-in functions we have used, such as abs, pow, and max, have produced results. Calling each of these functions generates a value, which we usually assign to a variable or use as part of an expression. bigge

  1   2   >