libsndfile-python : python wrapper for libsndfile

2010-10-26 Thread ./ed
Hi all,

I am pleased to announce a release of a python wrapper for
libsndfile.

This is a re-installment of a previous version from Rob Melby
(arcsin.org) with a numpy support.

This a early beta release that worked fine for years using numpy and
mostly intended for scientific applications. However I am not
confident for non-macosx release.

In addition libsndfile does not allow bundle building so the mpkg
ships with its custom build of libsndfile.

Consequently the source package should only works on Unixes.

It is implied but libsndfile is needed : http://www.mega-nerd.com/libsndfile/

Please visit https://code.google.com/p/libsndfile-python/ for package
information and
https://code.google.com/p/libsndfile-python/downloads/list for
available downloads.

Help and feedback is really appreciated!

Best,
./Ed





-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


PyCon 2011 Reminder: Call for Proposals, Posters and Tutorials - us.pycon.org

2010-10-26 Thread Jesse Noller
PyCon 2011 Reminder: Call for Proposals, Posters and Tutorials - us.pycon.org
===

Well, it's October 25th! The leaves have turned and the deadline for submitting
main-conference talk proposals expires in 7 days (November 1st, 2010)!

We are currently accepting main conference talk proposals:
http://us.pycon.org/2011/speaker/proposals/

Tutorial Proposals:
http://us.pycon.org/2011/speaker/proposals/tutorials/

Poster Proposals:
http://us.pycon.org/2011/speaker/posters/cfp/

PyCon 2011 will be held March 9th through the 17th, 2011 in Atlanta, Georgia.
(Home of some of the best southern food you can possibly find on Earth!) The
PyCon conference days will be March 11-13, preceded by two tutorial days
(March 9-10), and followed by four days of development sprints (March 14-17).

We are also proud to announce that we have booked our first Keynote
speaker - Hilary Mason, her bio:

Hilary is the lead scientist at bit.ly, where she is finding sense in vast
data sets. She is a former computer science professor with a background in
machine learning and data mining, has published numerous academic papers, and
regularly releases code on her personal site, http://www.hilarymason.com/.
She has discovered two new species, loves to bake cookies, and asks way too
many questions.

We're really looking forward to having her this year as a keynote speaker!

Remember, we've also added an Extreme talk track this year - no introduction,
no fluff - only the pure technical meat!

For more information on Extreme Talks see:

http://us.pycon.org/2011/speaker/extreme/

We look forward to seeing you in Atlanta!

Please also note - registration for PyCon 2011 will also be capped at a
maximum of 1,500 delegates, including speakers. When registration opens (soon),
you're going to want to make sure you register early! Speakers with accepted
talks will have a guaranteed slot.

We have published all registration prices online at:
http://us.pycon.org/2011/tickets/

Important Dates
November 1st, 2010: Talk proposals due.
December 15th, 2010: Acceptance emails sent.
January 19th, 2011: Early bird registration closes.
March 9-10th, 2011: Tutorial days at PyCon.
March 11-13th, 2011: PyCon main conference.
March 14-17th, 2011: PyCon sprints days.
Contact Emails:

Van Lindberg (Conference Chair) - v...@python.org
Jesse Noller (Co-Chair) - jnol...@python.org
PyCon Organizers list: pycon-organiz...@python.org
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Django course in Leipzig, Germany, Nov. 29 - Dec. 1, 2010 (in German)

2010-10-26 Thread Mike Müller

The course will be taught in German. Therefore, the
announcement is also in German.


Kurs: Django Python-Web-Framework
=


Kurzinfo


Vom 29.11. bis zum 01.12.2010 findet ein Kurs zu Django[1] mit dem Trainer
Markus Zapke-Gründemann[2] an der Python Academy in Leipzig statt.

Weitere Informationen:
http://www.python-academy.de/Kurse/django_kurs.html

Gleich zur Anmeldung:
http://www.python-academy.de/Kurse/termine.html


Zielgruppe
--

Der Kurs richtet sich sowohl an Neueinsteiger als auch an Programmierer,
die schon erste Erfahrungen mit Django[1] gesammelt haben.

Sie sollten Erfahrungen in einer objektorientierten Programmiersprache
haben. Dabei sind Kenntnisse in Python gut, aber für den Anfang nicht
zwingend notwendig. Außerdem sollten sie mit der Entwicklung von
Webapplikationen in Verbindung mit Datenbanken vertraut sein.


Inhalt
--

Nach einer Einführung in die Grundlagen des Web Application Frameworks
Django wird jeder Teilnehmer Django selbst installieren. Danach beginnt
die Entwicklung einer ersten, einfachen Applikation.

Bei der folgenden Weiterentwicklung der Applikation wird das Wissen
über die benutzen Komponenten weiter vertieft.

- Einsatz von Werkzeugen zur Softwareentwicklung
- Datenbankabstraktion (Object Relational Mapper)
- Komplexe Models
- Einbindung bestehender Datenbanken
- Nutzung von mehreren Datenbanken
- Export und Import von Daten (via JSON)
- Arbeit mit dem ORM an der Kommandozeile
- Anpassung des Admin Backends
- Generische Views
- Eigene Template Tags und Filter
- Formulare und Validierung
- Sessionverwaltung
- Authentifizierung
- RSS Feed
- PDF Erzeugung
- Funktionale und Unit Tests

Weitere Themen gerne auf Anfrage, zum Beispiel:

- AJAX
- RESTful Webservice
- Authentifizierung über andere Dienste
- Internationalization
- Security
- Caching
- Deployment
- Migration


Referent


Markus Zapke-Gründemann[2] kann auf neun Jahre Erfahrung in der
Softwareentwicklung zurückblicken und arbeitet seit fast zwei Jahren
als selbständiger Softwareentwickler, Consultant und Trainer.
Schwerpunkt seiner Arbeit ist die Entwicklung von Web Applikationen
für Intra- und Internet mit verschiedenen Frameworks.


Kursmaterialien
---

Jeder Teilnehmer erhält ausführliche Kursunterlagen mit ausformulierten
Beschreibungen der Kursinhalte und eine CD mit allen verwendeten
Quelltexten und genutzter Software.


[1] http://www.djangoproject.com
[2] http://www.keimlink.de
--
http://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


Pogo 0.2

2010-10-26 Thread Jendrik Seipp
I am proud to announce the first release of Pogo, probably the simplest 
and fastest audio player for Linux.


You can get the tarball and an Ubuntu deb package at
http://launchpad.net/pogo


What is Pogo?

Pogo plays your music. Nothing else. It tries to be fast and 
easy-to-use. Pogo's elementary-inspired design uses the screen-space 
very efficiently. It is especially well-suited for people who organize 
their music by albums on the harddrive. The main interface components 
are a directory tree and a playlist that groups albums in an innovative way.
Pogo is a fork of Decibel Audio Player. Supported file formats include 
Ogg Vorbis, MP3, FLAC, Musepack, Wavpack, and MPEG-4 AAC.

Pogo is written in Python and uses GTK and gstreamer.


What's new in
0.2 I hold the candle while you dance upon the flame (2010-10-21)

* Make startup even faster by saving the playlist with its formatting
* Make track drag'n'drop faster by caching the tracks
* MPRIS support: Send DBus messages about play events (code from decibel)
* Do some profiling to improve general speed
* Append files added on commandline (pogo mytrack.mp3 myalbum 
myothertrack.mp3)

* Append files added from nautilus right-click menu
* Correctly add multiply nested directories
* Activate the Covers and Notifications modules by default
* Hide volume button (Only duplicates functionality of the Sound Indicator)
* Updated Translations

Cheers,
Jendrik





--
http://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Lawrence D'Oliveiro
In message mailman.208.1287970911.2218.python-l...@python.org, MRAB wrote:

 On 25/10/2010 02:19, Lawrence D'Oliveiro wrote:

 In messagemailman.187.1287916654.2218.python-l...@python.org, Dave
 Angel wrote:

 No. GUI programs are marked as win-app, so w stands for Windows. Non
 GUI programs run in the console.

 You mean “GUI console”. So non-GUI apps get a GUI element whether they
 want it or not, while GUI ones don’t. That’s completely backwards.
 
 No, it's not. The fact that the console is also a GUI window is an
 implementation detail ...

It is not an implementation detail. It is intrinsic to the way Windows 
works. No other OS does it backwards like this.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Lawrence D'Oliveiro
In message mailman.216.1287980107.2218.python-l...@python.org, Steve 
Holden wrote:

 and, in fact, the console is only a GUI window in a windowed system. It
 might be one of the console emulation windows that init starts under
 linux, or even a terminal connected to a computer by a serila line, for
 heavens sake.

But now you’re no longer talking about Windows. Windows is the only one that 
gets it backwards like this, forcing the creation of GUI elements for non-
GUI-based programs, and not for GUI-based ones.

More reasonably-designed systems, such as you describe above, make no such 
distinction between “GUI” and “non-GUI” programs. There is no difference 
based on the name of your executable, how it is built, or what libraries it 
links to; the only difference is in its run-time behaviour, whether it 
invokes any GUI functions or not.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread Jorgen Grahn
On Mon, 2010-10-25, bruno.desthuilli...@gmail.com wrote:
 On 25 oct, 15:34, Alex Willmer a...@moreati.org.uk wrote:
 On Oct 25, 11:07 am, kj no.em...@please.post wrote:

  In The Zen of Python, one of the maxims is flat is better than
  nested?  Why?  Can anyone give me a concrete example that illustrates
  this point?

 I take this as a reference to the layout of the Python standard
 library and other packages i.e. it's better to have a module hierarchy
 of depth 1 or 2 and many top level items, than a depth of 5+ and only
 a few top level items.

 (snip)

 This also applies to inheritance hierarchies (which tend to be rather
 flat in Python compared to most mainstreams OOPLs), as well as nested
 classes etc.

Which mainstream languages are you thinking of?  Java?  Because C++ is
as flat as Python.

/Jorgen

-- 
  // Jorgen Grahn grahn@  Oo  o.   .  .
\X/ snipabacken.se   O  o   .
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Steve Holden
On 10/26/2010 2:08 AM, Lawrence D'Oliveiro wrote:
 In message mailman.208.1287970911.2218.python-l...@python.org, MRAB wrote:
 
 On 25/10/2010 02:19, Lawrence D'Oliveiro wrote:

 In messagemailman.187.1287916654.2218.python-l...@python.org, Dave
 Angel wrote:

 No. GUI programs are marked as win-app, so w stands for Windows. Non
 GUI programs run in the console.

 You mean “GUI console”. So non-GUI apps get a GUI element whether they
 want it or not, while GUI ones don’t. That’s completely backwards.

 No, it's not. The fact that the console is also a GUI window is an
 implementation detail ...
 
 It is not an implementation detail. It is intrinsic to the way Windows 
 works. No other OS does it backwards like this.

