Re: True == 1 weirdness

2015-09-23 Thread Michael Schwarz
On 2015-09-19, at 09:19, Gregory Ewing wrote: > Random832 wrote: >> I'm disputing that chained comparisons are used for the particular >> combinations that I am actually arguing should not be used in python. >> Such as a < b > c or a != b != c [whereas a may or may not be equal to >> c] > > I c

Byteorder of audioop functions

2013-11-18 Thread Michael Schwarz
Hi Is the byteorder (or endianness) of the functions in the audioop module somewhere specified or does anyone know how it behaves on different systems? On my little-endian system it matches the system's endianness: >>> import sys, audioop >>> sys.byteorder 'little' >>> audioop.lin2lin(b'\xff',

Re: Running code from source that includes extension modules

2013-10-02 Thread Michael Schwarz
On 2013-W40-3, at 21:15, Stefan Behnel wrote: > Michael Schwarz, 02.10.2013 17:38: >> I've just started looking into distutils because I need to write an >> extension module in C (for performance reasons) and distutils seems to be >> the most straight-forward wa

Re: Running code from source that includes extension modules

2013-10-02 Thread Michael Schwarz
On 2013-W40-3, at 19:15, "Gisle Vanem" wrote: > "Michael Schwarz" wrote: > >> So how do I run my code so it will find the built extension module? Do I >> pass the output directory on the command line manually or is there some >> other solution? I

Running code from source that includes extension modules

2013-10-02 Thread Michael Schwarz
Hi I've just started looking into distutils because I need to write an extension module in C (for performance reasons) and distutils seems to be the most straight-forward way. I've had success building a C file into a Python extension module using "python setup.py build" but I am wondering what t

Re: Is %z broken for return values of time.gmtime()?

2013-09-16 Thread Michael Schwarz
On 2013-W38-1, at 19:56, random...@fastmail.us wrote: > On Mon, Sep 16, 2013, at 9:15, Michael Schwarz wrote: >> According to the documentation of time.gmtime(), it returns a struct_time >> in UTC, but %z is replaced by +0100, which is the UTC offset of my OS’s >> time zone

Is %z broken for return values of time.gmtime()?

