pyxser-1.4.6r --- Python Object to XML serializer/deserializer

2010-08-04 Thread Daniel Molina Wegener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello Python Community. I'm pleased to announce pyxser-1.4.6r, a python extension which contains functions to serialize and deserialize Python Objects into XML. It is a model based serializer. Here is the ChangeLog entry for this release: This

pyCologne Python User Group Cologne - Meeting, August 11, 2010, 6.30pm

2010-08-04 Thread Andi Albrecht
Hello, The next meeting of pyCologne will take place: Wednesday, August, 11th starting about 6.30 pm - 6.45 pm at Room 0.14, Benutzerrechenzentrum (RRZK-B) University of Cologne, Berrenrather Str. 136, 50937 Köln, Germany Agenda: - adm6 - ip6tables-, pf.conf- and ipf scripts with Python

Jamming with Django : An Introduction - Aug 12-13 - Chicago

2010-08-04 Thread David Beazley
Jamming with Django : An Introduction August 12-13, 2010 Chicago, Illinois http://www.dabeaz.com/chicago/index.html Spend a few days in Chicago's Andersonville neighborhood learning how to set up your first

[ANN] Websourcebrowser 0.4a released

2010-08-04 Thread Stefan Schwarzer
Hello, I'm happy to announce the release of Websourcebrowser 0.4a. Websourcebrowser is a program intended to get a quick overview of a project's source code. The program is controlled from a web browser which displays a directory tree and a source code file side by side. The homepage of the

Re: Why is python not written in C++ ?

2010-08-04 Thread Paul Rubin
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: I believe the life-support software on the International Space Station is written in Ada. Would anybody feel happier if that had been done in C++? Take a look at the articles on C bug-finding on Dawson Engler's page:

Re: simple (I hope!) problem

2010-08-04 Thread Daniel da Silva
Why not just add the google app engine lib subdirectories to your python path? On Tue, Aug 3, 2010 at 3:09 AM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: samwyse wrote: I'm writing for the Google app engine and have stubbed my toe yet again on a simple obstacle. Non-trivial app

Re: Global variables problem

2010-08-04 Thread Daniel da Silva
Your problem lies somewhere in the use of the Process class, not with global variables. If you replace your p = ... and p.start() lines with a direct call to self.handle_connection(), your code works as expected. I don't know much about the multiprocessing module, so I can't really comment on

Re: Why is python not written in C++ ?

2010-08-04 Thread Neil Hodgson
Grant Edwards: That said, the last time I looked the Ada spec was only something like 100 pages long, so a case could be made that it won't take long to learn. I don't know how long the C++ language spec is, but I'm betting it's closer to 1000 than 100. The Ada 2012 Language Reference

Re: parsing tab and newline delimited text

2010-08-04 Thread alex23
On Aug 4, 12:14 pm, elsa kerensael...@hotmail.com wrote: So, an individual entry might have this form (in printed form): Title    date   position   data with each field separated by tabs, and a newline at the end of data. As James posted, the csv module is ideal for this sort of thing.

Re: Global variables problem

2010-08-04 Thread Navkirat Singh
Thanks a lot guys !! I solved the problem: In the lines: new_process = process(target=newprocess) new_process.start() The target=newprocess is pointing towards a variable, instead of a function. So, appending a () will make it goto that function, thereby changing

Re: Python Script Cannot Write to Directory

2010-08-04 Thread News123
On 08/04/2010 06:01 AM, Chris Brauchli wrote: Hi, I am writing a script that, at one point, copies a file from directory A to directory B. Directory B can only be written to by root, but the script is always called with sudo, so this shouldn't be an issue, but it is. I have tried using

Re: Python Script Cannot Write to Directory

2010-08-04 Thread Chris Rebert
On Wed, Aug 4, 2010 at 12:21 AM, News123 news1...@free.fr wrote: snip 3.) try following python import os print os.getcwd() import shutil shutil(YOUR_SOURCE_FILE_NAME,DESTINATION_DIRECTORY/DSTNTN_FILE_NAME) WTF; modules aren't callable. Typo? Cheers, Chris -- http://blog.rebertia.com --

Re: Global variables problem