I really don't understand what you are trying to say here. Could you
please explain? I know you to be a capable and sensible person, but this
sounds like nonsense to me, so I must be misunderstanding.

regards
 Steve

-- 
Steve Holden   +1 571 484 6266   +1 800 494 3119
PyCon 2011 Atlanta March 9-17   http://us.pycon.org/
See Python Video!   http://python.mirocommunity.org/
Holden Web LLC http://www.holdenweb.com/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help Need in running a Python Program from terminal

2010-10-26 Thread Raji
Greetings Philip !

  File openastro.py, line 90, in module
 TRANSLATION[LANGUAGES[i]] =
  gettext.translation(openastro,TDomain,languages=['en'])
   File /usr/lib/python2.6/gettext.py, line 484, in translation
 raise IOError(ENOENT, 'No translation file found for domain', domain)
  IOError: [Errno 2] No translation file found for domain: 'openastro'

 Hi Raji,
 Did you have a look at the documentation for the call that's failing?

 Here's the doc for gettext.translation():
 http://docs.python.org/library/gettext.html#gettext.translation

 I don't know anything about gettext or openastro, but the doc says, If no
 .mo file is found, this function raises IOError... which is the problem
 you're having. It seems like what you downloaded is expecting to find a .mo
 file but can't. You might want to check the package instructions on
 openastro.org to make sure there's not more you need to do to install it.


You are right.

The .mo file is present in  /openastro.org-1.1.23.orig/locale/en/LC_MESSAGES

But it cant find it.

Thanks for the information

Im looking towards to correct the error

-- 
Regards

Raji

http://sraji.wordpress.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread Carl Banks
On Oct 25, 11:20 pm, Jorgen Grahn grahn+n...@snipabacken.se wrote:
 On Mon, 2010-10-25, bruno.desthuilli...@gmail.com wrote:
  On 25 oct, 15:34, Alex Willmer a...@moreati.org.uk wrote:
  On Oct 25, 11:07 am, kj no.em...@please.post wrote:

   In The Zen of Python, one of the maxims is flat is better than
   nested?  Why?  Can anyone give me a concrete example that illustrates
   this point?

  I take this as a reference to the layout of the Python standard
  library and other packages i.e. it's better to have a module hierarchy
  of depth 1 or 2 and many top level items, than a depth of 5+ and only
  a few top level items.

  (snip)

  This also applies to inheritance hierarchies (which tend to be rather
  flat in Python compared to most mainstreams OOPLs), as well as nested
  classes etc.

 Which mainstream languages are you thinking of?  Java?  Because C++ is
 as flat as Python.

Not in my experience.  The only way to get dynamic polymorphism (as
opposed to the static polymorphism you get with templates) in C++ is
to use inheritance, so when you have a class library in C++ you tend
to get hierarchies where classes with all kinds of abstract base
classes so that types can be polymorphic.  In Python you don't need
abstract base classes so libraries tend to be flatter, only inheriting
when behavior is shared.

However it's not really that big of a difference.


Carl Banks

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Descriptors and decorators

2010-10-26 Thread bruno.desthuilli...@gmail.com
On 25 oct, 17:18, Joost Molenaar j.j.molen...@gmail.com wrote:
 Thanks, Bruno.
 Your python-wiki page and walk-through for the Decorator code make it
 clear. I now finally understand that methods are in fact ordinary
 functions at the time the class is created, and that the descriptor
 protocol turns them into bound or unbound methods when they're
 accessed as attributes:
(snip)
 Cheers! Now I will try to wrap my brain around metaclasses and coroutines. ;-)

Metaclasses are nothing special, really. Python classes are plain
objects and you can as well instanciate a class directly - the class
statement being mostly syntactic sugar:

def func(obj, x):
obj.x = x

NewClass = type(NewClass, (object,), {'__init__':func, 'foo':lambda
z: z.x + 2})

So in the end, a metaclass is just another plain class, that is used
to instanciate class objects.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python3: Is this a bug in urllib?

2010-10-26 Thread Justin Ezequiel
'''
C:\Documents and Settings\Administrator\Desktoppython wtf.py
301 Moved Permanently
b'HTMLHEADmeta http-equiv=content-type content=text/
html;charset=utf-8
\nTITLE301 Moved/TITLE/HEADBODY\nH1301 Moved/H1\nThe
document has mo
ved\nA HREF=http://www.google.de/;here/A.\r\n/BODY/HTML\r\n'
foo 5.328 secs
301 Moved Permanently
bar 241.016 secs

C:\Documents and Settings\Administrator\Desktop
'''
import http.client
import time

def foo():
c = http.client.HTTPConnection('google.de')
try:
c.request('GET', '/')
r = c.getresponse()
try:
print(r.status, r.reason)
x = r.read()
finally: r.close()
finally: c.close()
print(x)

def bar():
c = http.client.HTTPConnection('google.de')
try:
c.request('GET', '/')
r = c.getresponse()
try:
print(r.status, r.reason)
x = r.fp.read()
finally: r.fp.close()
finally: c.close()

s = time.time()
foo()
e = time.time()
print('foo %.3f secs' % (e-s,))

s = time.time()
bar()
e = time.time()
print('bar %.3f secs' % (e-s,))

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: downcasting problem

2010-10-26 Thread Hrvoje Niksic
John Nagle na...@animats.com writes:

 On 10/25/2010 7:38 AM, Tim Chase wrote:
 While a dirty hack for which I'd tend to smack anybody who used it...you
 *can* assign to instance.__class__

