Re: Playing WAV file with Python

2011-03-03 Thread Chris Rebert
On Tue, Mar 1, 2011 at 11:47 PM, VGNU Linux wrote: > Hi All, > How can I play WAV file in python without OS(like Linux/Windows/MAC) on a > device ? > On Google I found lot of different solution but related to OS's like > winsound, ossaudiodev etc which are not useful. Do you mean you want your co

Re: Python escape usage in django templates by GAE

2011-03-03 Thread Chris Rebert
On Wed, Mar 2, 2011 at 11:50 PM, Niklasro wrote: > Hi > I got problems with escape displaying like junk when upgrading from > django 0.96 to 1.2 with google app engine. > The code is > >     # let user choose authenticator >        for p in openIdProviders: >            p_name = p.split('.')[0] #

Re: Playing WAV file with Python

2011-03-03 Thread Matteo Landi
I imagine he is looking for a cross-platform solution: n this case, I guess the most suitable solution is pygame. Regards, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: Playing WAV file with Python

2011-03-03 Thread VGNU Linux
Hi, On Thu, Mar 3, 2011 at 1:26 PM, Chris Rebert wrote: > On Tue, Mar 1, 2011 at 11:47 PM, VGNU Linux wrote: > > Hi All, > > How can I play WAV file in python without OS(like Linux/Windows/MAC) on a > > device ? > > On Google I found lot of different solution but related to OS's like > > winsou

Re: Python escape usage in django templates by GAE

2011-03-03 Thread Niklas RTZ
Wow, that really explains it superbly also pointing me to the right place onwards. Many thanks Chris! On Thu, Mar 3, 2011 at 8:11 AM, Chris Rebert wrote: > On Wed, Mar 2, 2011 at 11:50 PM, Niklasro wrote: >> Hi >> I got problems with escape displaying like junk when upgrading from >> django 0.96

Re: Playing WAV file with Python

2011-03-03 Thread Chris Rebert
On Thu, Mar 3, 2011 at 12:17 AM, VGNU Linux wrote: > On Thu, Mar 3, 2011 at 1:26 PM, Chris Rebert wrote: >> On Tue, Mar 1, 2011 at 11:47 PM, VGNU Linux wrote: >> > How can I play WAV file in python without OS(like Linux/Windows/MAC) on >> > a >> > device ? >> > On Google I found lot of different

Re: Playing WAV file with Python

2011-03-03 Thread VGNU Linux
On Thu, Mar 3, 2011 at 1:54 PM, Chris Rebert wrote: > On Thu, Mar 3, 2011 at 12:17 AM, VGNU Linux wrote: > > On Thu, Mar 3, 2011 at 1:26 PM, Chris Rebert wrote: > >> On Tue, Mar 1, 2011 at 11:47 PM, VGNU Linux > wrote: > >> > How can I play WAV file in python without OS(like Linux/Windows/MAC)

debugging segfaults in pythen PyQt (QWebview)

2011-03-03 Thread Gelonida
Hi, I have a QWebview application, which segfaults rather often, but not all the time. I assume it is some kind of race condition when loading a certain web page with quite some built in AJax. How can I debug it? The application crashes under Windows and under Linux. I enabled already core

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Claudiu Popa
Hello, Yes, root is an ElementTree Element. Thank you for your answer! -- Best regards, Claudiu Popa -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Jean-Michel Pichavant
Steven Howe wrote: If an item is None: if ( type(x) == types.NoneType ): Bye the way, the beauty of python is that "If an item is None" translates into "If item is None". JM -- http://mail.python.org/mailman/listinfo/python-list

--------------> Web design in Chennai <--------------

2011-03-03 Thread tony player
Web Design in Chennai ** http://webdesignchennai.co.in/ ** Web Design Chennai offers Web Design in Chennai,website designing,maintenance in chennai,Web Designing and development Companies Chennai,web hosting in c

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Carl Banks
On Mar 2, 3:46 pm, Steven D'Aprano wrote: > > Fortunately for me, I never trusted python's > > complex, or should I say 'overloaded' Boolean usage. > > That's your loss. Just because you choose to not trust something which > works deterministically and reliably, doesn't mean the rest of us > shou

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Tom Zych
Carl Banks wrote: > Perl works deterministically and reliably. In fact, pretty much every > language works deterministically and reliably. Total non-argument. Well, yes. I think the real issue is, how many surprises are waiting to pounce on the unwary developer. C is deterministic and reliable,

builtin max() and weak ordering

