Re: Playing sounds at time indexes

2010-09-24 Thread OKB (not okblacke)
Thomas Jollans wrote: > On Wednesday 22 September 2010, it occurred to OKB (not okblacke) > to exclaim: >> I'm looking for an audio library for Python. I googled >> and found a >> few, but none of them seem to have a simple way to play a >> particular sound file from a particu

Re: Pyflakes and IPython does not work for Emacs on Windows?

2010-09-24 Thread Dsrt Egle
On Sep 24, 2:26 pm, Benjamin Kaplan wrote: > On Friday, September 24, 2010, Dsrt Egle wrote: > > Hi, > > > With Python on Windows, I tried to use Emacs as the programming > > environment. For syntax checking I installed pyflakes, but flymake > > always reports "fail to launch. No such file or dir

Re: Regular Expression match

2010-09-24 Thread Vlastimil Brom
2010/9/25 AON LAZIO : > Hi, >    Say I have >    p = re.compile('a|b') >    text = 'a' >    d = p.findall(text) >    #d -> ['a'] >    What is the way to find out which pattern p match (the former or latter)? > I mean without knowing the outcome of p.findall >    Thanks > > -- > Aonlazio > '

Re: Pyflakes and IPython does not work for Emacs on Windows?

2010-09-24 Thread David Robinow
On Fri, Sep 24, 2010 at 4:59 PM, Dsrt Egle wrote: > ... > I can't invoke IPython by Emacs on Windows, either. Looks ipyhon.el > only works for Linux? There don't appear to be a lot of ipython.el users on Windows. You may have better look on an emacs list since there appear to be some configuration

Re: os.path.normcase rationale?

2010-09-24 Thread Ben Finney
Chris Withers writes: > On 21/09/2010 01:02, Steven D'Aprano wrote: > > What do you mean "the filesystem"? > > > > If I look at the available devices on my system now, I see: > > > > 2 x FAT-32 filesystems > > 1 x ext2 filesystem > > 3 x ext3 filesystems > > 1 x NTFS filesystem > > 1 x UDF filesy

Regular Expression match

2010-09-24 Thread AON LAZIO
Hi, Say I have p = re.compile('a|b') text = 'a' d = p.findall(text) #d -> ['a'] What is the way to find out which pattern p match (the former or latter)? I mean without knowing the outcome of p.findall Thanks -- Aonlazio 'Peace is always the way.' NW -- http://mail.p

Re: feature request: string.contains('...')

2010-09-24 Thread John Posner
On 9/24/2010 2:45 PM, Tim Chase wrote: On 09/24/10 13:01, Ethan Furman wrote: John Posner wrote: Another "missing feature" candidate: sublist >>> 'bc' in 'abcde' True >>> list('bc') in list('abcde') False I'm not aware of any idioms, but how about a simple function? Foldable into a one

Re: Pyflakes and IPython does not work for Emacs on Windows?

2010-09-24 Thread Benjamin Kaplan
On Friday, September 24, 2010, Dsrt Egle wrote: > Hi, > > With Python on Windows, I tried to use Emacs as the programming > environment. For syntax checking I installed pyflakes, but flymake > always reports "fail to launch. No such file or directory: pyflakes" > when opening a Python file. Is pyf

Pyflakes and IPython does not work for Emacs on Windows?

2010-09-24 Thread Dsrt Egle
Hi, With Python on Windows, I tried to use Emacs as the programming environment. For syntax checking I installed pyflakes, but flymake always reports "fail to launch. No such file or directory: pyflakes" when opening a Python file. Is pyflakes not for Windows? What Python syntax checking tools wor

Re: SocketServer: replace network by hard drive

2010-09-24 Thread John Nagle
On 9/24/2010 12:53 AM, antoine wrote: Hello, I would like to create a python server for which the requests are passed by files on the hard drive instead of a network. I am currently looking at the SocketServer python module, hoping for an easy modification. Is it doable at all? If yes, how shou

Re: feature request: string.contains('...')

2010-09-24 Thread Tim Chase
On 09/24/10 13:01, Ethan Furman wrote: John Posner wrote: Another "missing feature" candidate: sublist >>> 'bc' in 'abcde' True >>> list('bc') in list('abcde') False I'm not aware of any idioms, but how about a simple function? def listinlist(list1, list2): "checks if

Re: feature request: string.contains('...')

2010-09-24 Thread Ethan Furman
John Posner wrote: Another "missing feature" candidate: sublist >>> 'bc' in 'abcde' True >>> list('bc') in list('abcde') False I'm not aware of any idioms, but how about a simple function? def listinlist(list1, list2): "checks if list1 is in list2" if not list1: re

Re: SocketServer: replace network by hard drive

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to antoine to exclaim: > Hello, > > I would like to create a python server for which the requests are > passed by files on the hard drive instead of a network. > I am currently looking at the SocketServer python module, hoping for > an easy modification. >