2013-09-16 Thread Michael Schwarz
I’m wondering whether this is expected: Python 3.3.2 (default, May 21 2013, 11:50:47) [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.strftime("%F %T %z", time.gmtime(40

Re: How to improve the usability of nested packages

2012-11-03 Thread Michael Schwarz
Hi Stefan On 2012-W44-5, at 19:23, Stefan H. Holek wrote: > That said, there are ways to avoid import cycles. One is to very carefully > craft your modules so they do not have to import from each other. Another is > to not have imports at the module level, but move them into the functions > wh

Re: How to improve the usability of nested packages

2012-11-03 Thread Michael Schwarz
Hi Terry On 2012-W44-5, at 18:56, Terry Reedy wrote: >> or would you maybe structure the library entirely different? > > Based on my limited experience with subpackages* plus reports on this list > about problems, such as yours, I have concluded that subpackages are an > attractive nuisance th

GoEar Mp3 download system

2009-04-25 Thread Carlos Schwarz Júnior
I developed an application using pyGTK to download the MP3 music that are hosted on GoEar http://www.goear.com/. It's not totally finished, but the main functions are working and some other interesting features too. It works well in Windows and Linux (not tested in MAC). To download: http://cod

Re: Python bytecode STORE_NAME

2008-11-19 Thread schwarz
On 19 Nov., 10:14, Peter Otten <[EMAIL PROTECTED]> wrote: > > Every code object has its own co_names attribute (a tuple). The arguments > are offsets into that tuple. > > Using Python 2.5 I can't reproduce your example, I get 0 offsets in both > cases. Here's a simpler one: > > >>> import dis > >>>

Python bytecode STORE_NAME

2008-11-18 Thread schwarz
As part of some research I am doing a Python Virtual Machine in Java, and the exact semantics of the STORE_NAME bytecode is unclear to be, so I was hoping somebody here could clarify it. The STORE_NAME bytecode is supposed to set a value for a name in the current scope. However, the following piece

_struct in Python 2.5.2

2008-02-24 Thread Olaf Schwarz
Hi, I am trying to run this application http://svn.navi.cx/misc/trunk/python/bemused/ on uNSLUng Linux 6.10 using the optware python packages. As I obtained segmentation faults using Python 2.4, I have upgraded to 2.5.2. Now the execution terminates a lot earlier with this error message: File

Re: Filename case-insensitivity on OS X

2006-01-03 Thread Doug Schwarz
File System". Use Disk Utility to create a disk image and then erase it (again, using Disk Utility) and put UFS on it. You'll find that "touch foo FOO" will create two files. -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list

Re: Some more odd behaviour from the Regexp library

2005-10-19 Thread Doug Schwarz
x27;exit: (.*?)', a) > In [4]: b.group(0) > Out[4]: 'exit: ' > > In [5]: b.group(1) > Out[5]: '' > > In [6]: b.group(2) > IndexError: no such group The ? tells (.*?) to match as little as possible and that is nothing. If you change it to (.*) it should

Re: Inline::Python, pyperl, etc.

2005-09-01 Thread Felix Schwarz
Eli Stevens (WG.c) wrote: > PyPerl 1.0.1 > http://wiki.python.org/moin/PyPerl > > The interest in these projects seems to have died off about 2001, > however. That, or they simply haven't needed to be updated for the last > few Python versions. > > I've bumped into some snags with pyperl (can

Re: authentication project

2005-08-10 Thread Felix Schwarz
Hi, for some of the "ground work" you could use the Python Web Modules (www.pythonweb.org). fs -- http://mail.python.org/mailman/listinfo/python-list

regex question

2005-06-25 Thread Felix Schwarz
Hi all, I'm experiencing problems with a regular expression and I can't figure out which words I use when googling. I read the python documentation for the re module multiple times now but still no idea what I'm doing wrong. What I want to do: - Extract all digits (\d) in a string. - Digits are

Re: Favorite non-python language trick?

2005-06-24 Thread Doug Schwarz
> dash. This is much nicer than in C or Python having to get rid of """ or > > /* and */. Of course, the IDE can compensate. But it's still neat :) > > python: > > """ > print 10 > """ > > and > > #"

Re: Regex for repeated character?

2005-06-17 Thread Doug Schwarz
does? In other words, I want a > pattern like this: > > >>> re.findall(".+", "foo") # not what I want > ['foo'] > >>> re.findall("something", "foo") # what I want > ['f', 'oo'] How's this?

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Doug Schwarz
iven by f(n+1) = f(n) * 2^(1/12) so by the time you go all 12 notes in an octave you have doubled the frequency. There is nothing here involving base 12 or pi. -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list

Re: String Splitter Brain Teaser

2005-03-28 Thread Doug Schwarz
, ['T'], ['A', 'G']] How about this? import re s = "ATT/GATA/G" result1 = re.findall(r"./.|.", s) consensus = [c.split("/") for c in result1] -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list

Re: String Splitter Brain Teaser

2005-03-28 Thread Doug Schwarz
, ['T'], ['A', 'G']] How about this? import re s = "ATT/GATA/G" result1 = re.findall(r"./.|.", s) consensus = [c.split("/") for c in result1] -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list

Re: String Splitter Brain Teaser

2005-03-27 Thread Doug Schwarz
, ['T'], ['A', 'G']] How about this? import re s = "ATT/GATA/G" result1 = re.findall(r"./.|.", s) consensus = [c.split("/") for c in result1] -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list

Re: programmatically calling a function

2005-03-05 Thread Doug Schwarz
In article <[EMAIL PROTECTED]>, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: > Doug Schwarz wrote: > > > Dave, > > > > I think eval might be what you're looking for: > > > > f = eval('len') > > length = f([1,2,3]) >

Re: programmatically calling a function

2005-03-05 Thread Doug Schwarz
nt 'bar' > > > i'd really appreciate any help the 'group' has to offer. > > > thanks > dave Dave, I think eval might be what you're looking for: f = eval('len') length = f([1,2,3]) By the way, are you the Dave Ekhaus I used to work with at Kodak? -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list