2011-03-03 Thread Stephen Evans
The CPython builtins min() and max() both return the first satisfactory object found. This behaviour is undocumented. Examining the source in bltinmodule.c shows that min() and max() both result in a call to min_max() with Py_LT and Py_GT passed respectively. The behaviour of min() is correct.

Re: Anybody use web2py?

2011-03-03 Thread Abhinav Sood
We have built Radbox.me on web2py and it's amazing.. > On Saturday, December 19, 2009 1:42 AM AppRe Godeck wrote: > Just curious if anybody prefers web2py over django, and visa versa. I > know it is been discussed on a flame war level a lot. I am looking for a > more intellectual reasoning behind

Re: builtin max() and weak ordering

2011-03-03 Thread Mark Dickinson
On Mar 3, 10:38 am, Stephen Evans wrote: > The CPython builtins min() and max() both return the first satisfactory > object found. This behaviour is undocumented. Examining the source in > bltinmodule.c shows that min() and max() both result in a call to min_max() > with Py_LT and Py_GT passed

A Short Question on list

2011-03-03 Thread joy99
Dear Group, If I have a list of elements, like, list=[1,2,3,4,5,..] now, if I want to multiply an increment of subset of the list each time, like, elem1_list=list[0] elem2_list=list[1] elem3_list=list[2] elem4_list=list[3] multiplysubset1=elem1_list*elem2_list multiplysubset2=elem1_list*elem2_lis

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Neil Cerutti
On 2011-03-03, Tom Zych wrote: > Carl Banks wrote: >> Perl works deterministically and reliably. In fact, pretty much every >> language works deterministically and reliably. Total non-argument. > > Well, yes. I think the real issue is, how many surprises are > waiting to pounce on the unwary dev

Re: A Short Question on list

2011-03-03 Thread Corey Richardson
On 03/03/2011 08:08 AM, joy99 wrote: > Dear Group, > If I have a list of elements, like, > list=[1,2,3,4,5,..] > now, if I want to multiply an increment of subset of the list each > time, > like, > > elem1_list=list[0] > elem2_list=list[1] > elem3_list=list[2] > elem4_list=list[3] Why do you assi

Re: A Short Question on list