Re: Python 2.6: How to turn off cgitb.py's DeprecationWarning: BaseException.message has been deprecated

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to pyt...@bdurham.com to exclaim: > Python 2.6: We're using the standard lib's cgitb module to > provide diagnostic messages when unexpected exceptions occur. > > Unfortunately, this module raises a DeprecationWarning like below > when it is used: > > C:\P

Re: Raw Sockets - IP-Encapsulation

2010-09-24 Thread Nobody
On Thu, 23 Sep 2010 21:41:19 +0200, Matthias Guentert wrote: > I would like to create an IP tunnel using the IP protocol type 4 > (socket.IPPROTO_IPIP) on a Linux host. (I also would be happy if I > could create a GRE tunnel) > > The thing is, I just don't understand how I such a socket could be

Re: feature request: string.contains('...')

2010-09-24 Thread John Posner
On 9/24/2010 4:21 AM, Peter Otten wrote: If you are not interested in the position of the substr use the "in" operator: if substr in s: print "found" else: print "not found" Another "missing feature" candidate: sublist >>> 'bc' in 'abcde' True >>> list('bc') in list('abc

Re: inspect.getmodulename giving unexpected results

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to Geoff Bache to exclaim: > > > Unfortunately, it doesn't seem to do that in some cases. Consider the > > > > > following code: > > It does behave as documented: it does not find package names, or > > investigate sys.modules > > Possibly, although for me

Re: inspect.getmodulename giving unexpected results

2010-09-24 Thread Geoff Bache
> > Unfortunately, it doesn't seem to do that in some cases. Consider the > > following code: > > It does behave as documented: it does not find package names, or investigate > sys.modules Possibly, although for me "logging" is exposed as a module, and ought to behave as one when requesting the m

Re: Subprocess does not return for longer-running process

2010-09-24 Thread Nobody
On Fri, 24 Sep 2010 15:18:47 +1200, Lawrence D'Oliveiro wrote: And I can't think of any reason why you should use os.waitpid() or similar; use the .wait() method. >>> >>> I have used WNOHANG to poll for completion of a subprocess while >>> providing progress updates to the user. >> >>

Re: Expanding a vector by replicating elements individually

2010-09-24 Thread gburde...@gmail.com
On Sep 22, 1:30 am, Peter Otten <__pete...@web.de> wrote: > > array([1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3]) > > Peter Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: upload file using post to https server

2010-09-24 Thread Brian Jones
I just did this yesterday with the 'poster' module after fumbling around with various other ideas, which in the end just produced a lot of code and didn't get me very far. Poster makes this pretty easy, and if you can't install it to the system python path, use 'setup.py install --user' and it'll p

Re: lists and list item matches (ghost wodgame)

2010-09-24 Thread nn
On Sep 23, 8:46 pm, Baba wrote: > On Sep 23, 8:13 pm, nn wrote: > > > > > On Sep 23, 1:25 pm, Baba wrote: > > > > On Sep 23, 4:17 pm, nn wrote: > > > > > On Sep 23, 10:56 am, nn wrote: > > > > > > On Sep 22, 6:39 pm, Baba wrote: > > > > > > > On Sep 22, 9:18 pm, Baba wrote: > > > > > > > > O

Re: inspect.getmodulename giving unexpected results

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to Geoff Bache to exclaim: > Hi all, > > I'm trying to examine some things in my stack. The information I get > out of inspect.stack() gives file names and I would like to convert > them to module names. I naturally assumes inspect.getmodulename would > fix

Re: Python in Linux - barrier to Python 3.x

2010-09-24 Thread David Cournapeau
On Fri, Sep 24, 2010 at 6:23 PM, Steven D'Aprano wrote: >> Typically, if your want to install say >> matplotlib with pygtk with a custom built python, you are in for a fun >> ride because you have to rebuild everything. > > That's not what I consider a typical case. But I take your point. It is

inspect.getmodulename giving unexpected results

2010-09-24 Thread Geoff Bache
Hi all, I'm trying to examine some things in my stack. The information I get out of inspect.stack() gives file names and I would like to convert them to module names. I naturally assumes inspect.getmodulename would fix this for me. Unfortunately, it doesn't seem to do that in some cases. Consider

Re: inspect.stack() or inspect.currentframe() gives "list index out of range error"

2010-09-24 Thread Peter Otten
deluxstar wrote: > We have an application working on several servers generally written > with Python 2.6 and Twisted 10. > The source codes are located in one server and compiled in this > server. The compiled files are copied to other server via network and > application server works with these c

Re: Distributing Packages

2010-09-24 Thread Chris Withers
On 23/09/2010 16:41, Greg Lindstrom wrote: I am not intending to start anything, here, but would like to know if any consensus has been reached in how to distribute Python modules. Hi Greg, The following shows a pattern that's working well for me: https://secure.simplistix.co.uk/svn/Simplisti

problem in Gasp !

2010-09-24 Thread n.a.s
Hi, I want to ask about graphics using Gasp .Attached is exercise 10 (houses at night) ,if i call the draw_house function once it will work properly ,but more than one call,windows and doors disappear from some houses . Any one can advic

Re: Python in Linux - barrier to Python 3.x

2010-09-24 Thread Steven D'Aprano
On Fri, 24 Sep 2010 17:35:38 +0900, David Cournapeau wrote: > On Fri, Sep 24, 2010 at 4:51 PM, Steven D'Aprano > wrote: >> On Tue, 21 Sep 2010 13:54:55 -0700, Ant wrote: >> >>> Yes you are right - I've checked on my home machine, and it is indeed >>> 2.6. Still, no Python 3 unless I upgrade to Fe

Re: feature request: string.contains('...')

2010-09-24 Thread Wolfgang Rohdewald
On Freitag 24 September 2010, Wim Feijen wrote: > would really like having a string.contains('...') function > which returns either True or False. I know I can mimick this > behaviour by saying string.find('...') != -1 , however, I > find this harder to read. >>> a = 'xy134' >>> '13' in a True >>

Raw Sockets - IP-Encapsulation

2010-09-24 Thread Matthias Guentert
Hello list members I would like to create an IP tunnel using the IP protocol type 4 (socket.IPPROTO_IPIP) on a Linux host. (I also would be happy if I could create a GRE tunnel) The thing is, I just don't understand how I such a socket could be created and then later on handled. Regarding to hel

Re: Python in Linux - barrier to Python 3.x

2010-09-24 Thread David Cournapeau
On Fri, Sep 24, 2010 at 4:51 PM, Steven D'Aprano wrote: > On Tue, 21 Sep 2010 13:54:55 -0700, Ant wrote: > >> Yes you are right - I've checked on my home machine, and it is indeed >> 2.6. Still, no Python 3 unless I upgrade to Fedora 13, and upgrading an >> OS in order to get the latest version of

Re: os.path.normcase rationale?

2010-09-24 Thread Chris Withers
On 21/09/2010 01:02, Steven D'Aprano wrote: On Mon, 20 Sep 2010 19:45:37 +0100, Chris Withers wrote: Well, no, that doesn't feel right. Normalisation of case, for me, means "give me the case as the filesystem thinks it should be", What do you mean "the filesystem"? If I look at the available

Re: feature request: string.contains('...')

2010-09-24 Thread Peter Otten
Wim Feijen wrote: > I was wondering, how to make a feature request? You can post suggestions to improve python on the python-ideas mailing list or make feature requests on the bugtracker at bugs.python.org > I would really like having a string.contains('...') function which returns > either Tru

feature request: string.contains('...')

2010-09-24 Thread Wim Feijen
Hello, I was wondering, how to make a feature request? I would really like having a string.contains('...') function which returns either True or False. I know I can mimick this behaviour by saying string.find('...') != -1 , however, I find this harder to read. string.contains('...') is easier to

SocketServer: replace network by hard drive

2010-09-24 Thread antoine
Hello, I would like to create a python server for which the requests are passed by files on the hard drive instead of a network. I am currently looking at the SocketServer python module, hoping for an easy modification. Is it doable at all? If yes, how should it be done? Thanks, Antoine. -- htt

Re: Python in Linux - barrier to Python 3.x

2010-09-24 Thread Steven D'Aprano
On Tue, 21 Sep 2010 13:54:55 -0700, Ant wrote: > Yes you are right - I've checked on my home machine, and it is indeed > 2.6. Still, no Python 3 unless I upgrade to Fedora 13, and upgrading an > OS in order to get the latest version of one package is a bit much! Or you could install from source,

Re: Too much code - slicing

2010-09-24 Thread Steven D'Aprano
On Thu, 23 Sep 2010 11:42:25 -0400, Andreas Waldenburger wrote: > On Wed, 22 Sep 2010 20:45:55 -0500 John Bokma > wrote: > >> What surprises me is that this is still discussed. It's like argueing >> about significant whitespace. :-) > > Which is evil! Iagreethatsignioficantwhitespaceisevil.Py

inspect.stack() or inspect.currentframe() gives "list index out of range error"

2010-09-24 Thread deluxstar
Hi, We have an application working on several servers generally written with Python 2.6 and Twisted 10. The source codes are located in one server and compiled in this server. The compiled files are copied to other server via network and application server works with these compiled files. In this

Re: Python in Linux - barrier to Python 3.x

2010-09-24 Thread Steven D'Aprano
On Fri, 24 Sep 2010 15:23:08 +1200, Lawrence D'Oliveiro wrote: > In message > <2ab95324-4394-4510-b953-3c8555b0a...@q9g2000vbd.googlegroups.com>, Ant > wrote: > >> Still, no Python 3 unless I upgrade to Fedora 13, and upgrading an OS >> in order to get the latest version of one package is a bit m