2010-08-04 Thread Navkirat Singh
: ( False alarm, the earlier solution breaks multiprocessing. Whats happening here is the child needs to change a variable in the parent process, So I think I am looking at shared memory (maybe). Any suggestions? Regards, Nav On 04-Aug-2010, at 12:41 PM, Navkirat Singh wrote: Thanks a

Re: Urrlib2 IncompleteRead error

2010-08-04 Thread Gabriel Genellina
On 27 jul, 11:00, dirknbr dirk...@gmail.com wrote: I am running urllib2.request and get this response when I do the read. Any ideas what causes this? return response.read()   File C:\Python26\lib\socket.py, line 329, in read     data = self._sock.recv(rbufsize)   File

Re: Trying to set a cookie within a python script

2010-08-04 Thread Dotan Cohen
2010/8/4 Νίκος nikos.the.gr...@gmail.com: Encodings still give me headaches. I try to understand them as different ways to store data in a media. Tell me something. What encoding should i pick for my scripts knowing that only contain english + greek chars?? iso-8859-7 or utf-8 and why?

Re: Global variables problem

2010-08-04 Thread Matteo Landi
Usually, modify global variables in a multi-thread/multi-process scenario is not the right to operate: you better re-implement your solution in a way that the shared resource is either protected with synchronized objects or accessed by a single thread/process (and in this case, it won't be a

Re: Why is python not written in C++ ?

2010-08-04 Thread Lawrence D'Oliveiro
In message pv76o.2574$yv@viwinnwfe01.internal.bigpond.com, Neil Hodgson wrote: The Ada 2012 Language Reference Manual is 860 pages and the Ada 2005 LRM was 790 pages. The annotated versions are even longer http://www.ada-auth.org/standards/ada12.html Yeah, unfortunately the language

Re: Why is python not written in C++ ?

2010-08-04 Thread Lawrence D'Oliveiro
In message pan.2010.08.03.08.35.59.328...@nowhere.com, Nobody wrote: One feature which can't readily be implemented in C is the automatic clean-up side of the RAII idiom. Use do-once blocks http://www.geek-central.gen.nz/peeves/programming_discipline.html. --

Re: Python Script Cannot Write to Directory

2010-08-04 Thread Matteo Landi
On Wed, Aug 4, 2010 at 9:27 AM, Chris Rebert c...@rebertia.com wrote: On Wed, Aug 4, 2010 at 12:21 AM, News123 news1...@free.fr wrote: snip 3.) try following python import os print os.getcwd() import shutil shutil(YOUR_SOURCE_FILE_NAME,DESTINATION_DIRECTORY/DSTNTN_FILE_NAME) WTF; modules

Re: Why is python not written in C++ ?

2010-08-04 Thread Lawrence D'Oliveiro
In message 7d95c0d3-718d-4958-9364-263c833f1...@i24g2000yqa.googlegroups.com, sturlamolden wrote: This is unsafe, anyone who writes this in C++ should be flogged: Only if they’re using exceptions. Otherwise, it’s fine. -- http://mail.python.org/mailman/listinfo/python-list

error: (113, 'Software caused connection abort')0

2010-08-04 Thread sarah
hi i face with this problem when i want to run this command on cygwin: python httpd.py 8000 example-300-1k-rigid.py Dfghfji12d52s35s2sswee9E with this error :0 Exception happened during processing of request from ('127.0.0.1', 35868) Traceback (most recent call last): File

Re: Why is python not written in C++ ?

2010-08-04 Thread Jean-Michel Pichavant
Carl Banks wrote: On Aug 3, 7:07 pm, Paul Rubin no.em...@nospam.invalid wrote: Mozilla is fed up with C++ and seems to be working on its own language, called Rust: http://lambda-the-ultimate.org/node/4009 That looks much better than Go. It's like all the cool features of Go

Difference between queues and pipes in multiprocessing

2010-08-04 Thread Navkirat Singh
Hi, I was wondering what are the differences between queues and pipes implemented using multiprocessing python module. Am I correct if I say, in pipes, if another process writes to one receiving end concurrently, then an error will be raised and in queues the later processes data will just

Re: Global variables problem

2010-08-04 Thread Jean-Michel Pichavant
Navkirat Singh wrote: On 04-Aug-2010, at 9:46 AM, Daniel da Silva wrote: Please post approximate code that actually works and displays the problem. On Tue, Aug 3, 2010 at 9:00 PM, Navkirat Singh navkir...@gmail.com mailto:navkir...@gmail.com wrote: Hey guys, I am using a

Re: Python Script Cannot Write to Directory

2010-08-04 Thread Steven D'Aprano
On Tue, 03 Aug 2010 21:01:38 -0700, Chris Brauchli wrote: Hi, I am writing a script that, at one point, copies a file from directory A to directory B. Directory B can only be written to by root, but the script is always called with sudo, so this shouldn't be an issue, but it is. I have

Re: Trying to set a cookie within a python script

2010-08-04 Thread Steven D'Aprano
On Tue, 03 Aug 2010 20:08:46 -0700, Νίκος wrote: i tried in IDLE enviroment as well and for some reason even with a single number isnated of time() function the cookie is never set, because the print of print os.environ.get('HTTP_COOKIE') result to None What happens if you open up a

Re: Difference between queues and pipes in multiprocessing

2010-08-04 Thread James Mills
On Wed, Aug 4, 2010 at 7:20 PM, Navkirat Singh navkir...@gmail.com wrote: I was wondering what are the differences between queues and pipes implemented using multiprocessing python module. Am I correct if I say, in pipes, if another process writes to one receiving end concurrently, then an

lpr via subprocess in 2.4

2010-08-04 Thread loial
I am am trying to run the following command via subprocess lpr -P printqueue filetoprint I cannot seem to get it to work and return stderr I think the issue is how to specify the arguments I am trying subprocess.Popen(['lpr -P' ,'laserlpr','/etc/hosts'], shell=False) but get error :

Python package to read .7z archives?

2010-08-04 Thread Hallvard B Furuseth
Is there an equivalent of zipfile.py for .7z archives? I have one which extracts an archive member by running 7z e -so, but that's a *slow* way to read one file at a time. Google found me some python interfaces to lzma, but apparently they only handle single compressed files, not .7z archives.

Re: lpr via subprocess in 2.4

2010-08-04 Thread Peter Otten
loial wrote: I am am trying to run the following command via subprocess lpr -P printqueue filetoprint I cannot seem to get it to work and return stderr I think the issue is how to specify the arguments I am trying subprocess.Popen(['lpr -P' ,'laserlpr','/etc/hosts'], shell=False)

Re: Python package to read .7z archives?

2010-08-04 Thread Giampaolo Rodolà
2010/8/4 Hallvard B Furuseth h.b.furus...@usit.uio.no: Is there an equivalent of zipfile.py for .7z archives? I have one which extracts an archive member by running 7z e -so, but that's a *slow* way to read one file at a time. Google found me some python interfaces to lzma, but apparently

parsing a c project

2010-08-04 Thread Aitor Garcia
Hi, I need to know the memory locations of all variables in a C project including variables allocated inside structs. What I want to do in to expand the structs into its basic elements (floats, int16 and int8). In a header file (example.h) I have the following definitions. struct house{

Re: lpr via subprocess in 2.4

2010-08-04 Thread loial
Thanks...that worked. I have also been trying to get the return code and standard error. How do I access these? #!/usr/bin/python import os import subprocess process=subprocess.Popen(['lpr', '-P' ,'raserlpr','/etc/hosts'], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) print

Re: lpr via subprocess in 2.4

2010-08-04 Thread James Mills
On Wed, Aug 4, 2010 at 9:38 PM, loial jldunn2...@gmail.com wrote: I have also been trying to get the return code and standard error. p = Popen(..., stderr=PIPE) Look up the docs for subprocess.Popen cheers James -- -- James Mills -- -- Problems are solved by method --

Re: Python package to read .7z archives?

2010-08-04 Thread Hallvard B Furuseth
Giampaolo Rodolà g.rod...@gmail.com writes: 2010/8/4 Hallvard B Furuseth h.b.furus...@usit.uio.no: Is there an equivalent of zipfile.py for .7z archives? I have one which extracts an archive member by running 7z e -so, but that's a *slow* way to read one file at a time. Google found me some

newbie problem with str.replace

2010-08-04 Thread BobAalsma
I'm working on a set of scripts and I can't get a replace to work in the script - please help. The scripts show no errors, work properly apart from the replace, all variables are filled as expected, the scripts works properly when the commands are copied to the Python shell. Text Main: .. from

Re: newbie problem with str.replace

2010-08-04 Thread Anthony Tolle
On Aug 4, 9:10 am, BobAalsma bob.aal...@aalsmacons.nl wrote:                         #                         bestandsnaam_nieuw = bestandsnaam                         bestandsnaam_nieuw.replace(KLANTNAAM_OUT,KLANTNAAM_IN) The replace method does not modify the string (strings are immutable).

Re: newbie problem with str.replace

2010-08-04 Thread Peter Otten
BobAalsma wrote: Although [it] may not be obvious at first unless you're Dutch... bestandsnaam_nieuw = bestandsnaam bestandsnaam_nieuw.replace(KLANTNAAM_OUT,KLANTNAAM_IN) str.replace() does not modify a string, it creates a new one. This doesn't work: s = that's all folks s.replace(all,

Re: newbie problem with str.replace

2010-08-04 Thread BobAalsma
On Aug 4, 3:22 pm, Anthony Tolle anthony.to...@gmail.com wrote: On Aug 4, 9:10 am, BobAalsma bob.aal...@aalsmacons.nl wrote:                         #                         bestandsnaam_nieuw = bestandsnaam                         bestandsnaam_nieuw.replace(KLANTNAAM_OUT,KLANTNAAM_IN)

Re: newbie problem with str.replace

2010-08-04 Thread Mike Kent
On Aug 4, 9:10 am, BobAalsma bob.aal...@aalsmacons.nl wrote: I'm working on a set of scripts and I can't get a replace to work in the script - please help.                         bestandsnaam_nieuw.replace(KLANTNAAM_OUT,KLANTNAAM_IN) I'm not sure what you are intending to do here, but

The Application cannot locate win32ui.pyd (or Python) (126)

2010-08-04 Thread vsoler
Hi all, I just installed python 3.1.2 where I used to have python 2.6.4. I'm working on Win7. The IDLE GUI works, but I get the following message when trying to open *.py files written for py 2.6 The Application cannot locate win32ui.pyd (or Python) (126) Should I change the PATH in

Re: parsing a c project

2010-08-04 Thread Jon Clements
On 4 Aug, 12:33, Aitor Garcia carrierphasejit...@yahoo.com wrote: Hi, I need to know the memory locations of all variables in a C project including variables allocated inside structs. Pray tell us why? What I want to do in to expand the structs into its basic elements (floats, int16 and

Re: Why is python not written in C++ ?

2010-08-04 Thread Grant Edwards
On 2010-08-04, Paul Rubin no.em...@nospam.invalid wrote: Grant Edwards inva...@invalid.invalid writes: The issue that would prevent its use where I work is the inability to hire anybody who knows Ada. ... That said, the last time I looked the Ada spec was only something like 100 pages long,

Re: Why is python not written in C++ ?

2010-08-04 Thread Grant Edwards
On 2010-08-04, Paul Rubin no.em...@nospam.invalid wrote: I'm not sure what the hiring issue is. I think anyone skilled in C++ or Java can pick up Ada pretty easily. It's mostly a subset of C++ with different surface syntax. In my experience, the hiring issue is we're already behind schedule

Re: Why is python not written in C++ ?

2010-08-04 Thread Grant Edwards
On 2010-08-04, Neil Hodgson nyamatongwe+thun...@gmail.com wrote: Grant Edwards: That said, the last time I looked the Ada spec was only something like 100 pages long, so a case could be made that it won't take long to learn. I don't know how long the C++ language spec is, but I'm betting

Re: Trying to set a cookie within a python script

2010-08-04 Thread Dave Angel
¯º¿Â wrote: On 3 Αύγ, 21:00, Dave Angel da...@ieee.org wrote: A string is an object containing characters. A string literal is one of the ways you create such an object. When you create it that way, you need to make sure the compiler knows the correct encoding, by using the

Re: Get name of file from directory into variable

2010-08-04 Thread Steven W. Orr
On 08/03/10 06:21, quoth loial: In a unix shell script I can do something like this to look in a directory and get the name of a file or files into a variable : MYFILE=`ls /home/mydir/JOHN*.xml` Can I do this in one line in python? Sorry, but I just can't help myself. Yeah, it's one

Re: The Application cannot locate win32ui.pyd (or Python) (126)

2010-08-04 Thread Alex Willmer
On Aug 4, 2:35 pm, vsoler vicente.so...@gmail.com wrote: Hi all, I just installed python 3.1.2 where I used to have python 2.6.4. I'm working on Win7. The IDLE GUI works, but I get the following message when trying to open *.py files written for py 2.6         The Application cannot

Re: error: (113, 'Software caused connection abort')0

2010-08-04 Thread Aahz
In article ff8991c7-fc97-4688-9f0a-b2dd7c778...@o19g2000yqb.googlegroups.com, sarah maral.nik...@gmail.com wrote: i face with this problem when i want to run this command on cygwin: python httpd.py 8000 example-300-1k-rigid.py Make sure the webclient service is running. (May not have

Re: The Application cannot locate win32ui.pyd (or Python) (126)

2010-08-04 Thread vsoler
On Aug 4, 5:41 pm, Alex Willmer a...@moreati.org.uk wrote: On Aug 4, 2:35 pm, vsoler vicente.so...@gmail.com wrote: Hi all, I just installed python 3.1.2 where I used to have python 2.6.4. I'm working on Win7. The IDLE GUI works, but I get the following message when trying to open

problem adding a scrollbar to a text widget

2010-08-04 Thread Chris Hare
Here is my chunk of code. I can't figure out what I am doing wrong to put my scrollbar on the right hand side of the text box. from Tkinter import * def showLogFile(): top = Toplevel() f = Frame(top, bd=0, bg=Gray) top.title = netcomm log file f.grid() sc = Scrollbar(top)

Re: parsing a c project

2010-08-04 Thread Eli Bendersky
On Wed, Aug 4, 2010 at 14:33, Aitor Garcia carrierphasejit...@yahoo.comwrote: Hi, I need to know the memory locations of all variables in a C project including variables allocated inside structs. Aitor, try the pycparser project (http://code.google.com/p/pycparser/) - it's a complete ISO

XML parsing: SAX/expat yield

2010-08-04 Thread kj
I want to write code that parses a file that is far bigger than the amount of memory I can count on. Therefore, I want to stay as far away as possible from anything that produces a memory-resident DOM tree. The top-level structure of this xml is very simple: it's just a very long list of

Re: XML parsing: SAX/expat yield

2010-08-04 Thread Peter Otten
kj wrote: I want to write code that parses a file that is far bigger than the amount of memory I can count on. Therefore, I want to stay as far away as possible from anything that produces a memory-resident DOM tree. The top-level structure of this xml is very simple: it's just a very

Re: The Application cannot locate win32ui.pyd (or Python) (126)

2010-08-04 Thread Alex Willmer
On Aug 4, 5:19 pm, vsoler vicente.so...@gmail.com wrote: On Aug 4, 5:41 pm, Alex Willmer a...@moreati.org.uk wrote: On Aug 4, 2:35 pm, vsoler vicente.so...@gmail.com wrote: Hi all, I just installed python 3.1.2 where I used to have python 2.6.4. I'm working on Win7. The IDLE

Re: Trying to set a cookie within a python script

2010-08-04 Thread Dotan Cohen
On Wed, Aug 4, 2010 at 18:30, Dave Angel da...@ieee.org wrote: Depends on how sure you are that your program will never need characters outside your greek character set. Remember Y2K? Don't forget that the Euro symbol is outside the Greek character set. -- Dotan Cohen http://gibberish.co.il

Re: Trying to set a cookie within a python script

2010-08-04 Thread donn
On 04/08/2010 20:09, Dotan Cohen wrote: Don't forget that the Euro symbol is outside the Greek character set. I could make some kind of economic joke here, but I'm also broke :D \d -- http://mail.python.org/mailman/listinfo/python-list

Re: python terminology on classes

2010-08-04 Thread Steve Ferg
Seriously, we can't keep doing your thinking for you.  The answers to all your questions are section 9 of the tutorial. This is is just the kind of newbie-hostile smart-ass reply that we do not want to see on comp.lang.python. Let's try again: I think that the answers to all your questions

Re: The Application cannot locate win32ui.pyd (or Python) (126)

2010-08-04 Thread vsoler
On Aug 4, 7:52 pm, Alex Willmer a...@moreati.org.uk wrote: On Aug 4, 5:19 pm, vsoler vicente.so...@gmail.com wrote: On Aug 4, 5:41 pm, Alex Willmer a...@moreati.org.uk wrote: On Aug 4, 2:35 pm, vsoler vicente.so...@gmail.com wrote: Hi all, I just installed python 3.1.2 where I

running a piece of code at specific intervals?

2010-08-04 Thread Chris Hare
Don't say cron : I want to have a section of my code executed at 15 minute intervals. I am using Threading.timer, but it is causing a problem sinxe I am using sqlite3 and the thread support gives me an error, which aborts part of my code. So, is there an alternative to threading.timer?

__init__ as a lambda

2010-08-04 Thread Eric J. Van der Velden
Hello, Suppose class C: def __init__(self,name):self.name=name I was wondering if I could make the __init__ a lambda function, but class C: __init__=lambda self,self.name:None and then later, C('Hello') does not work; the first argument, self, is assigned all rigth, but you cannot write

Re: running a piece of code at specific intervals?

2010-08-04 Thread Dave Angel
Chris Hare wrote: Don't say cron : I want to have a section of my code executed at 15 minute intervals. I am using Threading.timer, but it is causing a problem sinxe I am using sqlite3 and the thread support gives me an error, which aborts part of my code. So, is there an alternative to

BundleBuilder Question

2010-08-04 Thread jyoung79
I stumbled upon an article about bundlebuilder, so I was testing it a little. At first it wouldn't work and had this in the error: IOError: [Errno 2] No such file or directory: '/System/Library/Frameworks/Python.framework/Versions/2.6/Resources/English.lproj' I'm currently running OS X 10.6

Re: running a piece of code at specific intervals?

2010-08-04 Thread Jesse Jaggars
On Wed, Aug 4, 2010 at 2:44 PM, Chris Hare ch...@labr.net wrote: Don't say cron : I want to have a section of my code executed at 15 minute intervals.  I am using Threading.timer, but it is causing a problem sinxe I am using sqlite3 and the thread support gives me an error, which aborts

Re: None is negative?

2010-08-04 Thread Thomas Jollans
On 08/03/2010 10:17 PM, wheres pythonmonks wrote: I did the google search... I must be blind as I don't see any hits... None is negative in Python? (v2.6) http://www.google.com/search?ie=UTF-8q=%22none+is+negative%22+python if None -999.99: print hi hi if -999 None:

A new syntax for writing tests

2010-08-04 Thread Jonathan Fine
Hi I just discovered today a new syntax for writing tests. The basic idea is to write a function that contains some statements, and run it via a decorator. I wonder if anyone had seen this pattern before, and how you feel about it. For myself, I quite like it. Let's suppose we want to

Re: BundleBuilder Question

2010-08-04 Thread Ned Deily
In article 20100804200820.1ir1h.80013.r...@cdptpa-web19-z02, jyoun...@kc.rr.com wrote: I stumbled upon an article about bundlebuilder, so I was testing it a little. At first it wouldn't work and had this in the error: IOError: [Errno 2] No such file or directory:

[ANN] Websourcebrowser 0.4a released

2010-08-04 Thread Stefan Schwarzer
Hello, I'm happy to announce the release of Websourcebrowser 0.4a. Websourcebrowser is a program intended to get a quick overview of a project's source code. The program is controlled from a web browser which displays a directory tree and a source code file side by side. The homepage of the

Re: XML parsing: SAX/expat yield

2010-08-04 Thread kj
In i3c7lc$e6v$0...@news.t-online.com Peter Otten __pete...@web.de writes: How about http://effbot.org/zone/element-iterparse.htm#incremental-parsing Exactly! Thanks! ~K -- http://mail.python.org/mailman/listinfo/python-list

scipy / stats : quantiles using sample weights from survey data

2010-08-04 Thread Christopher Barrington-Leigh
There is a function scipy.stats.mstats.mquantiles that returns quantiles for a vector of data. But my data should not be uniformly weighted in an estimate of the distribution, since they are from a survey and come with estimated sampling weights based on the stratification used in sampling. Is

how to pretty-print Python dict with unicode?

2010-08-04 Thread kj
Is there a simple way to get Python to pretty-print a dict whose values contain Unicode? (Of course, the goal here is that these printed values are human-readable.) If I run the following simple script: from pprint import pprint x = u'\u6c17\u304c\u9055\u3046' print '{%s: %s}' % (u'x', x)

Re: Unicode error

2010-08-04 Thread Aahz
In article pan.2010.07.26.04.27.47.437...@nowhere.com, Nobody nob...@nowhere.com wrote: Java's checked exception mechanism was based on real-world experience of the pitfalls of abstract types. And that experience was gained in environments where interface specifications were far more detailed

Python 2.6.6 release candidate 1 now available

2010-08-04 Thread Barry Warsaw
Hello fellow Pythoneers and Pythonistas, The source tarballs and Windows installers for the first (and hopefully only) Python 2.6.6 release candidate is now available: http://www.python.org/download/releases/2.6.6/ As usual, we would love it if you could download, install, and test these

Re: python terminology on classes

2010-08-04 Thread Rhodri James
On Wed, 04 Aug 2010 19:28:48 +0100, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: Seriously, we can't keep doing your thinking for you. The answers to all your questions are section 9 of the tutorial. This is is just the kind of newbie-hostile smart-ass reply that we do not want to see

Re: __init__ as a lambda

2010-08-04 Thread Stefan Schwarzer
Hi Eric, On 2010-08-04 21:58, Eric J. Van der Velden wrote: class C: def __init__(self,name):self.name=name I was wondering if I could make the __init__ a lambda function, but class C: __init__=lambda self,self.name:None and then later, C('Hello') does not work; the first

Re: Why is python not written in C++ ?

2010-08-04 Thread Lawrence D'Oliveiro
In message i3bsjf$kf...@reader1.panix.com, Grant Edwards wrote: In my experience, the hiring issue is we're already behind schedule and short-handed, we don't have the time or resources to teach people a new language. Most people seem to need tutorials or handholding of some sort. Look at the

Re: Why is python not written in C++ ?

2010-08-04 Thread Lawrence D'Oliveiro
In message i3bseh$kf...@reader1.panix.com, Grant Edwards wrote: The problem has nothing to do with the relative merits of the languages. The problem is inertia. So how was C++ able to get popular in the first place? And how was Java able to grab some share from it? --

Re: Why is there no platform independent way of clearing a terminal?

2010-08-04 Thread Lawrence D'Oliveiro
In message mailman.1445.1280767895.1673.python-l...@python.org, David Robinow wrote: As an admittedly stupid comparison, I have 1579 DLLs in my \windows\system32 directory. Some number of these have been upgraded by Windows Update. What about the ones that aren’t? How do you maintain those?

Re: Package management (was: Why is there no platform independent way of clearing a terminal?)

2010-08-04 Thread Lawrence D'Oliveiro
In message 87aap44mc7.fsf...@benfinney.id.au, Ben Finney wrote: Sadly, Python's package management is rather lacking by these standards. The Distutils legacy assumption of “package recipient, system administrator, and end user are all the same person”, among other design decisions, makes it

Questions, newbies, and community (was: python terminology on classes)

2010-08-04 Thread Ben Finney
Rhodri James rho...@wildebst.demon.co.uk writes: On Wed, 04 Aug 2010 19:28:48 +0100, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: Seriously, we can't keep doing your thinking for you. The answers to all your questions are section 9 of the tutorial. This is is just the kind of

Re: Why is python not written in C++ ?

2010-08-04 Thread Paul Rubin
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: The Ada 2012 Language Reference Manual is 860 pages ... Yeah, unfortunately the language was designed by a committee ... It seems apt to describe the resulting design as “bulletproof”, but “elegant” or “concise” ... not so much.

Re: __init__ as a lambda

2010-08-04 Thread Carl Banks
On Aug 4, 12:58 pm, Eric J. Van der Velden ericjvandervel...@gmail.com wrote: Hello, Suppose class C:  def __init__(self,name):self.name=name I was wondering if I could make the __init__ a lambda function, but class C:  __init__=lambda self,self.name:None and then later, C('Hello')

Re: Why is python not written in C++ ?

2010-08-04 Thread Grant Edwards
On 2010-08-04, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message i3bseh$kf...@reader1.panix.com, Grant Edwards wrote: The problem has nothing to do with the relative merits of the languages. The problem is inertia. So how was C++ able to get popular in the first place?

adding optionMenu items in code

2010-08-04 Thread Chris Hare
I have an option menu self.w = OptionMenu(self.frameNewNet, self.variable, one, two, three) Is there a way to add items to this programmatically, i.e. using values from a database? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to pretty-print Python dict with unicode?

2010-08-04 Thread Benjamin Kaplan
On Wed, Aug 4, 2010 at 3:15 PM, kj no.em...@please.post wrote: Is there a simple way to get Python to pretty-print a dict whose values contain Unicode?  (Of course, the goal here is that these printed values are human-readable.) If I run the following simple script: from pprint import

Re: how to pretty-print Python dict with unicode?

2010-08-04 Thread Vlastimil Brom
2010/8/5 kj no.em...@please.post: Is there a simple way to get Python to pretty-print a dict whose values contain Unicode? (Of course, the goal here is that these printed values are human-readable.) If I run the following simple script: from pprint import pprint x =

Re: Why is python not written in C++ ?

2010-08-04 Thread Paul Rubin
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: So how was C++ able to get popular in the first place? And how was Java able to grab some share from it? C++ made improvements over C that were necessary and welcome for controlling the complexity of large programs, while remaining

Re: __init__ as a lambda

2010-08-04 Thread John Nagle
On 8/4/2010 12:58 PM, Eric J. Van der Velden wrote: Hello, Suppose class C: def __init__(self,name):self.name=name I was wondering if I could make the __init__ a lambda Python is not a functional language. Attempts to make it one make it worse. There's this mindset that loops

Struggling to convert a mysql datetime object to a python string of a different format

2010-08-04 Thread Νίκος
Okey, i have many hours now struggling to convert a mysql datetime field that i retreive to a string of this format '%d %b, %H:%M' I google a lot but couldnt found out how to format it being a string Here si the code so far: try: cursor.execute( ''' SELECT host, hits,

Re: Package management

2010-08-04 Thread Ben Finney
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: In message 87aap44mc7.fsf...@benfinney.id.au, Ben Finney wrote: Sadly, Python's package management is rather lacking by these standards. The Distutils legacy assumption of “package recipient, system administrator, and end user

Re: Package management

2010-08-04 Thread Lawrence D'Oliveiro
In message 87pqxy2aqd@benfinney.id.au, Ben Finney wrote: Have you ever tried to make such a package and get it into Debian? I have found it very easy to recreate the same steps used by the package maintainers. For instance, “apt-get source package” brings down the exact same source files

Re: Why is python not written in C++ ?

2010-08-04 Thread Carl Banks
On Aug 4, 4:04 pm, Grant Edwards inva...@invalid.invalid wrote: On 2010-08-04, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message i3bseh$kf...@reader1.panix.com, Grant Edwards wrote: The problem has nothing to do with the relative merits of the languages.  The problem

Re: Why is python not written in C++ ?

2010-08-04 Thread Carl Banks
On Aug 4, 4:23 pm, Paul Rubin no.em...@nospam.invalid wrote:  Java was also on the OO bandwagon of the 1990's, which translated into good marketing back then, but is part of the cause of the massive bureaucracy and bloat in the Java runtime environment.  C++ seems to have made something of a

Re: Why is there no platform independent way of clearing a terminal?

2010-08-04 Thread David Robinow
On Wed, Aug 4, 2010 at 6:47 PM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.1445.1280767895.1673.python-l...@python.org, David Robinow wrote:  As an admittedly stupid comparison, I have 1579 DLLs in my \windows\system32 directory. Some number of these have

Re: Why is python not written in C++ ?

2010-08-04 Thread Roy Smith
In article i3cqia$82...@lust.ihug.co.nz, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message i3bseh$kf...@reader1.panix.com, Grant Edwards wrote: The problem has nothing to do with the relative merits of the languages. The problem is inertia. So how was C++ able to

Re: __init__ as a lambda

2010-08-04 Thread Steven D'Aprano
On Wed, 04 Aug 2010 12:58:18 -0700, Eric J. Van der Velden wrote: Hello, Suppose class C: def __init__(self,name):self.name=name I was wondering if I could make the __init__ a lambda function, Of course you can. Lambdas aren't special types of functions, they are *syntax* for

100% without investment online part time jobs..(adsense, datawork, neobux..more jobs)

2010-08-04 Thread rosy us
100% without investment….no registration fee…no need money… Online part time jobs…(googleadsense, dataentry…etc)all type of jobs… work from home..daily 2-3 hours…earn more money without any risk.. Full details at http://adsensejobworkfulldetails.co.cc/ More adsense tips,secrets,increasing

A useful, but painful, one-liner to edit money amounts

2010-08-04 Thread John Nagle
There's got to be a better way to do this: def editmoney(n) : return((,.join(reduce(lambda lst, item : (lst + [item]) if item else lst, re.split(r'(\d\d\d)',str(n)[::-1]),[])))[::-1]) editmoney(0) '0' editmoney(13535) '13,535' editmoney(-14535) '-14,535'

Re: simple (I hope!) problem

2010-08-04 Thread samwyse
On Aug 3, 1:20 am, Steven D'Aprano steve-REMOVE- t...@cybersource.com.au wrote: On Mon, 02 Aug 2010 17:19:46 -0700, samwyse wrote: Fortunately, I don't need the functionality of the object, I just want something that won't generate an error when I use it.  So, what is the quickest way to to

[issue9502] Bus error on OS X while unittest'ing QT app

2010-08-04 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: And more importantly: your report contains to little information to determine what's going on. Even a full crashreporter log is fairly useless unless you have access to the original binary and debugging symbols. Therefore: * Try to

  1   2   3   4   >