2011-03-03 Thread Miki Tebeka
Have a look at reduce (http://docs.python.org/library/functions.html#reduce) -- http://mail.python.org/mailman/listinfo/python-list

Re: having both dynamic and static variables

2011-03-03 Thread Westley Martínez
On Wed, 2011-03-02 at 19:45 -0800, Yingjie Lan wrote: > Hi everyone, > > Variables in Python are resolved dynamically at runtime, which comes at a > performance cost. However, a lot of times we don't need that feature. > Variables > can be determined at compile time, which should boost up speed

Re: Strange occasional marshal error

2011-03-03 Thread Graham Stratton
On Mar 2, 3:01 pm, Graham Stratton wrote: > We are using marshal for serialising objects before distributing them > around the cluster, and extremely occasionally a corrupted marshal is > produced. The current workaround is to serialise everything twice and > check that the serialisations are the

Re: Parsing numeric ranges

2011-03-03 Thread Seldon
On 02/25/2011 10:27 AM, Seldon wrote: Hi all, I have to convert integer ranges expressed in a popular "compact" notation (e.g. 2, 5-7, 20-22, 41) to a the actual set of numbers (i.e. 2,5,7,20,21,22,41). Is there any library for doing such kind of things or I have to write it from scratch ? In

Re: Strange occasional marshal error

2011-03-03 Thread Tom Zych
On Thu, 03 Mar 2011 07:09 -0800, "Graham Stratton" wrote: > Every corruption point occurs exactly three bytes above an extension > point (rounded to the nearest word for the last two). This clearly > isn't a coincidence, but I can't see where there could be a problem. > I'd be grateful for any poi

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Jean-Paul Calderone
On Mar 3, 8:16 am, Neil Cerutti wrote: > On 2011-03-03, Tom Zych wrote: > > > Carl Banks wrote: > >> Perl works deterministically and reliably.  In fact, pretty much every > >> language works deterministically and reliably.  Total non-argument. > > > Well, yes. I think the real issue is, how many

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Neil Cerutti
On 2011-03-03, Jean-Paul Calderone wrote: > On Mar 3, 8:16?am, Neil Cerutti wrote: >> On 2011-03-03, Tom Zych wrote: >> >> > Carl Banks wrote: >> >> Perl works deterministically and reliably. ?In fact, pretty much every >> >> language works deterministically and reliably. ?Total non-argument. >>

Callbacks on program exiting/aborting

2011-03-03 Thread Pengcheng Chen
Dear folks, What callback mechanisms can we use in Python? We have some device drivers are in Python and sometimes they crash. I'd like to do some cleanup before program abort/crash. Any suggestions? Thanks so much! Pengcheng -- http://mail.python.org/mailman/listinfo/python-list

Re: having both dynamic and static variables

2011-03-03 Thread Rafe Kettler
> Finally, Python 3 introduced type annotations, which are currently a > feature looking for a reason. By type annotations, do you mean function annotations (see PEP 3107, http://www.python.org/dev/peps/pep-3107/)? Or is this some other feature that I'm unaware of? Rafe -- http://mail.python.org

Pure python standard library and License

2011-03-03 Thread Markus Schaber
Hi, We want to include IronPython in one of our products, including the pure Python part of the python standard library. It seems that the IronPython installer packagers simply copied the pure python part of the standard library (the directory tree of .py files which is installed by cPython and

Re: I'm happy with Python 2.5

2011-03-03 Thread Peter Parker
On 02/27/2011 09:27 AM, Tom Zych wrote: n00m wrote: Am I turmoiling your wishful thinking? You may nourish it till the end of time. Let us cease to nourish those fabled ones who dwell under bridges. LOL ! -- http://mail.python.org/mailman/listinfo/python-list

Re: Callbacks on program exiting/aborting

2011-03-03 Thread Grant Edwards
On 2011-03-03, Pengcheng Chen wrote: > What callback mechanisms can we use in Python? We have some device > drivers are in Python and sometimes they crash. I'd like to do some > cleanup before program abort/crash. Any suggestions? http://docs.python.org/library/atexit.html -- Grant Edwards

help with regex matching multiple %e

2011-03-03 Thread mafunk
Hi, i have a line that looks something like: 2.234e+04 3.456e+02 7.234e+07 1.543e+04: some description I would like to extract all the numbers. From the python website i got the following expression for matching what in c is %e (i.e. scientific format): (see http://docs.python.org/library/re.html

Re: Strange occasional marshal error

2011-03-03 Thread MRAB
On 03/03/2011 15:09, Graham Stratton wrote: On Mar 2, 3:01 pm, Graham Stratton wrote: We are using marshal for serialising objects before distributing them around the cluster, and extremely occasionally a corrupted marshal is produced. The current workaround is to serialise everything twice and

Re: help with regex matching multiple %e

2011-03-03 Thread MRAB
On 03/03/2011 17:33, maf...@nmsu.edu wrote: Hi, i have a line that looks something like: 2.234e+04 3.456e+02 7.234e+07 1.543e+04: some description I would like to extract all the numbers. From the python website i got the following expression for matching what in c is %e (i.e. scientific format

Re: [Python-Dev] Strange occasional marshal error

2011-03-03 Thread Guido van Rossum
On Thu, Mar 3, 2011 at 9:40 AM, MRAB wrote: > On 03/03/2011 15:09, Graham Stratton wrote: >> >> On Mar 2, 3:01 pm, Graham Stratton  wrote: >>> >>> We are using marshal for serialising objects before distributing them >>> around the cluster, and extremely occasionally a corrupted marshal is >>> pro

subprocess running ant

2011-03-03 Thread Thom Hehl
I am attempting to write a python script that will check out and build our code, then deploy the executable. It will report any failures via e-mail. To this end, I'm trying to run my ant build from inside of python. I have tried the following: proc = subprocess.Popen(ant -version') proc =

Re: Playing WAV file with Python

2011-03-03 Thread Steven Howe
On 03/03/2011 01:32 AM, VGNU Linux wrote: On Thu, Mar 3, 2011 at 1:54 PM, Chris Rebert > wrote: On Thu, Mar 3, 2011 at 12:17 AM, VGNU Linux mailto:vgnuli...@gmail.com>> wrote: > On Thu, Mar 3, 2011 at 1:26 PM, Chris Rebert mailto:c...@rebertia.com>> wrote:

Re: subprocess running ant

2011-03-03 Thread MRAB
On 03/03/2011 18:14, Thom Hehl wrote: I am attempting to write a python script that will check out and build our code, then deploy the executable. It will report any failures via e-mail. To this end, I’m trying to run my ant build from inside of python. I have tried the following: proc = subpro

RE: subprocess running ant

2011-03-03 Thread Thom Hehl
Actually, I just figured out the issue is that I need to run ant.bat instead of just ant. :( This isn't going to work because I wanted to run something that would be system independent. So I found the runant.py and I'm trying to figure out how to call it. I tried import runant but it can't find t

Re: Strange occasional marshal error

2011-03-03 Thread Graham Stratton
On Mar 3, 6:04 pm, Guido van Rossum wrote: > This bug report doesn't mention the Python version nor the platform -- > it could in theory be a bug in the platform compiler or memory > allocator. I've seen the problem with 2.6 and 2.7, on RHEL 4 (possibly with a custom kernel, I can't check at the

Re: subprocess running ant

2011-03-03 Thread Benjamin Kaplan
On Mar 3, 2011 1:19 PM, "Thom Hehl" wrote: > > I am attempting to write a python script that will check out and build our code, then deploy the executable. It will report any failures via e-mail. > > > > To this end, I’m trying to run my ant build from inside of python. I have tried the following:

Re: subprocess running ant

2011-03-03 Thread Chris Rebert
> From: MRAB > On 03/03/2011 18:14, Thom Hehl wrote: >> I am attempting to write a python script that will check out and build >> our code, then deploy the executable. It will report any failures via >> e-mail. >> >> To this end, I'm trying to run my ant build from inside of python. I >> have tried

Re: I'm happy with Python 2.5

2011-03-03 Thread Ian Kelly
On Sun, Feb 27, 2011 at 7:15 AM, n00m wrote: > http://www.spoj.pl/problems/TMUL/ > > Python's "print a * b" gets Time Limit Exceeded. If speed is the only thing you care about, then you can forget about fretting over whether 2.5 or 3.1 is faster. You're using the wrong language to begin with. --

Re: help with regex matching multiple %e

2011-03-03 Thread Matt Funk
Thanks, works great. matt On 3/3/2011 10:53 AM, MRAB wrote: > On 03/03/2011 17:33, maf...@nmsu.edu wrote: >> Hi, >> >> i have a line that looks something like: >> 2.234e+04 3.456e+02 7.234e+07 1.543e+04: some description >> >> I would like to extract all the numbers. From the python website i >>

Re: OT: Code Examples

2011-03-03 Thread Emile van Sebille
On 3/1/2011 3:59 PM Chris Jones said... On Tue, Mar 01, 2011 at 12:03:02PM EST, Emile van Sebille wrote: On 3/1/2011 12:43 AM Erik de Castro Lopo said... Why Python? For me? Because it's executable pseudocode Not for nothing, Emile.. hey.. you could end up with pseudo bugs and pseudo hea

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Terry Reedy
On 3/3/2011 10:39 AM, Jean-Paul Calderone wrote: C and C++ have standards, and the standards describe what they don't define. Python has implementations. Python also has standards, the language and library manuals. The defined behavior is whatever the implementation does. No, the defined

Re: 2to3 and maketrans

2011-03-03 Thread Dan Stromberg
On Wed, Mar 2, 2011 at 10:58 PM, Gregory Ewing wrote: > What is the recommended way to write code for 2.7 using > maketrans() on text strings in such a way that it will > convert correctly using 2to3? > > There seems to be two versions of maketrans in 3.x, one > for text and one for bytes. Code th

Re: Pure python standard library and License

2011-03-03 Thread Terry Reedy
On 3/3/2011 11:39 AM, Markus Schaber wrote: Hi, We want to include IronPython in one of our products, including the pure Python part of the python standard library. It seems that the IronPython installer packagers simply copied the pure python part of the standard library (the directory tree of

Communicating from Flash to Python

2011-03-03 Thread Victor Subervi
Hi; I have an AS3 script that is supposed to communicate with a python script and I don't think it is. The python script is to email. How can I trouble-shoot this? Beno -- http://mail.python.org/mailman/listinfo/python-list

RE: subprocess running ant

2011-03-03 Thread Nobody
On Thu, 03 Mar 2011 13:27:34 -0500, Thom Hehl wrote: > Actually, I just figured out the issue is that I need to run ant.bat > instead of just ant. :( Add shell=True to the Popen() call. -- http://mail.python.org/mailman/listinfo/python-list

question about endswith()

2011-03-03 Thread Matt Funk
Hi, i have a list of files, some of which end with .hdf and one of them end with hdf5. I want to filter the hdf5 file. Thereforei set extensions: hdf5 I try to filter as below: if (any(filename.endswith(x) for x in extensions)): The problem is that i let's all files though rather than just the hdf

Re: Communicating from Flash to Python

2011-03-03 Thread Corey Richardson
On 03/03/2011 05:01 PM, Victor Subervi wrote: > Hi; > I have an AS3 script that is supposed to communicate with a python script > and I don't think it is. The python script is to email. How does Flash communicate with Python? Only thing I found at all was Flash interfacing with a PHP script via a

Re: 2to3 and maketrans

2011-03-03 Thread Martin v. Loewis
Am 03.03.2011 07:58, schrieb Gregory Ewing: > What is the recommended way to write code for 2.7 using > maketrans() on text strings in such a way that it will > convert correctly using 2to3? That depends on how you chose to represent text in 2.7. The recommended way for that (also with 3.x in mind

Re: question about endswith()

2011-03-03 Thread Grant Edwards
On 2011-03-03, Matt Funk wrote: > i have a list of files, some of which end with .hdf and one of them end > with hdf5. I want to filter the hdf5 file. Thereforei set extensions: hdf5 > I try to filter as below: > if (any(filename.endswith(x) for x in extensions)): > > The problem is that i let's

Re: question about endswith()

2011-03-03 Thread Matt Funk
Hi Grant, first of all sorry for the many typos in my previous email. To clarify, I have a python list full of file names called 'files'. Every single filename has extension='.hdf' except for one file which has an '.hdf5' extension. When i do (and yes, this is pasted): for filename in file

Re: question about endswith()

2011-03-03 Thread Ethan Furman
Matt Funk wrote: Hi, i have a list of files, some of which end with .hdf and one of them end with hdf5. I want to filter the hdf5 file. Thereforei set extensions: hdf5 I try to filter as below: > -->if (any(filename.endswith(x) for x in extensions)): What is extensions? A string or a tuple?

Maximum post data length

2011-03-03 Thread Tim Johnson
I am currently using python 2.6. For years I have used my own cgilib module which in turn uses the stand python cgi library module. The implementation is : self.form = cgi.FieldStorage(keep_blank_values=1) I'm looking for an approach that would enable both client- and server-side validation with

making a class callable

2011-03-03 Thread dude
I've been struggling with getting my class to behave the way I want it. I have python module called ohYeah.py, defined as follows... #File Begin class foo: def __init__(self, arg1): print arg1 self.ohYeah = arg1 def whatwhat(self): return self.ohYeah #EOF My goal

Re: question about endswith()

2011-03-03 Thread Grant Edwards
On 2011-03-04, Matt Funk wrote: > Hi Grant, > first of all sorry for the many typos in my previous email. > > To clarify, I have a python list full of file names called 'files'. > Every single filename has extension='.hdf' except for one file which has > an '.hdf5' extension. When i do (and yes, t

Re: making a class callable

2011-03-03 Thread Santoso Wijaya
Are you missing an import? import ohYeah f = ohYeah.foo('wow') ... ~/santa On Thu, Mar 3, 2011 at 5:45 PM, dude wrote: > I've been struggling with getting my class to behave the way I want > it. > > I have python module called ohYeah.py, defined as follows... > #File Begin > class foo: > >

Re: making a class callable

2011-03-03 Thread MRAB
On 04/03/2011 01:45, dude wrote: I've been struggling with getting my class to behave the way I want it. I have python module called ohYeah.py, defined as follows... #File Begin class foo: def __init__(self, arg1): print arg1 self.ohYeah = arg1 def whatwhat(self):

Re: making a class callable

2011-03-03 Thread dude
On Mar 3, 6:07 pm, MRAB wrote: > On 04/03/2011 01:45, dude wrote: > > > > > I've been struggling with getting my class to behave the way I want > > it. > > > I have python module called ohYeah.py, defined as follows... > > #File Begin > > class foo: > > >      def __init__(self, arg1): > >        

Re: 2to3 and maketrans

2011-03-03 Thread Dan Stromberg
On Thu, Mar 3, 2011 at 3:46 PM, Martin v. Loewis wrote: > That depends on how you chose to represent text in 2.7. > The recommended way for that (also with 3.x in mind) > is that you should use Unicode strings to represent text. > For application programming, I'm sure Unicode is usually preferab

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Carl Banks
On Mar 3, 5:16 am, Neil Cerutti wrote: > On 2011-03-03, Tom Zych wrote: > > > Carl Banks wrote: > >> Perl works deterministically and reliably.  In fact, pretty much every > >> language works deterministically and reliably.  Total non-argument. > > > Well, yes. I think the real issue is, how many

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Carl Banks
On Mar 3, 7:12 pm, Carl Banks wrote: [snip] Accidental post before I was done. To complete the thought: I actually can think of one indeterminate behavior in C (although it's not certain whether this qualifies as interaction with the environment): int main(void) {     int a;     printf("%d\n",

Need an example program that implements rpm -pql via import rpm

2011-03-03 Thread Steven W. Orr
I look everywhere but I couldn't find anything. Could someone please point me to a small example program that does an import rpm, takes an rpm file as an argument and gets the list of files contained in the file, the same as if I had used the commandline rpm -pql foo-1.23-4.i586.rpm Much appr

Re: OT: Code Examples

2011-03-03 Thread Chris Jones
On Thu, Mar 03, 2011 at 02:29:54PM EST, Emile van Sebille wrote: > On 3/1/2011 3:59 PM Chris Jones said... >> On Tue, Mar 01, 2011 at 12:03:02PM EST, Emile van Sebille wrote: >>> On 3/1/2011 12:43 AM Erik de Castro Lopo said... >> Why Python? >>> >>> For me? Because it's executable pseudoco

Re: Need an example program that implements rpm -pql via import rpm

2011-03-03 Thread geremy condra
On Thu, Mar 3, 2011 at 7:24 PM, Steven W. Orr wrote: > I look everywhere but I couldn't find anything. Could someone please point > me to a small example program that does an import rpm, takes an rpm file as > an argument and gets the list of files contained in the file, the same as if > I had use

auto increment

2011-03-03 Thread monkeys paw
Does python have an analogy to c/perl incrementer? e.g. i = 0 i++ Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: auto increment

2011-03-03 Thread Chris Rebert
On Thu, Mar 3, 2011 at 8:41 PM, monkeys paw wrote: > Does python have an analogy to c/perl incrementer? > > e.g. > > i = 0 > i++ i += 1 If you're doing this for a list index, use enumerate() instead. Regards, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: auto increment

2011-03-03 Thread Dan Stromberg
On Thu, Mar 3, 2011 at 8:48 PM, Chris Rebert wrote: > On Thu, Mar 3, 2011 at 8:41 PM, monkeys paw wrote: > > Does python have an analogy to c/perl incrementer? > > > > e.g. > > > > i = 0 > > i++ > > i += 1 > > If you're doing this for a list index, use enumerate() instead. > There's been discus

Re: auto increment

2011-03-03 Thread Chris Rebert
On Thu, Mar 3, 2011 at 9:05 PM, Dan Stromberg wrote: > On Thu, Mar 3, 2011 at 8:48 PM, Chris Rebert wrote: >> On Thu, Mar 3, 2011 at 8:41 PM, monkeys paw wrote: >> > Does python have an analogy to c/perl incrementer? >> > >> > e.g. >> > >> > i = 0 >> > i++ >> >> i += 1 >> >> If you're doing this

Re: auto increment

2011-03-03 Thread Dan Stromberg
On Thu, Mar 3, 2011 at 9:07 PM, Chris Rebert wrote: > On Thu, Mar 3, 2011 at 9:05 PM, Dan Stromberg wrote: > > On Thu, Mar 3, 2011 at 8:48 PM, Chris Rebert wrote: > >> On Thu, Mar 3, 2011 at 8:41 PM, monkeys paw > wrote: > >> > Does python have an analogy to c/perl incrementer? > >> > > >> > e

Re: 2to3 and maketrans

2011-03-03 Thread Martin v. Löwis
Am 04.03.2011 03:21, schrieb Dan Stromberg: > > On Thu, Mar 3, 2011 at 3:46 PM, Martin v. Loewis > wrote: > > That depends on how you chose to represent text in 2.7. > The recommended way for that (also with 3.x in mind) > is that you should use Unicode str

Re: Communicating from Flash to Python

2011-03-03 Thread Godson Gera
You can use PyAMF http://pyamf.org On Fri, Mar 4, 2011 at 3:31 AM, Victor Subervi wrote: > Hi; > I have an AS3 script that is supposed to communicate with a python script > and I don't think it is. The python script is to email. How can I > trouble-shoot this? > Beno > > -- > http://mail.python.o

Re: question about endswith()

2011-03-03 Thread Rafael Durán Castañeda
I think you want do this: >>> files = ['file1.hdf', 'file2.hdf', 'file3.hdf5','file4.hdf'] >>> print(''.join(x for x in files if x.endswith('5'))) file3.hdf5 >>> But if you need to use it later: >>> file_hdf5 = [x for x in files if x.endswith('5')] >>> file_hdf5 ['file3.hdf5'] >>> 2011/3/4 Gra