That's an implementation detail of CPython.  May not work in
 IronPython, Unladen Swallow, PyPy, or Shed Skin.

 (An implementation with a JIT has to trap stores into some
 internal variables and invalidate the generated code.
 This adds considerable complexity to the virtual machine.
 Java JVMs, for example, don't have to support that.)

A Python implementation probably looks up attributes via type late at
runtime anyway, so modifying __class__ boils down to changing a
reference inside the (moral equivalent of the) PyObject structure.

For example, assigning to __class__ appears to work just fine in Jython
2.5.2:

Jython 2.5.2rc2 (Release_2_5_2rc2:7167, Oct 24 2010, 22:48:30) 
[OpenJDK 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_18
Type help, copyright, credits or license for more information.
 class X(object):
...   pass
... 
 class Y(X): pass
... 
 x = X()
 x.__class__ = Y
 x
__main__.Y object at 0x3
-- 
http://mail.python.org/mailman/listinfo/python-list


is list comprehension necessary?

2010-10-26 Thread Xah Lee
recently wrote a article based on a debate here. (can't find the
original thread on Google at the moment)

• 〈What's List Comprehension and Why is it Harmful?〉
http://xahlee.org/comp/list_comprehension.html

it hit reddit.
http://www.reddit.com/r/programming/comments/dw8op/whats_list_comprehension_and_why_is_it_harmful/

though, i don't find the argument there informative.

For python, i can understand that it might be preferred, due to the
special syntax, being more in sync with python because of the
imperative hints in keywords. (e.g. those “for”, “if” in it.) But for
more pure functional lang (e.g. haskell), i think lc is pretty bad.

here's the plain text version of my essay

What's List Comprehension and Why is it Harmful?

Xah Lee, 2010-10-14

This page explains what is List Comprehension, with examples from
several languages, with my opinion on why the jargon and concept of
“list comprehension” are unnecessary, and harmful to functional
programing.
What is List Comprehension?

Here's a example of List Comprehension (LC) in python:

S = [2*n for n in range(0,9) if ( (n % 2) == 0)]
print S
# prints [0, 4, 8, 12, 16]

It generates a list from 0 to 9 by 「range(0,9)」, then remove the odd
numbers by 「( (n % 2) == 0)」, then multiply each element by 2 in
「2*n」, then returns a list.

Python's LC syntax has this form:

[myExpression for myVar in myList if myPredicateExpression]

In summary, it is a special syntax for generating a list, and allows
programers to also filter and apply a function to the list, but all
done using expressions.

In functional notation, list comprehension is doing this:

map( f, filter(list, predicate))

Other languages's LC are similiar. Here are some examples from
Wikipedia. In the following, the filter used is 「x^2  3」, and the
「2*x」 is applied to the result.
Haskell

s = [ 2*x | x - [0..], x^2  3 ]

F#

seq { for x in 0..100 do if x*x  3 then yield 2*x } ;;

OCaml

[? 2 * x | x - 0 -- max_int ; x * x  3 ?];;

Clojure

(take 20 (for [x (iterate inc 0) :when ( (* x x) 3)] (* 2 x)))

Common Lisp

(loop for x from 1 to 20 when ( (* x x) 3) collect (* 2 x))

Erlang

S = [2*X || X - lists:seq(0,100), X*X  3].

Scala

val s = for (x - Stream.from(0); if x*x  3) yield 2*x

Here's how Wikipedia explains List comprehension. Quote:

A list comprehension is a syntactic construct available in some
programming languages for creating a list based on existing lists.

The following features makes up LC:

* (1) A flat list generator, with the ability to do filtering and
applying a function.
* (2) A special syntax in the language.
* (3) The syntax uses expressions, not functions.

Why is List Comprehension Harmful?

• List Comprehension is a opaque jargon; It hampers communication, and
encourage mis-understanding.

• List Comprehension is a redundant concept in programing. It is a
very simple list generator. It can be easily expressed in existing
functional form 「map(func, filter(list, predicate))」 or imperative
form e.g. perl: 「for (0..9) { if ( ($_ % 2) == 0) {push @result,
$_*2 }}」.

• The special syntax of List Comprehension as it exists in many langs,
are not necessary. If a special purpose function is preferred, then it
can simply be a plain function, e.g 「LC(function, list, predicate)」.
Map + Filter = List Comprehension Semantics

The LC's semantics is not necessary. A better way and more in sync
with functional lang spirit, is simply to combine plain functions:

map( f, filter(list, predicate))

Here's the python syntax:

map(lambda x: 2*x , filter( lambda x:x%2==0, range(9) ) )
# result is [0, 4, 8, 12, 16]

In Mathematica, this can be written as:

Map[ #*2 , select[ra...@9, EvenQ]]

In Mathematica, arithemetic operations can be applied to list
directely without using Map explicitly, so the above can be written
as:

select[ra...@9, EvenQ] * 2

in my coding style, i usually write it in the following syntactically
equivalent forms:

(#*2 ) @ (Select[#, EvenQ]) @ Range @ 9

or

9 // Range  // (Select[#, EvenQ])  // (#*2 )

In the above, we sequence functions together, as in unix pipe. We
start with 9, then apply “Range” to it to get a list from 1 to 9, then
apply a function that filters out odd numbers, then we apply a
function to multiply each number by 2. The “//” sign is a postfix
notation, analogous to bash's “|”, and �...@” is a prefix notation that's
the reverse of “|”.

(See: Short Intro of Mathematica For Lisp Programers.)
List Comprehension Function Without Special Syntax

Suppose we want some “list comprehension” feature in a functional
lang. Normally, by default this can be done by

 map(func, filter(inputList, Predicate))

but perhaps this usage is so frequent that we want to create a new
function for it, to make it more convenient, and perhaps easier to
make the compiler to optimize more. e.g.

 LC(func, inputList, Predicate)

this is about whether a lang should create a new convenient function
that otherwise require 3 function 

Re: time difference interms of day

2010-10-26 Thread M.-A. Lemburg
Steve Holden wrote:
 On 10/24/2010 1:55 PM, mukkera harsha wrote:
 Hello 
   I was wondering if there is an existing function that would let me 
 determine the difference in time. To explain: 

 Upon starting a program: 

 startup = time.time() 

 After some very long processing: 
 now = time.time() 


 On, doing now - startup I want the program to return in terms of days. How ?


 Thanks,

 Harsha.

 You'd probably be better off using the datetime module. That way you can
 store datetime.datetime.now() at the start of your run and subtract
 datetime.datetime.now() at the end, giving you a datetime.delta object
 which contains days, seconds and microseconds:
 
 import datetime
 t1 = datetime.datetime.now()
 [waited a while]
 t2 = datetime.datetime.now()
 t2-t1
 datetime.timedelta(0, 16, 509000)


Or using mxDateTime:

 from mx import DateTime
 start = DateTime.now()
 stop = DateTime.now()
 print stop - start
00:00:04.26

http://www.egenix.com/products/python/mxBase/mxDateTime/

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Oct 26 2010)
 Python/Zope Consulting and Support ...http://www.egenix.com/
 mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
 mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try our new mxODBC.Connect Python Database Interface for free ! 


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Martin Gregorie
On Tue, 26 Oct 2010 02:38:43 -0400, Steve Holden wrote:

 
 I really don't understand what you are trying to say here. Could you
 please explain? I know you to be a capable and sensible person, but this
 sounds like nonsense to me, so I must be misunderstanding.

I think he's saying that on a Linux desktop, if you define a launcher for 
an application the default assumption is that its a graphical 
application. If so, all you need to do is to tell the launcher the 
program name, what icon to use and what text to put under it. If the 
application isn't graphical, you do the same as above and also tell the 
launcher that the program must run in a console window. Simple. Logical. 
Concise.

I assume that what I've just described applies to OS X and virtually all 
other graphical desktops: I wouldn't know from personal experience 
because I don't use them.
  

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org   |
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread kj
In mailman.241.1288036400.2218.python-l...@python.org Terry Reedy 
tjre...@udel.edu writes:

On 10/25/2010 3:11 PM, kj wrote:

 Well, it's pretty *enshrined*, wouldn't you say?

No.

   After all, it is part of the standard distribution,

So is 'import antigravity'

Are you playing with my feelings?

% python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
 import antigravity
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: No module named antigravity

Too bad, I was looking forward to that.

  has an easy-to-remember invocation,
 etc.  *Someone* must have taken it seriously enough to go through
 all this bother.  If it is as trivial as you suggest (and for all
 I know you're absolutely right), then let's knock it off its pedestal
 once and for all, and remove it from the standard distribution.

If you are being serious, you are being too serious (as in humorless).

Guilty as charged, both in the too serious and the humorless
counts. :/  Blame it on the Asperger's.

My only defense is that, while learning Python over the past year,
I've had *many* you've got to be joking moments while reading
what's ostensible serious Python documents (e.g. PEP 8, PEP 257)
as well as assorted threads featuring GvR and others involved in
the design of Python, to the point that sometimes I do have a hard
time gauging the seriousness of what's considered good programming
/ best practice in the Python world.

Plus, I think it's fair to say that the Python community as a whole
(or at least its more vocal members) are more concerned with
correctness (for lack of a better term) and code aesthetics
than, say, the Perl community.  E.g., only in Python-related threads
I've seen the adjective icky used routinely to indicate that some
code is unacceptable on (more or less) aesthetic grounds.

My point is that, even if one detects some levity in ZoP, given
everything else one runs into in the Python world, for the uninitiated
like me it is still hard to distinguish between what's in jest and
what's in earnest.

Perhaps the disconnect here is that you're seeing the whole thing
from an insider's point of view, while I'm still enough of an
outsider not to share this point of view.  (I happen to think that
one the hallmarks of being an initiate to a discipline is an almost
complete loss of any memory of what that discipline looked like
when the person was a complete novice.  If this is true, then it's
easy to understand the difference in our perceptions.)

Anyway, thanks for letting me in on the joke.  I'll pass it on.

(Though, humorless as it is of me, I still would prefer the ZoP
out of the standard library, to save myself having to tell those
who are even newer to Python than me not to take it seriously.)

~kj
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Inconsistent results from int(floatNumber)

2010-10-26 Thread gershar
On Oct 25, 5:44 pm, gershar gerrys...@gmail.com wrote:
 I had some problems with some Python projects that gave variable
 results that I could not track down. Eventually and reluctantly I
 converted them to Java. Later, when I had more time I tried to analyze
 what the Python code was doing and found something strange. The
 following snippet illustrates the problem.

  i = -50.0
  for x in xrange(5):

         i += 0.1
         z = i * 10.0
         print
         print z
         print int(z)

 -499.0
 -499

 -498.0
 -498

 -497.0
 -496

 -496.0
 -495

 -495.0
 -494

 The first two iterations look OK but after that the int(z) function
 returns the wrong value. It looks like the value was rounded down.  If
 a just do this: int(-497.0)

 -497
 I get the value I expect.
 So what is the problem?

 It looks like a rounding problem but on the surface there is nothing
 to round. I am aware that there are rounding limitations with floating
 point arithmetic but the value passed to int() is always correct. What
 would cause it to be off by 1 full digit in only some cases? Perhaps
 something behind the scenes in the bowels of the interpreter ?.

 I could not get the thing to fail without being inside the for loop;
 does that have something to do with it?

 To fix the problem I could use round() or math.floor().  Like this.

  i = -50.0
  for x in xrange(5):

         i += 0.1
         z = i * 10.0
         print
         print z
         print(round(z))

 -499.0
 -499.0

 -498.0
 -498.0

 -497.0
 -497.0

 -496.0
 -496.0

 -495.0
 -495.0

 Why should I have to do this?

 Is there a general rule of thumb to know when this could be a problem?

 Should any float-to-int conversion be suspect?

 The above code was run in Python 2.5.4 on WinXP and Python 2.6.2 on
 Linux(Fedora12)
 Can anyone verify if this would be the same on 3.x?

Good responses from this group!
Thanks for the insight

Regards
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread Benjamin Kaplan
On Tue, Oct 26, 2010 at 9:05 AM, kj no.em...@please.post wrote:
 In mailman.241.1288036400.2218.python-l...@python.org Terry Reedy 
 tjre...@udel.edu writes:

On 10/25/2010 3:11 PM, kj wrote:

 Well, it's pretty *enshrined*, wouldn't you say?

No.

   After all, it is part of the standard distribution,

So is 'import antigravity'

 Are you playing with my feelings?

 % python
 Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
 [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
 import antigravity
 Traceback (most recent call last):
  File stdin, line 1, in module
 ImportError: No module named antigravity

 Too bad, I was looking forward to that.


Try it in Python 3.

  has an easy-to-remember invocation,
 etc.  *Someone* must have taken it seriously enough to go through
 all this bother.  If it is as trivial as you suggest (and for all
 I know you're absolutely right), then let's knock it off its pedestal
 once and for all, and remove it from the standard distribution.

If you are being serious, you are being too serious (as in humorless).

 Guilty as charged, both in the too serious and the humorless
 counts. :/  Blame it on the Asperger's.

 My only defense is that, while learning Python over the past year,
 I've had *many* you've got to be joking moments while reading
 what's ostensible serious Python documents (e.g. PEP 8, PEP 257)
 as well as assorted threads featuring GvR and others involved in
 the design of Python, to the point that sometimes I do have a hard
 time gauging the seriousness of what's considered good programming
 / best practice in the Python world.


This is a programming language named after a British comedy group (not
the snake). There are going to be jokes inserted in lots of otherwise
serious things. Like the standard library.


 http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Generating PDF file in Python

2010-10-26 Thread Ed Keith
I need to generate PDF files and I'm exploring what tools to use. I was planing 
on using ReportLab, but recently found some references to pango 
(http://www.pango.org/) and ciaro (http://cairographics.org/) being able to 
generate PDF files. But am having difficulty finding details.

The program must be cross platform, it needs to run on both windows and Mac and 
might need to run on Linux in the future. It needs to generate both reports and 
tables and I would like to make the layout as user configurable as practical. 

Can pango - ciaro do  this. How do they compare to ReportLab? Are there other 
options I have overlooked?

 -EdK

Ed Keith
e_...@yahoo.com

Blog: edkeith.blogspot.com



  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread Seebs
On 2010-10-26, kj no.em...@please.post wrote:
 (Though, humorless as it is of me, I still would prefer the ZoP
 out of the standard library, to save myself having to tell those
 who are even newer to Python than me not to take it seriously.)

Well, not to take it *too* seriously.

It's like any other Zen -- it's wonderful as long as you take it about
the right amount seriously.  If someone could tell you how seriously
that is, it wouldn't be Zen.

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nos...@seebs.net
http://www.seebs.net/log/ -- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) -- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: minimal D: need software testers

2010-10-26 Thread Aahz
[posted  e-mailed]

In article 43bd55e3-e924-40b5-a157-b57ac8544...@f25g2000yqc.googlegroups.com,
Kruptein  darragh@gmail.com wrote:

I've released the second alpha for minimal-D a program I've written in
python which should make developing easier.
I need people to test the app on bugs and give ideas.

You should probably explain what minimal-D is, I'm certainly not going to
look at something when I have no clue.
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur.  --Red Adair
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Introducing Kids to Programming: 2 or 3?

2010-10-26 Thread Aahz
[posted  e-mailed]

[chiming in late]

In article mailman.1095.1285602516.29448.python-l...@python.org,
Marco Gallotta  ma...@gallotta.co.za wrote:

I'm sure you get a lot of 2 or 3 questions, but here's another.
Umonya [1] uses Python to introduce school kids to programming. The
initiative is only 15 months old and up till now we've been using
existing notes and exercises and thus Python 2. But we're at the stage
where we can either stick with 2 for the next few years, or go to 3
now.

We received a grant from Google to reach 1,000 kids in South Africa
with our course in 2011. People have also shown interest in running
the course in Croatia, Poland and Egypt. We're also eyeing developing
African countries in the long-term. As such, we're taking the time now
to write our very own specialised course notes and exercises, and we
this is why we need to decide *now* which path to take: 2 or 3? As we
will be translating the notes we'll probably stick with out choice for
the next few years.

One reason not otherwise mentioned is that overall Unicode support is
better in Python 3, and given your international audience, that's a
strong point in favor of Python 3.
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur.  --Red Adair
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread Steve Holden
On 10/26/2010 9:05 AM, kj wrote:
 Perhaps the disconnect here is that you're seeing the whole thing
 from an insider's point of view, while I'm still enough of an
 outsider not to share this point of view.  (I happen to think that
 one the hallmarks of being an initiate to a discipline is an almost
 complete loss of any memory of what that discipline looked like
 when the person was a complete novice.  If this is true, then it's
 easy to understand the difference in our perceptions.)
 
That can be true of most technical communities, and Python is no
exception. As someone who does quite a lot of training the challenge is
always to hold on to those outsider perceptions to avoid the learners
feeling lost.

 Anyway, thanks for letting me in on the joke.  I'll pass it on.
 
 (Though, humorless as it is of me, I still would prefer the ZoP
 out of the standard library, to save myself having to tell those
 who are even newer to Python than me not to take it seriously.)

The answer is probably the same as you will see if you try

  from __future__ import braces

That feature *is* available in Python 2.6 ;-)

regards
 Steve
-- 
Steve Holden   +1 571 484 6266   +1 800 494 3119
PyCon 2011 Atlanta March 9-17   http://us.pycon.org/
See Python Video!   http://python.mirocommunity.org/
Holden Web LLC http://www.holdenweb.com/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Grant Edwards
On 2010-10-26, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
 In message mailman.216.1287980107.2218.python-l...@python.org, Steve 
 Holden wrote:

 and, in fact, the console is only a GUI window in a windowed system. It
 might be one of the console emulation windows that init starts under
 linux, or even a terminal connected to a computer by a serila line, for
 heavens sake.

 But now you're no longer talking about Windows. Windows is the only
 one that gets it backwards like this, forcing the creation of GUI
 elements for non- GUI-based programs,

I've been following this entire thread, and I'm afraid I have no clue
at all waht you mean by that last phrase forcing the creation of GUI
elements for non-GUI-based programs.

 and not for GUI-based ones.

In Windows the default for python applications is that they run in a
console session with stdin/stdout/stderr attached to a terminal
emulator.  The application itself may or may not create GUI windows on
its own -- that's independent of whether it's attached to a terminal
emulator or not.

 More reasonably-designed systems, such as you describe above, make no
 such distinction between GUI and non-GUI programs.

Sure they do.  When you create a launcher item or menu item in most
desktops, there's a setting that says whether you want the program run
in a terminal window or not.  That's exactly the same thing you're
controlling under Windows when you set the filename to .py or .pyw.

 There is no difference based on the name of your executable, how it
 is built, or what libraries it links to; the only difference is in
 its run-time behaviour, whether it invokes any GUI functions or not.

No, we're not talking about whether apps invoke GUI functions or not.
That's completely orthogonal to the issue at hand.  We're talking
about whether desktop manager should run the program with
stdin/stdout/stderr connected to /dev/null or connected to a terminal
emulator.

The windows desktop determines that (like it determines other things)
by looking at the filename.  Other desktops generally have that
information associated with the icon/button/menu-entry, not with the
executable's filename.

-- 
Grant Edwards   grant.b.edwardsYow! And then we could sit
  at   on the hoods of cars at
  gmail.comstop lights!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: PyGUI 2.3

2010-10-26 Thread Daniel Fetchinson
 PyGUI 2.3 is available:

http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/

 This version works on Snow Leopard with PyObjC 2.3.

Any reason your project is not easy_installable?

Cheers,
Daniel


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread Robin Becker

On 26/10/2010 15:42, Steve Holden wrote:

he answer is probably the same as you will see if you try

   from __future__ import braces

That feature*is*  available in Python 2.6;-)

In the past I used to think it was really cool that one could do

from __future__ import exciting_and_cool_new_stuff


now I really wish we had

from __past__ import old_and_boring_syntax_26

etc etc
-trapped on level five-ly yrs-
Robin Becker

--
http://mail.python.org/mailman/listinfo/python-list


Re: Generating PDF file in Python

2010-10-26 Thread Gary Herron

On 10/26/2010 06:18 AM, Ed Keith wrote:

I need to generate PDF files and I'm exploring what tools to use. I was planing 
on using ReportLab, but recently found some references to pango 
(http://www.pango.org/) and ciaro (http://cairographics.org/) being able to 
generate PDF files. But am having difficulty finding details.

The program must be cross platform, it needs to run on both windows and Mac and 
might need to run on Linux in the future. It needs to generate both reports and 
tables and I would like to make the layout as user configurable as practical.

Can pango - ciaro do  this. How do they compare to ReportLab? Are there other 
options I have overlooked?

  -EdK

Ed Keith
e_...@yahoo.com

Blog: edkeith.blogspot.com






Try a package named reportlab.  It's very comprehensive, opensource, 
written in Python and is cross-platform:


http://www.reportlab.com/software/opensource/


Here's the Ubuntu Description:

ReportLab library to create PDF documents using Python

ReportLab is a library that lets you directly create documents in
Adobe's Portable Document Format (PDF) using the Python programming 
language.


ReportLab library creates PDF based on graphics commands without
intervening steps. It's therefore extremely fast, and flexible (since
you're using a full-blown programming language).

Sample use cases are:
  * Dynamic PDF generation on the web
  * High-volume corporate reporting and database publishing
  * As embeddable print engine for other applications, including a
'report language' so that users can customize their own reports.
  * As 'build system' for complex documents with charts, tables and text
such as management accounts, statistical reports and scientific papers
  * from XML to PDF in one step


Luck,
Gary Herron

--
http://mail.python.org/mailman/listinfo/python-list


Re: Generating PDF file in Python

2010-10-26 Thread D'Arcy J.M. Cain
On Tue, 26 Oct 2010 08:38:45 -0700
Gary Herron gher...@islandtraining.com wrote:
 On 10/26/2010 06:18 AM, Ed Keith wrote:
 I was planing on using ReportLab, but recently found some references to 
 pango Try a package named reportlab.  It's very comprehensive, opensource, 

On the other hand, there is always reportlab.

-- 
D'Arcy J.M. Cain da...@druid.net |  Democracy is three wolves
http://www.druid.net/darcy/|  and a sheep voting on
+1 416 425 1212 (DoD#0082)(eNTP)   |  what's for dinner.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is list comprehension necessary?

2010-10-26 Thread John Nagle

On 10/26/2010 2:31 AM, Xah Lee wrote:

recently wrote a article based on a debate here. (can't find the
original thread on Google at the moment)

• 〈What's List Comprehension and Why is it Harmful?〉
http://xahlee.org/comp/list_comprehension.html

it hit reddit.
http://www.reddit.com/r/programming/comments/dw8op/whats_list_comprehension_and_why_is_it_harmful/

though, i don't find the argument there informative.

For python, i can understand that it might be preferred, due to the
special syntax, being more in sync with python because of the
imperative hints in keywords. (e.g. those “for”, “if” in it.) But for
more pure functional lang (e.g. haskell), i think lc is pretty bad.


   That's from the functional programming crowd.

   Python isn't a functional language.  It has some minimal
functional capabilities, and there's a lobby that would like
more.  So far, that's mostly been resisted.  Attempts to allow
multiline lambdas have been averted.  The weird functional if
syntax additions were a cave-in to the functional crowd, and may
have been a mistake.

John Nagle
--
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode questions

2010-10-26 Thread John Nagle

On 10/19/2010 12:02 PM, Tobiah wrote:

I've been reading about the Unicode today.
I'm only vaguely understanding what it is
and how it works.

Please correct my understanding where it is lacking.


http://justfuckinggoogleit.com/
--
http://mail.python.org/mailman/listinfo/python-list


Re: HTMLParser not parsing whole html file

2010-10-26 Thread John Nagle

On 10/24/2010 11:44 PM, Stefan Behnel wrote:

josh logan, 25.10.2010 04:14:

I found the error. The HTML file I'm parsing has invalid HTML at line
193. It has something like:

a href=mystuff class = stuff

Note there is no space between the closing quote for the href tag
and the class attribute. I guess I'll go through each file and correct
these issues as I parse them.


HTMLparser is not made to deal with non-HTML input. You can take a look
at lxml.html or BeautifulSoup (up to 3.0), which handle these problems a
lot better.

Stefan


   You might try HTML5lib:

http://code.google.com/p/html5lib/

The HTML 5 spec formalizes the concept of bad HTML.  Really. There's
a specified way to parse the most common HTML errors.  Most browsers
are far more tolerant of bad HTML than they should be, and not in a
consistent way.  The HTML 5 spec tries to fix that.

   I use BeautifulSoup, but it's being abandoned for the Python 3
transition.
http://www.crummy.com/software/BeautifulSoup/3.1-problems.html;

John Nagle

--
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread John Nagle

On 10/25/2010 6:34 AM, Alex Willmer wrote:

On Oct 25, 11:07 am, kjno.em...@please.post  wrote:

In The Zen of Python, one of the maxims is flat is better than
nested?  Why?  Can anyone give me a concrete example that illustrates
this point?


I take this as a reference to the layout of the Python standard
library and other packages i.e. it's better to have a module hierarchy
of depth 1 or 2 and many top level items, than a depth of 5+ and only
a few top level items.

For instance

import re2
import sqlite3
import logging

import something_thirdparty

vs

import java.util.regex
import java.sql
import java.util.logging


  As in

Python 2: import urllib 
Python 3: import urllib.request, urllib.parse, urllib.error

http://diveintopython3.org/porting-code-to-python-3-with-2to3.html

John Nagle
--
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode questions

2010-10-26 Thread Steve Holden
On 10/26/2010 12:32 PM, John Nagle wrote:
 On 10/19/2010 12:02 PM, Tobiah wrote:
 I've been reading about the Unicode today.
 I'm only vaguely understanding what it is
 and how it works.

 Please correct my understanding where it is lacking.
 
 http://justfuckinggoogleit.com/

Neither friendly nor helpful, John. Silence might have been more
productive: feeling crabby today?

regards Steve
-- 
Steve Holden   +1 571 484 6266   +1 800 494 3119
PyCon 2011 Atlanta March 9-17   http://us.pycon.org/
See Python Video!   http://python.mirocommunity.org/
Holden Web LLC http://www.holdenweb.com/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is list comprehension necessary?

2010-10-26 Thread Andre Alexander Bell
Hello,

I occasionally use LCs, if they seem useful. However, what I don't like
about LCs is that they 'look-like' being a closed scope, while actually
they are in the scope of there call. Example:

 i = 5
 l = [i**2 for i in range(3)]
 i
2

Regards


Andre
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is list comprehension necessary?

2010-10-26 Thread Paul Rudin
Andre Alexander Bell p...@andre-bell.de writes:

 I occasionally use LCs, if they seem useful. However, what I don't like
 about LCs is that they 'look-like' being a closed scope, while actually
 they are in the scope of there call. Example:

 i = 5
 l = [i**2 for i in range(3)]
 i
 2


Although:

p...@sleeper-service:~$ python3
Python 3.1.2 (r312:79147, Sep 27 2010, 09:57:50) 
[GCC 4.4.3] on linux2
Type help, copyright, credits or license for more information.
 i = 5
 l = [i**2 for i in range(3)]
 i
5
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is list comprehension necessary?

2010-10-26 Thread Ian Kelly
On Tue, Oct 26, 2010 at 11:07 AM, Andre Alexander Bell
p...@andre-bell.dewrote:

 Hello,

 I occasionally use LCs, if they seem useful. However, what I don't like
 about LCs is that they 'look-like' being a closed scope, while actually
 they are in the scope of there call. Example:

  i = 5
  l = [i**2 for i in range(3)]
  i
 2


This has been corrected in Python 3.
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: is list comprehension necessary?

2010-10-26 Thread Mikael B




 
 That's from the functional programming crowd.
 
 Python isn't a functional language.  


A noob question: what is a functional language?  What does it meen?
  -- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Nobody
On Tue, 26 Oct 2010 14:44:11 +, Grant Edwards wrote:

 There is no difference based on the name of your executable, how it
 is built, or what libraries it links to; the only difference is in
 its run-time behaviour, whether it invokes any GUI functions or not.
 
 No, we're not talking about whether apps invoke GUI functions or not.
 That's completely orthogonal to the issue at hand.  We're talking
 about whether desktop manager should run the program with
 stdin/stdout/stderr connected to /dev/null or connected to a terminal
 emulator.
 
 The windows desktop determines that (like it determines other things)
 by looking at the filename.  Other desktops generally have that
 information associated with the icon/button/menu-entry, not with the
 executable's filename.

Windows executables contain an embedded type field which distinguishes
between GUI and console executables (as well as those for the POSIX
subsystem, native executables, etc).

python.exe is a console executable, pythonw.exe is a GUI executable. Hence
python.exe automatically gets a console window, while pythonw.exe doesn't.
That's the whole reason why Windows has separate python.exe and
pythonw.exe programs, while Unix can use a single /usr/bin/python program
for both GUI and console usage.

The Windows approach makes it easier to Do The Right Thing automatically,
but it's a nuisance if you have a program which doesn't really fit into
either of the console or GUI pigeonholes.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread Albert Hopkins
On Tue, 2010-10-26 at 09:45 -0700, John Nagle wrote:
 On 10/25/2010 6:34 AM, Alex Willmer wrote:
  On Oct 25, 11:07 am, kjno.em...@please.post  wrote:
  In The Zen of Python, one of the maxims is flat is better than
  nested?  Why?  Can anyone give me a concrete example that illustrates
  this point?
 
  I take this as a reference to the layout of the Python standard
  library and other packages i.e. it's better to have a module hierarchy
  of depth 1 or 2 and many top level items, than a depth of 5+ and only
  a few top level items.
 
  For instance
 
  import re2
  import sqlite3
  import logging
 
  import something_thirdparty
 
  vs
 
  import java.util.regex
  import java.sql
  import java.util.logging
 
As in
 
   Python 2: import urllib 
   Python 3: import urllib.request, urllib.parse, urllib.error
 
 http://diveintopython3.org/porting-code-to-python-3-with-2to3.html
 

My favorite is always:

from django.contrib.auth.models import User # I know, not std lib

-- 
http://mail.python.org/mailman/listinfo/python-list


Unittest: how to pass information to TestCase classes?

2010-10-26 Thread AK

Hi, I have a question about unittest: let's say I create a temp dir for
my tests, then use loadTestsFromNames() to load my tests from packages
and modules they're in, then use TextTestRunner.run() to run the tests,
how can I pass information to TestCase instances, e.g. the location of
the temp dir I created?

The dir has to be created just once, before any tests run, and then
multiple packages and multiple modules in them are imported and run.

Thanks! -ak
--
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread kj
In mailman.258.1288104186.2218.python-l...@python.org Steve Holden 
st...@holdenweb.com writes:

The answer is probably the same as you will see if you try

  from __future__ import braces

That feature *is* available in Python 2.6 ;-)

Now, that's hilarious.

kj
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pyqt4 Table Widget deleting c/c++ object

2010-10-26 Thread Andrew
On Oct 19, 2:29 pm, David Boddie da...@boddie.org.uk wrote:
 On Monday 18 October 2010 23:26, Andrew wrote:

  I have two issues dealing with the table widget, though they may be
  interconnected. I'm not sure. Both delete the cell widgets off of my
  table but leave the rows, and then when I have the table update, it
  complains the c++ object has been deleted.

  # self.tableData.setCellWidget(rowCount, 0, trackItem)
  # RuntimeError: underlying C/C++ object has been deleted

 This is because you pass your widgets to this method and later ask
 the table to clear the contents of the table. When it does so, it
 deletes the underlying widgets, leaving only Python wrappers.

 The documentation mentions that the table takes ownership of the
 widget:

 http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qtablewidg...


I had read that, but I did not fully understand what that actually was
supposed to mean. like a 'Ok it has ownership, good for it?' I hadn't
run into such a problem before either in any form. Now I know.


  I have a list of a custom widget class that keeps track of several
  directories. Each class gets put into a row on the table. I have a set
  of radio buttons that will show me different views of the data: All,
  New, Done, Errors, Warnings.
  When I switch views, I clear my table, set the row count to 0, and
  then add back in only the widgets I want to see.

  Error 1:
  I load in the data initially, and then repopulate the table, and then
  re-size the window, instantly all listed rows are cleared, but the
  rows stay. This only happened on the diagonal re-size (bottom left
  corner); not the up and down, or side to side re-size. Attempting to
  repopulate the table, resulted in: underlying C/C++ object has been
  deleted. Though it will put in the correct number of rows required.

  Everything worked fine as long as I did not re-size the window.

 This may only be a symptom of the behaviour and not a guarantee that
 the code was working correctly up until the point when the resize
 occurred.

  Error 2:
  I load in the data initially, and then repopulate the table, the table
  clears and then nothing happens. No error messages or even visible
  rows. After several more repopulates it with either crash or tell me:
  underlying C/C++ object has been deleted.

  I had error 1 two days ago, then without changing the code, I now get
  error 2. I do not have to re-size the window for it to break now.

 I recommend that you create a list of non-widget data structures in
 your parsePath() method and create widgets on the fly in your addToTable()
 method. If you need to retain information when you repopulate the table
 then update the data structures that correspond to the widgets just before
 you clear the table.

 David

Thanks, it does work now that I've split it into a data and widget
class and create the widgets on the fly. Thanks for the help and sorry
for the delayed response.

Andrew
-- 
http://mail.python.org/mailman/listinfo/python-list


Schengen States free EDUCATION STUDY VISA

2010-10-26 Thread neha shena
Schengen States free  EDUCATION STUDY VISA

http://childschooledu.blogspot.com/2010/10/get-internship-in-united-states.html

The European Union (EU) allows for the free movement of goods between
Italy and other member states: Austria, Belgium, Bulgaria, Cyprus,
Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece,
Hungary, Ireland, Latvia, Lithuania, Luxembourg, Malta, Netherlands,
Poland, Portugal, Romania, Slovakia, Slovenia, Sweden, and United
Kingdom.


Bank Loan Online and Small Business Finance in the US

http://lifeplaan.blogspot.com/2010/09/bank-loan-online-and-small-business.html

A bank loan online generally refers to funding provided by a bank that
can be accessed through an online application. Online applications
usually only take a few minutes to complete and are analyzed by the
bank within a couple of days. Bank loans typically do not require as
many documents as a small business loan, but banks may require
applicants to provide personal financial statements and credit
histories along with the purpose of the loaned funds.
 more read

http://lifeplaan.blogspot.com/2010/09/bank-loan-online-and-small-business.html


-- 
http://mail.python.org/mailman/listinfo/python-list


Schengen States free EDUCATION STUDY VISA

2010-10-26 Thread neha shena
Schengen States free  EDUCATION STUDY VISA

http://childschooledu.blogspot.com/2010/10/get-internship-in-united-states.html

The European Union (EU) allows for the free movement of goods between
Italy and other member states: Austria, Belgium, Bulgaria, Cyprus,
Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece,
Hungary, Ireland, Latvia, Lithuania, Luxembourg, Malta, Netherlands,
Poland, Portugal, Romania, Slovakia, Slovenia, Sweden, and United
Kingdom.


Bank Loan Online and Small Business Finance in the US

http://lifeplaan.blogspot.com/2010/09/bank-loan-online-and-small-business.html

A bank loan online generally refers to funding provided by a bank that
can be accessed through an online application. Online applications
usually only take a few minutes to complete and are analyzed by the
bank within a couple of days. Bank loans typically do not require as
many documents as a small business loan, but banks may require
applicants to provide personal financial statements and credit
histories along with the purpose of the loaned funds.
 more read

http://lifeplaan.blogspot.com/2010/09/bank-loan-online-and-small-business.html


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: PyGUI 2.3

2010-10-26 Thread Terry Reedy

On 10/26/2010 10:54 AM, Daniel Fetchinson wrote:

PyGUI 2.3 is available:

http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/

This version works on Snow Leopard with PyObjC 2.3.


I suspect that Python 2.3 or later is required. should read
Python 2.3 to Python 2.7 is required.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


How i can get data from an image

2010-10-26 Thread Kechagias Apostolos
Hello there.
I ve been using python a lot lately for my school in order to make small
gui(wxpython) apps.
Today a teacher came up with an interesting project.
The idea is that he gives you a series of photos with some objects inside.
For example a photo could contain two black circles in a white background.
The question is how can i find a circle in a given image?
When i find the circles how can i draw a line between them in order to
create a connection?

I know that this may need pattern recognition.

What i want you to tell me is what things i will need in order to make this
thing possible with python.

My idea is to use use PIL in order to find the circles in the image.
Then i will import this image to wxpython canvas and i will draw a line
between their centers.
Is that possible?

I really need some help here.
-- 
http://mail.python.org/mailman/listinfo/python-list


How i can get data from an image

2010-10-26 Thread Kechagias Apostolos
Hello there.
I ve been using python a lot lately for my school in order to make small
gui(wxpython) apps.
Today a teacher came up with an interesting project.
The idea is that he gives you a series of photos with some objects inside.
For example a photo could contain two black circles in a white background.
The question is how can i find a circle in a given image?
When i find the circles how can i draw a line between them in order to
create a connection?

I know that this may need pattern recognition.

What i want you to tell me is what things i will need in order to make this
thing possible with python.

My idea is to use use PIL in order to find the circles in the image.
Then i will import this image to wxpython canvas and i will draw a line
between their centers.
Is that possible?

I really need some help here.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread Ian

On 26/10/2010 14:18, Benjamin Kaplan wrote:

This is a programming language named after a British comedy group (not
the snake). There are going to be jokes inserted in lots of otherwise
serious things. Like the standard library.

Please, lets NOT get a newsgroup cross feed!

I don't want spam, spam, spam, python and spam in my inbox. :)

Ian


--
http://mail.python.org/mailman/listinfo/python-list


Re: is list comprehension necessary?

2010-10-26 Thread Andre Alexander Bell
On 10/26/2010 07:22 PM, Ian Kelly wrote:
  i = 5
  l = [i**2 for i in range(3)]
  i
 2
 
 
 This has been corrected in Python 3.

Sorry. You're right. I forgot to mention that...


Andre
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is list comprehension necessary?

2010-10-26 Thread Chris Rebert
On 10/26/10, Mikael B mba...@live.se wrote:
 That's from the functional programming crowd.

 Python isn't a functional language.

 A noob question: what is a functional language?  What does it meen?

A language which supports the functional programming paradigm:
http://en.wikipedia.org/wiki/Functional_programming

Google+Wikipedia are your friends as always.

Cheers,
Chris
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How i can get data from an image

2010-10-26 Thread Krister Svanlund
You should check out OpenCV.

On Tue, Oct 26, 2010 at 8:53 PM, Kechagias Apostolos
pasxal.an...@gmail.com wrote:
 Hello there.
 I ve been using python a lot lately for my school in order to make small
 gui(wxpython) apps.
 Today a teacher came up with an interesting project.
 The idea is that he gives you a series of photos with some objects inside.
 For example a photo could contain two black circles in a white background.
 The question is how can i find a circle in a given image?
 When i find the circles how can i draw a line between them in order to
 create a connection?
 I know that this may need pattern recognition.
 What i want you to tell me is what things i will need in order to make this
 thing possible with python.
 My idea is to use use PIL in order to find the circles in the image.
 Then i will import this image to wxpython canvas and i will draw a line
 between their centers.
 Is that possible?
 I really need some help here.
 --
 http://mail.python.org/mailman/listinfo/python-list


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is list comprehension necessary?

2010-10-26 Thread Dan Stromberg
On Tue, Oct 26, 2010 at 10:31 AM, Mikael B mba...@live.se wrote:




 
  That's from the functional programming crowd.
 
  Python isn't a functional language.


 A noob question: what is a functional language?  What does it meen?

 --
 http://mail.python.org/mailman/listinfo/python-list


It's a language where executing a program is equivalent to evaluating a
function - so things that are usually statements, like if statements, are
expressions that return a value.

Pure functional languages have functions with no side effects, at least, not
unless a monad (side effect detected by the type system in this case)
catches it somehow.

The coolest thing about pure functional languages, is you can give them a
debugger that allows you to step backward in time.  They're also very
parallelisable in theory, because they yield programs with little to no
shared, mutable state - which is important given that multicore is catching
on so fast.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unittest: how to pass information to TestCase classes?

2010-10-26 Thread Ben Finney
AK andrei@gmail.com writes:

 Hi, I have a question about unittest: let's say I create a temp dir
 for my tests, then use loadTestsFromNames() to load my tests from
 packages and modules they're in, then use TextTestRunner.run() to run
 the tests, how can I pass information to TestCase instances, e.g. the
 location of the temp dir I created?

Have it available from outside the TestCase child classes. Either as a
module-level global, or imported from some other module.

-- 
 \   Moriarty: “Forty thousand million billion dollars? That money |
  `\must be worth a fortune!” —The Goon Show, _The Sale of |
_o__)   Manhattan_ |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why flat is better than nested?

2010-10-26 Thread Steve Holden
On 10/26/2010 2:44 PM, kj wrote:
 In mailman.258.1288104186.2218.python-l...@python.org Steve Holden 
 st...@holdenweb.com writes:
 
 The answer is probably the same as you will see if you try
 
  from __future__ import braces
 
 That feature *is* available in Python 2.6 ;-)
 
 Now, that's hilarious.
 
See, there *is* a place for humor :)

regards
 Steve
-- 
Steve Holden   +1 571 484 6266   +1 800 494 3119
PyCon 2011 Atlanta March 9-17   http://us.pycon.org/
See Python Video!   http://python.mirocommunity.org/
Holden Web LLC http://www.holdenweb.com/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unittest: how to pass information to TestCase classes?

2010-10-26 Thread Steve Holden
On 10/26/2010 2:46 PM, AK wrote:
 Hi, I have a question about unittest: let's say I create a temp dir for
 my tests, then use loadTestsFromNames() to load my tests from packages
 and modules they're in, then use TextTestRunner.run() to run the tests,
 how can I pass information to TestCase instances, e.g. the location of
 the temp dir I created?
 
 The dir has to be created just once, before any tests run, and then
 multiple packages and multiple modules in them are imported and run.
 
In which case a class variable would seem to be the appropriate mechanism.

regards
 Steve
-- 
Steve Holden   +1 571 484 6266   +1 800 494 3119
PyCon 2011 Atlanta March 9-17   http://us.pycon.org/
See Python Video!   http://python.mirocommunity.org/
Holden Web LLC http://www.holdenweb.com/

-- 
http://mail.python.org/mailman/listinfo/python-list


High(er) level frameworks that wrap Tkinter/ttk?

2010-10-26 Thread python
Curious if there are any higher level frameworks that attempt to
wrap Tkinter? For example, wxPython is wrapped by the Dabo
framework (http://dabodev.com/) and PythonCard.

Motivation: We've recently moved to Python 2.7 (Windows) and are
very impressed with the new ttk (Tile) support which allows one
to build professional quality, platform native GUI's using the
built-in Tkinter framework. In the past we would have used
wxPython to create simple GUI interfaces for our command line
utilities, but we're re-thinking this strategy in favor of using
Tkinter/ttk for these use cases.

Thanks,
Malcolm
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Lawrence D'Oliveiro
In message pan.2010.10.26.17.38.14.766...@nowhere.com, Nobody wrote:

 python.exe is a console executable, pythonw.exe is a GUI executable. Hence
 python.exe automatically gets a console window, while pythonw.exe doesn't.
 That's the whole reason why Windows has separate python.exe and
 pythonw.exe programs, while Unix can use a single /usr/bin/python program
 for both GUI and console usage.
 
 The Windows approach makes it easier to Do The Right Thing automatically
 ...

Except it provides no easy way to capture the contents of that “console”, 
for when you’re trying to track down problems, because it disappears as soon 
as the program exits.

It would be a stretch indeed to call this “doing the right thing”, 
automatically or otherwise.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python library for mail/news message headers bodies?

2010-10-26 Thread Arthur Divot
Chris Rebert wrote:

 On Mon, Oct 25, 2010 at 7:18 PM, Arthur Divot art...@example.com wrote:
  Is there a python library equivalent to Perl's News::Article
  (load a file containing a news or mail message into an
  object, manipulate the headers and body, create a new empty
  one, save one to a file)?
 
 The `email` package in the std lib?:
 http://docs.python.org/library/email.html

That's just what I need. Thanks.

 The Global Module Index is your friend:
 http://docs.python.org/modindex.html

Yes it is!

-- 
http://mail.python.org/mailman/listinfo/python-list


Python 2.7 or 3.1

2010-10-26 Thread Braden Faulkner

Which is better for a beginner to get started in Python with?
Thanks!   -- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Lawrence D'Oliveiro
In message mailman.265.1288113240.2218.python-l...@python.org, Dennis Lee 
Bieber wrote:

 (The Amiga made it simple -- a shell invocation received a non-zero
 argc, with command line parameters in argv; a clicked invocation
 received argc of 0, and argv pointed to a structure containing the
 information from the associated .info file [Workbench only displayed
 icons from .info files, unlike Windows displaying everything]).

Why would you want both CLI and GUI functions in one program? The *nix 
philosophy is that a program should do one thing, and do it well.

That means a command-line tool should concentrate on being a good command-
line tool. For users who want to access that functionality through a GUI, 
you build a GUI front end which makes use of that tool, and possibly others 
as well, at the back end.

That way, you end up with a minimum of complexity and duplication of 
functionality, and a maximum of flexibility and power.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Nobody
On Wed, 27 Oct 2010 13:46:28 +1300, Lawrence D'Oliveiro wrote:

 Why would you want both CLI and GUI functions in one program?

An obvious example was the one which was being discussed, i.e. the Python
interpreter. Depending upon the script, it may need to behave as a
command-line utility (read argv, do stuff, exit), a terminal-based
interactive program, a GUI program, a network server, or whatever.

Forcing a program to choose between the two means that we need both
python.exe and pythonw.exe.

A less obvious example is a program designed to use whatever interface
facilities are available. E.g. XEmacs can use either a terminal or a GUI
or both.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.7 or 3.1

2010-10-26 Thread Christian Heimes
Am 27.10.2010 02:16, schrieb Braden Faulkner:
 
 Which is better for a beginner to get started in Python with?
 Thanks! 

It depends on your needs. Most 3rd party library haven't been ported to
Python 3 yet. You'll get more useful stuff with 2.7 or even 2.6. For now
most Linux distributions have Python 2.6. With some care you can write
your app with Python 2 and automatically port it to Python 3 with the
2to3 tool.

Christian

-- 
http://mail.python.org/mailman/listinfo/python-list


Interaction btw unittest.assertRaises and __getattr__. Bug?

2010-10-26 Thread Inyeol
Unittest assertRaises cannot handle exception raised inside
__getattr__ method. Is it a bug? or am I missing something obvious?

Here is a sample of this problem:

-
import unittest

class C():

def simple_attr(self):
raise AttributeError

def __getattr__(self, name):
raise AttributeError

class Test(unittest.TestCase):

def test_simple_attr(self):
c = C()
self.assertRaises(AttributeError, c.simple_attr)

def test_getattr(self):
c = C()
self.assertRaises(AttributeError, c.foo)

unittest.main()
-

Unittest assertRaises handles simple attribute lookup but the
exception inside __getattr__ bypasses unittest and generates
traceback:
--
E.
==
ERROR: test_getattr (__main__.Test)
--
Traceback (most recent call last):
  File xxx.py, line 19, in test_getattr
self.assertRaises(AttributeError, c.foo)
  File xxx.py, line 9, in __getattr__
raise AttributeError
AttributeError

--
Ran 2 tests in 0.000s

FAILED (errors=1)
--


It doesn't matter what kind of exception it raises. Any exception
inside __getattr__ bypasses assertRaises.
This happens both with 3.1.2 and 2.6.5. Any idea?

Inyeol


-- 
http://mail.python.org/mailman/listinfo/python-list


Trouble with importing

2010-10-26 Thread Ben
In brief summary, I have installed gnuradio [gnuradio.org] and the
gen2_rfid module [https://www.cgran.org/wiki/Gen2] on Ubuntu 10.04,
with all installed packages up to date as of a few days ago.

When I try to run the rfid reader/decoder script, I get the following
error:


b...@sdrfid:~/gen2_rfid/trunk/src/app$ sudo nice -n 20 ./
reader_decoder.py
Traceback (most recent call last):
  File ./reader_decoder.py, line 3, in module
from gnuradio import gr, gru, rfid

It is the rfid module that is causing the problem.  The strange
thing is that

b...@sdrfid:~/gen2_rfid/trunk/src/app$ python -c from gnuradio import
rfid

works fine (at least, it doesn't say anything, which I take to be a
good sign), but

b...@sdrfid:~/gen2_rfid/trunk/src/app$ sudo python -c from gnuradio
import rfid
Traceback (most recent call last):
  File string, line 1, in module
ImportError: cannot import name rfid

Causes an error.

sudo echo $PYTHONPATH yields the same result as echo $PYTHONPATH so I
don't think it's an issue of path.

Can anyone suggest something that might be causing this problem?

Ben
-- 
http://mail.python.org/mailman/listinfo/python-list


Can 32-bit and 64-bit Python coexist in the same computer?

2010-10-26 Thread Andy
Hi guys!

I got a new laptop computer which came with the 64-bit version of
Windows 7.  I installed the 64-bit versions of Python and a few other
libraries and wrote a few Python programs right there.  If I copy the
Python scripts to a 32-bit computer, it runs flawlessly.  But in the
future I may still need to distribute my compiled programs to people
who use 32-bit Windows and it seems that neither PyInstaller nor
py2exe can cross compile a 32-bit application from this 64-bit
computer.

So ugly as it sounds, I'm considering installing in parallel the 32-
bit version of Python on this same computer.  Is there anything I need
to know or a better way to achieve this instead of having a double
Python installation?

By the way, I use Python 2.6, so it would be [Python 2.6.x 32-bit] and
[Python 2.6.x 64-bit] on the same computer.

Thanks!
Andy
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.7 or 3.1

2010-10-26 Thread Christian Heimes
Am 27.10.2010 03:38, schrieb Jorge Biquez:
 And what about if I only were to develop for the web? I mean web 
 applications, Mysql, etc? It would be better to still be in 2.7?

Most frameworks and database adapters at least target Python 2.6+ as
their main Python version. I guess the majority has no or only
experimental support for Python 3.1. The overall situation improves
every week.

Christian

PS: I recommend against MySQL, if you need the full power or a RDBMS.
Just try to combine foreign keys with database triggers and you'll see
which major features are still broken in MySQL. But that's just my point
of view as a power user.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How i can get data from an image

2010-10-26 Thread John Nagle

On 10/26/2010 1:46 PM, Krister Svanlund wrote:

You should check out OpenCV.


   Yes. See

http://code.google.com/p/pyopencv/

Note the people detector example.

John Nagle
--
http://mail.python.org/mailman/listinfo/python-list


Re: Trouble with importing

2010-10-26 Thread Jerry Hill
On Tue, Oct 26, 2010 at 5:24 PM, Ben bahr...@gmail.com wrote:
 b...@sdrfid:~/gen2_rfid/trunk/src/app$ python -c from gnuradio import
 rfid

 works fine (at least, it doesn't say anything, which I take to be a
 good sign), but

 b...@sdrfid:~/gen2_rfid/trunk/src/app$ sudo python -c from gnuradio
 import rfid
 Traceback (most recent call last):
  File string, line 1, in module
 ImportError: cannot import name rfid

What are the permissions on the gnuradio package and the rfid module?
Do you see anything interesting if you run python with -v or -vv?
Like this:
sudo python -v -c from gnuradio import rfid

-- 
Jerry
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Interaction btw unittest.assertRaises and __getattr__. Bug?

2010-10-26 Thread Benjamin Peterson
Inyeol inyeol.lee at gmail.com writes:

 
 or am I missing something obvious?

The attribute access is evaluated before the call to assertRaises, so unittest
never has a cache to cache it.



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Interaction btw unittest.assertRaises and __getattr__. Bug?

2010-10-26 Thread Chris Rebert
On Tue, Oct 26, 2010 at 7:51 PM, Benjamin Peterson benja...@python.org wrote:
 Inyeol inyeol.lee at gmail.com writes:

 or am I missing something obvious?

 The attribute access is evaluated before the call to assertRaises, so unittest
 never has a
 cache to cache it.

or rather, chance to catch it.

Seems there were 2 typos.

Cheers,
Chris
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.7 or 3.1

2010-10-26 Thread Jorge Biquez

Hello Christian and all .

Thanks for the comments. I am newbie to Python trying to learn all 
the comments, that , by the way, I am very impressed of the knowledge 
of the people present in this list.


I was wondering if you can comment more about what alternatives to 
use instead to MySql. My web solutions do not need all the power of 
a true database, I even was wondering if I couldbe able to put simple 
dBase files (yes, dBase files) with my web solutions.


- Any comments you can do on what to use 2.7 or 3.1? ( I guess 2.7 
for what I have read)
- Maybe should be another subject but... Any comments on using dBase 
format file with Python?


Thanks in advance.

Jorge Biquez


At 08:50 p.m. 26/10/2010, you wrote:

Am 27.10.2010 03:38, schrieb Jorge Biquez:
 And what about if I only were to develop for the web? I mean web
 applications, Mysql, etc? It would be better to still be in 2.7?

Most frameworks and database adapters at least target Python 2.6+ as
their main Python version. I guess the majority has no or only
experimental support for Python 3.1. The overall situation improves
every week.

Christian

PS: I recommend against MySQL, if you need the full power or a RDBMS.
Just try to combine foreign keys with database triggers and you'll see
which major features are still broken in MySQL. But that's just my point
of view as a power user.

--
http://mail.python.org/mailman/listinfo/python-list



--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.7 or 3.1

2010-10-26 Thread Philip Semanchuk

On Oct 26, 2010, at 11:10 PM, Jorge Biquez wrote:

 Hello Christian and all .
 
 Thanks for the comments. I am newbie to Python trying to learn all the 
 comments, that , by the way, I am very impressed of the knowledge of the 
 people present in this list.
 
 I was wondering if you can comment more about what alternatives to use 
 instead to MySql. My web solutions do not need all the power of a true 
 database, I even was wondering if I couldbe able to put simple dBase files 
 (yes, dBase files) with my web solutions.
 
 - Any comments you can do on what to use 2.7 or 3.1? ( I guess 2.7 for what I 
 have read)
 - Maybe should be another subject but... Any comments on using dBase format 
 file with Python?

Hi Jorge,
Python comes with SQLite baked in, meaning you don't have to install anything 
extra to get the full power of SQLite. Depending on what you want to do, that 
might be perfect for your needs. It's been part of Python since 2.5.

If you need a heavy-duty database, I recommend checking out PostgreSQL. I've 
always found it solid and easy to use. 

Have fun
Philip


 
 At 08:50 p.m. 26/10/2010, you wrote:
 Am 27.10.2010 03:38, schrieb Jorge Biquez:
  And what about if I only were to develop for the web? I mean web
  applications, Mysql, etc? It would be better to still be in 2.7?
 
 Most frameworks and database adapters at least target Python 2.6+ as
 their main Python version. I guess the majority has no or only
 experimental support for Python 3.1. The overall situation improves
 every week.
 
 Christian
 
 PS: I recommend against MySQL, if you need the full power or a RDBMS.
 Just try to combine foreign keys with database triggers and you'll see
 which major features are still broken in MySQL. But that's just my point
 of view as a power user.
 
 --
 http://mail.python.org/mailman/listinfo/python-list
 
 
 -- 
 http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is list comprehension necessary?

2010-10-26 Thread rantingrick
On Oct 26, 11:29 am, John Nagle na...@animats.com wrote:
 On 10/26/2010 2:31 AM, Xah Lee wrote:

  recently wrote a article based on a debate here. (can't find the
  original thread on Google at the moment)

  • 〈What's List Comprehension and Why is it Harmful?〉
 http://xahlee.org/comp/list_comprehension.html

  it hit reddit.
 http://www.reddit.com/r/programming/comments/dw8op/whats_list_compreh...

  though, i don't find the argument there informative.

  For python, i can understand that it might be preferred, due to the
  special syntax, being more in sync with python because of the
  imperative hints in keywords. (e.g. those “for”, “if” in it.) But for
  more pure functional lang (e.g. haskell), i think lc is pretty bad.

     That's from the functional programming crowd.

     Python isn't a functional language.  It has some minimal
 functional capabilities, and there's a lobby that would like
 more.  So far, that's mostly been resisted.  Attempts to allow
 multiline lambdas have been averted.  The weird functional if
 syntax additions were a cave-in to the functional crowd, and may
 have been a mistake.

                                 John Nagle

I think if you look at LC's (Python's LC's that is) from an esoteric
and mainstream (almost haughty) point of view then yes they will seem
offensive to you. However i think Guido and his cast of extras (if I
may speak on behalf of this fine group of folks!) intended LC's to be
like any other construct we have come to love about Python. Syntactic
simplicity coupled with elegant phrasing whist never forgetting to
drop a good joke when the situation permits (as is the case for the
easter eggs and whatnot). So my point is that Python LC's are
different from mainstream LC's and that is a good thing. I find
Pythons map and lambda far more atrocious than LC's , really.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is list comprehension necessary?

2010-10-26 Thread rantingrick
On Oct 26, 12:07 pm, Andre Alexander Bell p...@andre-bell.de wrote:
 Hello,

 I occasionally use LCs, if they seem useful. However, what I don't like
 about LCs is that they 'look-like' being a closed scope, while actually
 they are in the scope of there call. Example:

  i = 5
  l = [i**2 for i in range(3)]
  i

 2


I must admit you make a good point here however the only time that
will slip you up is when you first experienced the Python LC syntax.
After a few hello world LC's you'll begin to love and understand
them completely.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is list comprehension necessary?

2010-10-26 Thread Gary Herron

On 10/26/2010 09:28 PM, rantingrick wrote:

On Oct 26, 12:07 pm, Andre Alexander Bellp...@andre-bell.de  wrote:

Hello,

I occasionally use LCs, if they seem useful. However, what I don't like
about LCs is that they 'look-like' being a closed scope, while actually
they are in the scope of there call. Example:


i = 5
l = [i**2 for i in range(3)]
i

2



That (very small) issue has been fixed in Python3:

 l = [i**2 for i in range(3)]
 i
Traceback (most recent call last):
  File stdin, line 1, in module
NameError: name 'i' is not defined



Gary Herron




I must admit you make a good point here however the only time that
will slip you up is when you first experienced the Python LC syntax.
After a few hello world LC's you'll begin to love and understand
them completely.


--
http://mail.python.org/mailman/listinfo/python-list


Re: Can 32-bit and 64-bit Python coexist in the same computer?

2010-10-26 Thread J.O. Aho
Andy wrote:
 Hi guys!
 
 I got a new laptop computer which came with the 64-bit version of
 Windows 7.  I installed the 64-bit versions of Python and a few other
 libraries and wrote a few Python programs right there.  If I copy the
 Python scripts to a 32-bit computer, it runs flawlessly.  But in the
 future I may still need to distribute my compiled programs to people
 who use 32-bit Windows and it seems that neither PyInstaller nor
 py2exe can cross compile a 32-bit application from this 64-bit
 computer.

A better way may be to have everything as a source package which auto
compiles during installation, then you can use an universal package.


 So ugly as it sounds, I'm considering installing in parallel the 32-
 bit version of Python on this same computer.  Is there anything I need
 to know or a better way to achieve this instead of having a double
 Python installation?

This will work, you just need to have two different paths to the installations
and of course you will need to install packages for both of them. It works
kind in the same way as you would have 2.6 and 3 installed on the same time.



-- 

  //Aho
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue10107] Quitting IDLE on Mac doesn't save unsaved code

2010-10-26 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

The attached patches implement an exit callback for IDLE on OS X that ensures 
IDLE will not terminate from an application Quit command without giving the 
opportunity to save files.

--
assignee: ned.deily - ronaldoussoren
components: +Macintosh
keywords: +patch
priority: normal - high
stage: needs patch - patch review
Added file: http://bugs.python.org/file19366/issue10107-py3k-31.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10107
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10107] Quitting IDLE on Mac doesn't save unsaved code

2010-10-26 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


Added file: http://bugs.python.org/file19367/issue10107-27.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10107
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10107] Quitting IDLE on Mac doesn't save unsaved code

2010-10-26 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

BTW, the patched IDLEs were tested on 2.7 and py3k (3.2a3+) on 10.4, 10.5, and 
10.6 with the Apple-supplied Tk 8.4 (all), the Apple-supplied Tk 8.5 (available 
only in 10.6), ActiveState Tk 8.4 (all), and ActiveState 8.5 (all).  And the 
patches have no affect nor are needed when linked with an X11-based Tk on OS X.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10107
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10176] telnetlib.Telnet.read_very_eager() performance

2010-10-26 Thread ptz

ptz ppt...@gmail.com added the comment:

As David suggested, it indeed seems to be a case of timing. When 
telnetlib.Telnet(...) returns, the server still doesn't have the data cooked, 
and read_very_eager() fetches nothing. So nothing here fails as such, it's just 
that my 0 experience in network programming showed.

Either way, some things you could do to get the function g() above to fetch the 
data the server usually returns upon connection are:

a) insert a time.sleep(t) line after creating the socket. But I don't think 
there is one answer as to what the value of t should be.
b) if one knows the format of the data that will be received, one could use 
read_until(expected string)
c) one could write something like

 def g():
...   f = telnetlib.Telnet(chessclub.com)
...   data = ''
...   while not data:
... data = f.read_some()
...   print data,f.read_very_eager()
...


This simply loops until the server has some cooked data available, then fetches 
it. Tested, works, and is probably the way to do it.

Either way, like David wisely said, this isn't an issue with either Python or 
telnetlib. However, it may be a good idea to add a warning to the documentation 
to the effect that by the time the Telnet constructor returns cooked data is 
typically not yet available from the server. To a beginner network programmer, 
this is far from obvious.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10176
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10194] Add gc.remap() function to the gc module.

2010-10-26 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Agreed with Benjamin. There is already a visible issue with the patch: it 
breaks compatibility because the Py_VISIT() argument must now be an lvalue.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10194
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10195] Memory allocation fault-injection?

2010-10-26 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Unless we want to test manually each memory allocation in the interpreter, the 
only reasonable way seems to be some kind of fuzzing (perhaps using a 
reproducible random seed).

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10195
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5178] Add context manager for temporary directory

2010-10-26 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Merging the interfaces for mkdtemp and TemporaryDirectory isn't going to happen.

mkstemp/mkdtemp are for when the user wants to control the lifecycle of the 
filesystem entries themselves. (Note that context management on a regular 
file-like object only closes the file, it doesn't delete it from the 
filesystem). They're also intended as relatively thin wrappers around the 
corresponding C standard library functionality.

The other objects in tempfile (TemporaryFile, TemporaryDirectory, etc) are for 
when the user wants the lifecycle of the Python object to correspond with the 
lifecycle of the underlying filesystem element.

That said, TD itself can be used to create the temporary directory without 
having to use it as a context manager (the underlying directory is created in 
__init__, not __enter__).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5178
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6269] threading documentation makes no mention of the GIL

2010-10-26 Thread Ray.Allen

Ray.Allen ysj@gmail.com added the comment:

Agree with Jesse, the description in the patch is not quite correct. I think 
detailed description of the GIL has been given in C API documentation: 
http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock.
 How about just give this link in threading module documentation?

--
nosy: +ysj.ray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6269
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2775] Implement PEP 3108

2010-10-26 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Shouldn't this be closed? Most of this has been done and we can't do the rest 
anyway, without breaking backwards compatibility.

--
nosy: +pitrou
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2775
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC

2010-10-26 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Is it still reproduceable with 2.7, 3.1 or 3.2?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10195] Memory allocation fault-injection?

2010-10-26 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Don't you know http://www.nongnu.org/failmalloc/?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10195
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-26 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Yes, but in that particular case the exact line referenced is involved in the 
error, since it that error is that the symbol is both nonlocal and an argument, 
and the error points to the head of the block which is the 'def' statement.

Attached is a patch that adds the available line number info to all of the 
error messages except the one for nonlocal at the global level.  In that case 
the line number will always be zero, so that does not

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10189
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-26 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
Removed message: http://bugs.python.org/msg119601

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10189
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10195] Memory allocation fault-injection?

2010-10-26 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Don't you know http://www.nongnu.org/failmalloc/?

This doesn't answer the question of what and how to test.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10195
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-26 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Yes, but in that particular case the exact line referenced is involved in the 
error, since it that error is that the symbol is both nonlocal and an argument, 
and the error points to the head of the block which is the 'def' statement.

Attached is a patch that adds the available line info, and also modifies the 
'nonlocal at global level' message to include the symbol name.

I think this change is a good idea because without the patch this code:

cat temp
import foo
cat foo.py
def f():
def g():
nonlocal a

gives this:

./python temp
Traceback (most recent call last):
  File temp, line 1, in module
import foo
SyntaxError: no binding for nonlocal 'a' found

which is even more confusing that not having any traceback at all.

After the patch it will look like this:

Traceback (most recent call last):
  File temp, line 1, in module
import foo
  File /home/rdmurray/python/py3k/foo.py, line 2
def g():
SyntaxError: no binding for nonlocal 'a' found

--
keywords: +patch
Added file: http://bugs.python.org/file19368/nonlocal-traceback.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10189
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-26 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Ah, I hadn't noticed Benjamin assigned this to himself when I submitted that 
patch.  Well, maybe it will be marginally useful anyway :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10189
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10197] subprocess.getoutput fails on win32

2010-10-26 Thread jldm

New submission from jldm j_l_domen...@yahoo.com:

Hi, first of all sorry for my English.

On windows XP SP3, the following code:

import subprocess
subprocess.getoutput(dir)

returns
'{ is not recognized as an internal or external command,\noperable 
program or batch file.'

I made a workaround by changing in the file Lib/subprocess.py the line 574 (I 
thin in 3.2a3 is 584) (in the getstatusoutput(cmd) function definition) from:
pipe = os.popen('{ ' + cmd + '; } 21', 'r')

to:
pipe = os.popen('( ' + cmd + '; ) 21', 'r')

I have tested it with:

ActivePython 3.1.2.3 (ActiveState Software Inc.) based on
Python 3.1.2 (r312:79147, Mar 22 2010, 12:20:29) [MSC v.1500 32 bit (Intel)] on 
win32

and

Python 3.2a3 (r32a3:85355, Oct 10 2010, 17:11:45) [MSC v.1500 32 bit (Intel)] 
on win32


Regards from Spain.
José Luis Domenech

--
messages: 119605
nosy: jldm
priority: normal
severity: normal
status: open
title: subprocess.getoutput fails on win32
type: behavior
versions: Python 3.1, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10197
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7761] telnetlib Telnet.interact fails on Windows but not Linux

2010-10-26 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Committed to py3k in r85846, 3.1 in r85847.

--
resolution:  - fixed
stage: unit test needed - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7761
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10197] subprocess.getoutput fails on win32

2010-10-26 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Oddly, the test suite skips getoutput and getstatusoutput on windows with the 
comment that the source says it is relevant only for posix, but the 
documentation does not have 'availability: unix' tags.  (It is also odd that 
getoutput isn't documented, but that's a different issue.)

Your workaround can't be used as a fix, since the semantics of {}s in the shell 
are different from those of ()s.

It's not clear to me what the point of the {}s is, but I have a fear that 
eliminating them would introduce subtle changes in the behavior of getoutput 
calls.  Perhaps not, though.

It looks like this issue amounts to an RFE for support of 
getoutput/getstatusoutput on Windows, though the fact that it is not documented 
as unix-only may make it a bug instead :)

The appropriate fix is probably to conditionalize the code based on platform.  
A complete patch will require unit test changes and documentation changes 
(since the docs currently mention the braces).

All of that said, it also appears that the new check_output should be preferred 
to either getoutput or getstatusoutput.  Perhaps those functions could be 
re-implemented in terms of check_output.

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10197
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10197] subprocess.getoutput fails on win32

2010-10-26 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
components: +Windows
nosy: +brian.curtin

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10197
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10194] Add gc.remap() function to the gc module.

2010-10-26 Thread Peter Ingebretson

Peter Ingebretson pinge...@yahoo.com added the comment:

Thanks, I've started a thread on python-dev to discuss the patch.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10194
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10198] wave module writes corrupt wav file for zero-length writeframes

2010-10-26 Thread David Barnett

New submission from David Barnett davidbarne...@gmail.com:

If the first call to writeframes happens to take an empty string as the data to 
write, then the next call to writeframes writes a 2nd header into the file, and 
forever after fails to patch the data length correctly.

--
components: Library (Lib)
messages: 119609
nosy: mu_mind
priority: normal
severity: normal
status: open
title: wave module writes corrupt wav file for zero-length writeframes
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10198
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10198] wave module writes corrupt wav file for zero-length writeframes

2010-10-26 Thread David Barnett

David Barnett davidbarne...@gmail.com added the comment:

This patch against the python 2.6 version fixes the problem for me.

--
keywords: +patch
Added file: http://bugs.python.org/file19369/fix_double_header.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10198
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >