Re: porting modules to Python 3.0

2008-12-03 Thread Martin v. Löwis
> In one has both 2.x and 3.0 installed, would it easy to install 'lib.py' > for both? It's currently not possible to install something for 2.x; you have to specifically install it for every value of x (e.g. 2.5 or 2.6). It's the same for 3.0: you have to install it separately. Doing so is fairl

Re: Multiple equates

2008-12-03 Thread Lawrence D'Oliveiro
Cameron Laird wrote: >def f1(Match): >return Something missing here? -- http://mail.python.org/mailman/listinfo/python-list

Re: noob needs help

2008-12-03 Thread Jeremiah Dodds
On Wed, Dec 3, 2008 at 1:01 AM, Sambo <[EMAIL PROTECTED]> wrote: > Peter Pearson wrote: > > > In slackware one needs "./" before the filename if you executing > files in current dir. > -- > http://mail.python.org/mailman/listinfo/python-list > Umm, only if you're running files marked as executabl

How to use a Python function that returns a double array in C++.

2008-12-03 Thread pieter
I want to use a Python function that returns a double array in C++. I don’t have a problem if the Python function returns a single variable of type double, using the following lines in my C++ code: myPythonObjectPointer = PyObject_CallObject(pFunc, pArgs); myCppDoubleVariable = PyF

Re: Reverse zip() ?

2008-12-03 Thread Andreas Waldenburger
On Tue, 02 Dec 2008 18:16:13 -0800 Bryan Olson <[EMAIL PROTECTED]> wrote: > zip as its own inverse might be even easier to comprehend if we call > zip by its more traditional name, "transpose". > Sounds like a Py4k change to me. /W -- My real email address is constructed by swapping the domain

Re: How to use a Python function that returns a double array in C++.

2008-12-03 Thread Hrvoje Niksic
pieter <[EMAIL PROTECTED]> writes: > I want to use a Python function that returns a double array in C++. Return an array.array('d') object, and use the buffer protocol (for example PyObject_AsReadBuffer()) to get the address of the underlying array of native doubles. -- http://mail.python.org/mai

Re: Do more imported objects affect performance

2008-12-03 Thread Nick Craig-Wood
On Tue, Dec 02, 2008 at 10:53:47PM -0500, Steve Holden wrote: > Pardon me for intruding, but timings here are entirely the wrong focus > for a Python newcomer. Given that imports are super-optimized (i.e. the > code in the module is only performed once) such a small difference in > timing is incons

Re: [ANN] Pyjamas 0.4: Python Web Toolkit Release

2008-12-03 Thread Luke Kenneth Casson Leighton
On Wed, Dec 3, 2008 at 4:54 AM, Banibrata Dutta <[EMAIL PROTECTED]> wrote: > Amazing concept, and glad that someone thought of this and implemented this. > The book's formatting on IE and Chrome looked a bit unusual. Content wise it > is already firly decent (i.e. enough to get a programmer started

Re: Reverse zip() ?

2008-12-03 Thread alex23
On Dec 3, 6:51 pm, Andreas Waldenburger <[EMAIL PROTECTED]> wrote: > On Tue, 02 Dec 2008 18:16:13 -0800 Bryan Olson > > zip as its own inverse might be even easier to comprehend if we call > > zip by its more traditional name, "transpose". > > Sounds like a Py4k change to me. Nah, just add the fol

Re: Obama's Birth Certificate - Demand that US presidential electors investigate Obama's eligibility

2008-12-03 Thread MM456Z
On Dec 3, 12:53 am, Bryan Olson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > This message is not about the meaningless computer printout called > > More importantly, it's not about Python. I'm setting follow-ups to > talk.politics. > > > "Certification of Live Birth" that Obama propaga

Re: How to instantiate in a lazy way?

2008-12-03 Thread Nick Craig-Wood
Slaunger <[EMAIL PROTECTED]> wrote: > Just wanted to show the end result in its actual implementation! > > I ended up *not* making a decorator, as I already had a good idea > about how to do it > using __getattr__ > > class PayloadDualFrqIQOnDemand(PayloadDualFrqIQ): > """ > This c

How to send body and attachements in an email message?

2008-12-03 Thread srinivasan srinivas
HI, I would like to send an email message with body-content 'test' and an attachment. The snippet i used is: outer = email.mime.multipart.MIMEMultipart() msg1 = email.mime.text.MIMEText(, _subtype = 'text') msg1.add_header('Content-Disposition', 'attachment') outer.attach(msg1) body = email.mime.

Re: Reverse zip() ?

2008-12-03 Thread Andreas Waldenburger
On Wed, 3 Dec 2008 02:11:51 -0800 (PST) alex23 <[EMAIL PROTECTED]> wrote: > On Dec 3, 6:51 pm, Andreas Waldenburger <[EMAIL PROTECTED]> wrote: > > On Tue, 02 Dec 2008 18:16:13 -0800 Bryan Olson > > > zip as its own inverse might be even easier to comprehend if we > > > call zip by its more traditi

Re: How to send body and attachements in an email message?

2008-12-03 Thread Aspersieman
On Wed, 03 Dec 2008 12:40:30 +0200, srinivasan srinivas <[EMAIL PROTECTED]> wrote: HI, I would like to send an email message with body-content 'test' and an attachment. The snippet i used is: outer = email.mime.multipart.MIMEMultipart() msg1 = email.mime.text.MIMEText(, _subtype = 'text')

Re: Running a Python script from crontab

2008-12-03 Thread Astley Le Jasper
Ok ... this is odd. I tried gregory's suggestion of redirecting the stdout & stderr to a text file. This worked. I could see all the logging information. However, there was no error to see this time ... the application worked completely without any problems. I also then tried Jon's suggestion of

Converting a .xls file to .html

2008-12-03 Thread tarun
Hello All, I've a .xml file (saved as .xls) that can be opened in Microsoft excel. I want to write python code that converts this excel file into .html (so that it can be viewed as is in an explorer). Can any one help? Regards, Tarun -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it safe to modify the dict returned by vars() or locals()

2008-12-03 Thread Helmut Jarausch
Duncan Booth wrote: Helmut Jarausch <[EMAIL PROTECTED]> wrote: Chris Rebert wrote: On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch <[EMAIL PROTECTED]> wrote: Hi, I am looking for an elegant way to solve the following problem: Within a function def Foo(**parms) I have a list of names, say

Re: Obama's Birth Certificate - Demand that US presidential electors investigate Obama's eligibility

2008-12-03 Thread Iain King
On Dec 3, 10:16 am, [EMAIL PROTECTED] wrote: > On Dec 3, 12:53 am, Bryan Olson <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED] wrote: > > > This message is not about the meaningless computer printout called > > > More importantly, it's not about Python. I'm setting follow-ups to > > talk.pol

Re: Multiple equates

2008-12-03 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >Cameron Laird wrote: > >>def f1(Match): >>return > >Something missing here? Ugh; yes, sorry: def shell_escape(Arg) : """returns Arg suitably escaped for use as a command-line argument

Re: Running a Python script from crontab

2008-12-03 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Astley Le Jasper wrote: > The trouble is that obviously I get no console when using crontab so > can't see any traceback. Cron normally sends you mail if a cron task generated any output (this should include error messages). -- http://mail.python.org/mailman/listin

Re: Simple ini Config parser examples needed

2008-12-03 Thread Tim Chase
Tim provided a correct-looking answer, albeit somewhat complex, as it doesn't reuse the logic in the ConfigParser. It didn't start out very complex, but it was so easy to make it a bit more robust with such a scant few lines of code that I went ahead. The original just looked like options

Re: Multiple equates

2008-12-03 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Cameron Laird wrote: >def shell_escape(Arg) : >"""returns Arg suitably escaped for use as a command-line argument >to Bash.""" > >pattern = r"[\<\>\"\'\|\&\$\#\;\(\)\[\]\{\}\`\!\~\ \\]" >def f1(Match): > return "\\" + Match.group

Re: How to instantiate in a lazy way?

2008-12-03 Thread Slaunger
On 3 Dec., 11:30, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > >          cls = self.__class__ > >          if attr_name in cls.data_attr_names: > > self.data_attr_names should do instead of cls.data_attr_names unless > you are overriding it in the instance (which you don't appear to be). Yeah, I

Jython: Packing several .py on .jar, problem importing .py modules within the .jar

2008-12-03 Thread Gubatron
Hello all, I've a problem with Jython and importing .py inside a jar. I'm putting .class and .py files inside .jar files. myjar.jar MyJar\SomeClass.class MyJar\main.py MyJar\otherModule.py So I add the myjar.jar to Jython's sys.path org.python.core.PySystemState p

Re: Multiple equates

2008-12-03 Thread Jeremiah Dodds
On Wed, Dec 3, 2008 at 6:23 AM, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > > So why is that better? > -- > http://mail.python.org/mailman/listinfo/python-list > I personally think that it looks marginally cleaner (indentation issues aside). Do you think it's substantially worse? If so, why

Re: Converting a .xls file to .html

2008-12-03 Thread Jeremiah Dodds
On Wed, Dec 3, 2008 at 5:54 AM, tarun <[EMAIL PROTECTED]> wrote: > Hello All, > > I've a .xml file (saved as .xls) that can be opened in Microsoft excel. I > want to write python code that converts this excel file into .html (so that > it can be viewed as is in an explorer). > > Can any one help?

Re: Multiple equates

2008-12-03 Thread Almar Klein
Hi, what about numpy? import numpy a = numpy.ones((10,),dtype=numpy.bool) I = [1,3,8] a[I]=False print a gives: [ True False True False True True True True False True] Almar -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a .xls file to .html

2008-12-03 Thread Linda Octalina
Do you have styles attached to the text of the document in the xls? (bold, italic, etc) if not, then you can just do the mapping by creating table and cells by yourself... (or xslt) {^(00)^} LiNdA OcTaLiNa ---GeEeEee--- From: Jeremiah Dodds <[EMAIL PROTECTED

Thread Tkinter problem

2008-12-03 Thread Davy
Hi all, I am using thread and tkinter to write some simple programs and solidify my understanding of Python thread/GUI programing. The scheme is thread + queue + GUI. One child thread (gen_board_thread) generate board and insert data into queue infinitely. Meanwhile, the main thread canvas widget

Re: Converting a .xls file to .html

2008-12-03 Thread Tino Wildenhain
Hi, tarun wrote: Hello All, I've a .xml file (saved as .xls) that can be opened in Microsoft excel. Well if its an xml file then just attach a style to it and you can just view it in a browser w/o involving excel in the first place. Also there are lots of xml libraries coming with python

Python3: sorting image objects according to a cmp function

2008-12-03 Thread Poor Yorick
I'm looking for a Python3-compatible way to sort a list of PIL image objects based on a computed difference between the two images. In 2.x, this would work: imagelist.sort(cmp=image_diff(a,b)) Maybe this could be done by creating a new class with the appropriate __lt__, gt__, __eq__ metho

generating a liste of characters

2008-12-03 Thread Yves Dorfsman
Is there any built in way to generate a list of characters, something along the line of range('a'-'z') ? Right now I am using: chars = [ chr(l) for l in range(0x30, 0x3a) ] # 0 - 9 chars += [ chr(l) for l in range(0x41, 0x5b) ] # A - Z chars += [ chr(l) for l in range(0x61, 0x7b) ] # a

Re: generating a liste of characters

2008-12-03 Thread James Mills
On Thu, Dec 4, 2008 at 12:18 AM, Yves Dorfsman <[EMAIL PROTECTED]> wrote: > Is there any built in way to generate a list of characters, something > along the line of range('a'-'z') ? > > Right now I am using: > > chars = [ chr(l) for l in range(0x30, 0x3a) ] # 0 - 9 > chars += [ chr(l) for l i

Re: generating a liste of characters

2008-12-03 Thread Shane Geiger
import string alphabet=list(string.letters[0:26]) print alphabet Yves Dorfsman wrote: Is there any built in way to generate a list of characters, something along the line of range('a'-'z') ? Right now I am using: chars = [ chr(l) for l in range(0x30, 0x3a) ] # 0 - 9 chars += [ chr(l)

Re: How to instantiate in a lazy way?

2008-12-03 Thread Nick Craig-Wood
Slaunger <[EMAIL PROTECTED]> wrote: > On 3 Dec., 11:30, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > ? ? ? ? ?cls = self.__class__ > > > ? ? ? ? ?if attr_name in cls.data_attr_names: > > > > self.data_attr_names should do instead of cls.data_attr_names unless > > you are overriding it in the i

Re: generating a liste of characters

2008-12-03 Thread Vlastimil Brom
2008/12/3 Yves Dorfsman <[EMAIL PROTECTED]>: > Is there any built in way to generate a list of characters, something > along the line of range('a'-'z') ? > > Right now I am using: > > chars = [ chr(l) for l in range(0x30, 0x3a) ] # 0 - 9 > chars += [ chr(l) for l in range(0x41, 0x5b) ] # A - Z

Re: Obama's Birth Certificate - Demand that US presidential electors investigate Obama's eligibility

2008-12-03 Thread Albert Hopkins
This has nothing to do with Python. Please take this thread to cares.who.someone. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reverse zip() ?

2008-12-03 Thread Janto Dreijer
I'd like to point out that since your where thinking in terms of matplotlib, you might actually find numpy's own transpose useful, instead of using zip(*seq) :) untested: t = linspace(0,2*pi*3) seq = asarray(zip(t, sin(t))) t, y = seq.T # or seq.transpose() or numpy.transpose(seq) pylab.plot(t,y

Profiling Python

2008-12-03 Thread esgameserver
Hi, Simply put, we want to see the profile info dynamically. Is that possible? To clarify again, Is there some function like profile.PrintStats() which dynamically shows the stats before stopping the Profiler? Regards, -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread Tkinter problem

2008-12-03 Thread Hendrik van Rooyen
"Davy" <[EMAIL PROTECTED]> wrote: > while(data_queue.full() == False): This will fill the queue and stop. Use while true and if queue not full... - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a Python script from crontab

2008-12-03 Thread Astley Le Jasper
I've included a switch to include or exclude the logging to console. When logging only to file, the script runs fine. Of course, I still don't understand why dual logging, and specifically to the console, causes a problem and if anyone has any comments about the dual output logging code above then

Re: Running a Python script from crontab

2008-12-03 Thread Philip Semanchuk
On Dec 3, 2008, at 10:29 AM, Astley Le Jasper wrote: I've included a switch to include or exclude the logging to console. When logging only to file, the script runs fine. Of course, I still don't understand why dual logging, and specifically to the console, causes a problem and if anyone has a

Re: Debugging a Python Program that Hangs

2008-12-03 Thread Stef Mientki
check winpdb / rpdb2, cheers, Stef On 12/3/08, alex23 <[EMAIL PROTECTED]> wrote: > On Dec 3, 2:19 am, Kevin D. Smith <[EMAIL PROTECTED]> wrote: >> I have a fairly large python program that, when a certain combination >> of options is used, hangs. I have no idea where it is hanging, so >> simply p

Re: Multiple equates

2008-12-03 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >In message <[EMAIL PROTECTED]>, Cameron Laird wrote: > >>def shell_escape(Arg) : >>"""returns Arg suitably escaped for use as a command-line argument >>to Bash.""" >> >>pattern = r"[\<\>\"\

Re: Reverse zip() ?

2008-12-03 Thread Andreas Waldenburger
On Wed, 3 Dec 2008 07:08:52 -0800 (PST) Janto Dreijer <[EMAIL PROTECTED]> wrote: > I'd like to point out that since your where thinking in terms of > matplotlib, you might actually find numpy's own transpose useful, > instead of using zip(*seq) :) > This was, of course, to be expected. :) Whenev

Re: Mathematica 7 compares to other languages

2008-12-03 Thread Jon Harrop
Xah Lee wrote: > On Dec 2, 5:13 pm, Jon Harrop <[EMAIL PROTECTED]> wrote: >> The Mathematica code is 700,000x slower so a 50% improvement will be >> uninteresting. Can you make my Mathematica code five orders of magnitude >> faster or not? > > Pay me $10 thru paypal, i'll can increase the speed so

python an sqlite objects

2008-12-03 Thread azrael
is it possible to save a python object into a sqlite database as an atribute of type BLOB -- http://mail.python.org/mailman/listinfo/python-list

Re: porting modules to Python 3.0

2008-12-03 Thread Terry Reedy
Martin v. Löwis wrote: In one has both 2.x and 3.0 installed, would it easy to install 'lib.py' for both? It's currently not possible to install something for 2.x; you have to specifically install it for every value of x (e.g. 2.5 or 2.6). That is what I meant. It's the same for 3.0: you ha

Re: python an sqlite objects

2008-12-03 Thread skip
azrael> is it possible to save a python object into a sqlite database as azrael> an atribute of type BLOB Sure. Just pickle the object and save the resulting string. -- Skip Montanaro - [EMAIL PROTECTED] - http://smontanaro.dyndns.org/ -- http://mail.python.org/mailman/listinfo/python-

Re: Multiple Versions of Python on Windows XP

2008-12-03 Thread Colin J. Williams
Martin v. Löwis wrote: What changes are made to the registry? For a complete list, see Tools/msi/msi.py in the source tree. I have scanned the file: http://svn.python.org/projects/python/branches/py3k/Tools/msi/msi.py I don't find anything that addresses this issue. Read the add_registry fu

Re: python an sqlite objects

2008-12-03 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : azrael> is it possible to save a python object into a sqlite database as azrael> an atribute of type BLOB Sure. Just pickle the object and save the resulting string. Or if you want something more portable, serialize the object to json. At least you'll have

Re: python an sqlite objects

2008-12-03 Thread skip
Bruno> Or if you want something more portable, serialize the object to Bruno> json. At least you'll have a chance to deserialize it with some Bruno> other language. Assuming json can serialize more-or-less arbitrary Python objects. Can it serialize class instances? Skip -- http://ma

Re: python an sqlite objects

2008-12-03 Thread Gerhard Häring
[EMAIL PROTECTED] wrote: > azrael> is it possible to save a python object into a sqlite database as > azrael> an atribute of type BLOB > > Sure. Just pickle the object and save the resulting string. Be sure to save it as BLOB, not TEXT. Suppose you have serialized your object as Python

Re: Jython: Packing several .py on .jar, problem importing .py modules within the .jar

2008-12-03 Thread Gubatron
I've managed to solve this problem. I can now run a python script that lives inside a Jar. The python script is now able to import other scripts within the same jar, and it's also able to import java classes that live within the jar. The problem was solved by giving the Jython Interpreter the pro

Re: Jython: Packing several .py on .jar, problem importing .py modules within the .jar

2008-12-03 Thread Gubatron
cont... Take in consideration /** Hashtable of URLClassLoaders for each of the jars loaded */ private Hashtable classLoaders; Here's an example: org.python.core.PySystemState pySys = new org.python.core.PySystemState(); //classLoad

Python calling COM compliant .dll

2008-12-03 Thread David Shi
Hello, there.   I am looking for a concise working example of Python script calling COM compliant .dll.   Regards.   David -- http://mail.python.org/mailman/listinfo/python-list

python to parse excel file csv format

2008-12-03 Thread Jay Jesus Amorin
Hi all, Can anyone please help me. i need to parse the content of my csv excel file and run the unix command chown. test.csv: "/dev/trunk/admin/sql/ADBPOS_CMSI_NATIONALITY.syn",814 "/dev/trunk/bin/ADBPOSCMSDICED.ctl",405 "/dev/trunk/discoverer/ADBPOS_BUSINESS_AREA.eex",215 Please help me parse

Re: Running a Python script from crontab

2008-12-03 Thread Astley Le Jasper
On 3 Dec, 16:41, Philip Semanchuk <[EMAIL PROTECTED]> wrote: > On Dec 3, 2008, at 10:29 AM, Astley Le Jasper wrote: > > > I've included a switch to include or exclude theloggingto console. > > Whenloggingonly to file, the script runs fine. > > > Of course, I still don't understand whyduallogging, a

using os.walk to generate objects

2008-12-03 Thread Joe Hrbek
The code below works (in linux), but I'm wondering if there is a better/easier/cleaner way? It works on directory trees that don't have a lot of "."s in them or other special characters. I haven't implemented a good handler for that yet, so if you run this in your system, choose/make a simple dire

Re: python to parse excel file csv format

2008-12-03 Thread Jay Jesus Amorin
This is how i do it, but it runs with error. Kindly help #!/usr/bin/env python import csv, sys, os filename = (sys.argv[1]) reader = csv.reader(open(filename, "rb"), delimiter=',', quoting=csv.QUOTE_NONE) try: for row in reader: os.popen("chown row[0] row[1]") except cs

Re: Running a Python script from crontab

2008-12-03 Thread Philip Semanchuk
On Dec 3, 2008, at 1:33 PM, Astley Le Jasper wrote: On 3 Dec, 16:41, Philip Semanchuk <[EMAIL PROTECTED]> wrote: On Dec 3, 2008, at 10:29 AM, Astley Le Jasper wrote: I've included a switch to include or exclude theloggingto console. Whenloggingonly to file, the script runs fine. Of course

Re: Mathematica 7 compares to other languages

2008-12-03 Thread jason-sage
[EMAIL PROTECTED] wrote: So when you need an algorithm, you can often find it already inside, for example in the large Combinatorics package. So it has WAY more batteries included, compared to Python. I'd like to see something as complete as that Combinatorics package in Python. Sage (http

Re: Debugging a Python Program that Hangs

2008-12-03 Thread Kay Schluehr
On 2 Dez., 17:19, Kevin D. Smith <[EMAIL PROTECTED]> wrote: > I have a fairly large python program that, when a certain combination > of options is used, hangs.  I have no idea where it is hanging, so > simply putting in print statements to locate the spot would be quite > difficult.  Unfortunately

Re: Reverse zip() ?

2008-12-03 Thread Benjamin Kaplan
On Wed, Dec 3, 2008 at 11:19 AM, Andreas Waldenburger <[EMAIL PROTECTED]>wrote: > On Wed, 3 Dec 2008 07:08:52 -0800 (PST) Janto Dreijer > <[EMAIL PROTECTED]> wrote: > > > I'd like to point out that since your where thinking in terms of > > matplotlib, you might actually find numpy's own transpose

Re: python an sqlite objects

2008-12-03 Thread azrael
It logical that it would be more efficient and logical to use a object oriented database, but in this case I ask because of the portable nature of sqlite. so, if I get it right, this should be possible >>> class a: >>> def __init__(self, a, b): >>> self.c = a+b >>> self.d = a*b >>> >>>

Re: Overriding a method at the instance level on a subclass of a builtin type

2008-12-03 Thread Arnaud Delobelle
"Zac Burns" <[EMAIL PROTECTED]> writes: > Sorry for the long subject. > > I'm trying to create a subclass dictionary that runs extra init code > on the first __getitem__ call. However, the performance of __getitem__ > is quite important - so I'm trying in the subclassed __getitem__ > method to fir

Re: python an sqlite objects

2008-12-03 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Bruno> Or if you want something more portable, serialize the object to Bruno> json. At least you'll have a chance to deserialize it with some Bruno> other language. Assuming json can serialize more-or-less arbitrary Python objects. I assume the OP knows

Re: python to parse excel file csv format

2008-12-03 Thread MRAB
Jay Jesus Amorin wrote: This is how i do it, but it runs with error. Kindly help #!/usr/bin/env python import csv, sys, os filename = (sys.argv[1]) reader = csv.reader(open(filename, "rb"), delimiter=',', quoting=csv.QUOTE_NONE) try: for row in reader: os.popen("chow

Re: python an sqlite objects

2008-12-03 Thread skip
Bruno> Most of the time, you want to serialize the instance's __dict__. Does it recreate an instance at the other end or just a dict? Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding a method at the instance level on a subclass of a builtin type

2008-12-03 Thread Jason Scheirer
On Dec 2, 6:13 pm, Aaron Brady <[EMAIL PROTECTED]> wrote: > On Dec 2, 6:58 pm, "Zac Burns" <[EMAIL PROTECTED]> wrote: > > > > > Sorry for the long subject. > > > I'm trying to create a subclass dictionary that runs extra init code > > on the first __getitem__ call. However, the performance of __get

Switching windows in PyQT

2008-12-03 Thread ShanMayne
Greetings All I am new to PyQT and GUI programming in general. What tutorials I have found are relatively clear on standard operations within a single window (QtGui.QWidget or QtGui.QMainWindow). Exiting this window exits the overall application. How would I switch between windows, that is close

Re: Running a Python script from crontab

2008-12-03 Thread Astley Le Jasper
On 3 Dec, 19:49, Philip Semanchuk <[EMAIL PROTECTED]> wrote: > On Dec 3, 2008, at 1:33 PM, Astley Le Jasper wrote: > > > > > On 3 Dec, 16:41, Philip Semanchuk <[EMAIL PROTECTED]> wrote: > >> On Dec 3, 2008, at 10:29 AM, Astley Le Jasper wrote: > > >>> I've included a switch to include or exclude th

Tired of coding.

2008-12-03 Thread fel
http://digg.com/programming/Tired_of_coding_try_FBP_Flow_Based_Programming -- http://mail.python.org/mailman/listinfo/python-list

Numpy record array - field names for all dimensions

2008-12-03 Thread ShanMayne
Greetings All I am seeking to represent datasets where each data element is the calculated result from several (4 for now) other data types. A matrix- like (in the general mathematical sense) seems logical, where the intersection of each of the 4 values (from different data sets) holds the value d

Re: Running a Python script from crontab

2008-12-03 Thread Philip Semanchuk
On Dec 3, 2008, at 3:06 PM, Astley Le Jasper wrote: On 3 Dec, 19:49, Philip Semanchuk <[EMAIL PROTECTED]> wrote: On Dec 3, 2008, at 1:33 PM, Astley Le Jasper wrote: On 3 Dec, 16:41, Philip Semanchuk <[EMAIL PROTECTED]> wrote: On Dec 3, 2008, at 10:29 AM, Astley Le Jasper wrote: I've incl

Re: python to parse excel file csv format

2008-12-03 Thread Tino Wildenhain
MRAB wrote: Jay Jesus Amorin wrote: This is how i do it, but it runs with error. Kindly help #!/usr/bin/env python import csv, sys, os filename = (sys.argv[1]) reader = csv.reader(open(filename, "rb"), delimiter=',', quoting=csv.QUOTE_NONE) try: for row in reader: o

Re: Debugging a Python Program that Hangs

2008-12-03 Thread Ross Ridge
Kevin D. Smith <[EMAIL PROTECTED]> wrote: >I have a fairly large python program that, when a certain combination >of options is used, hangs. I have no idea where it is hanging, so >simply putting in print statements to locate the spot would be quite >difficult. Unfortunately, ctrl-C'ing the p

Re: Switching windows in PyQT

2008-12-03 Thread Дамјан Георгиевски
> I am new to PyQT and GUI programming in general. What tutorials I have > found are relatively clear on standard operations within a single > window (QtGui.QWidget or QtGui.QMainWindow). Exiting this window exits > the overall application. > > How would I switch between windows, that is close on

Re: Converting a .xls file to .html

2008-12-03 Thread John Machin
On Dec 4, 12:57 am, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > Hi, > > tarun wrote: > > Hello All, > > > I've a .xml file (saved as .xls) that can be opened in Microsoft excel. The file extension is only a vague indication of the *format* of the contents. How was it created? > > Well if its an

Python-URL! - weekly Python news and links (Dec 3)

2008-12-03 Thread Gabriel Genellina
QOTW: "Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right

building an extension module with autotools?

2008-12-03 Thread Michael George
Hello, (Please CC me in replies, as I am off-list) I'm building an application (a game) in python, with a single C module containing some performance-critical code. I'm trying to figure out the best way to set it up to build. Distutils seems to be designed only for building and distributing

Re: Mathematica 7 compares to other languages

2008-12-03 Thread Xah Lee
On Dec 3, 8:24 am, Jon Harrop <[EMAIL PROTECTED]> wrote: > My example demonstrates several of Mathematica's fundamental limitations. enough babble Jon. Come flying $5 to my paypal account, and i'll give you real code, amongest the programing tech geekers here for all to see. I'll show, what kind

Re: Numpy record array - field names for all dimensions

2008-12-03 Thread Robert Kern
ShanMayne wrote: Greetings All Greetings! If you have more numpy questions, you will find numpy-discussion to be a better forum: http://www.scipy.org/Mailing_Lists I am seeking to represent datasets where each data element is the calculated result from several (4 for now) other data type

Re: python an sqlite objects

2008-12-03 Thread Gerhard Häring
azrael wrote: It logical that it would be more efficient and logical to use a object oriented database, but in this case I ask because of the portable nature of sqlite. so, if I get it right, this should be possible [...] Did you try it? Did it work? If so,it was pure luck. Attached is a scri

Re: building an extension module with autotools?

2008-12-03 Thread Gerhard Häring
Michael George wrote: Hello, (Please CC me in replies, as I am off-list) Ok, but please reply publicly. I'm building an application (a game) in python, with a single C module containing some performance-critical code. I'm trying to figure out the best way to set it up to build. Use dist

Re: building an extension module with autotools?

2008-12-03 Thread Martin v. Löwis
> I've tried using automake, however I'm worried about libtool not getting > the options right while building my module. You should use python-config(1) to obtain the command line options necessary to build and link extension modules. HTH, Martin -- http://mail.python.org/mailman/listinfo/python

Re: Reverse zip() ?

2008-12-03 Thread Casey McGinty
> The corner case is when dealing with empty lists and there aren't > enough items to unpack. > > Another solution to zip(), with a slightly different behaviour for conner cases >>> a = (1,2,3) >>> b = (1,2,3) >>> c = (1,2,3,4) >>> zip(a,b) [(1, 1), (2, 2), (3, 3)] >>> map(None,a,b) [(1, 1),

"as" keyword woes

2008-12-03 Thread Warren DeLano
A bottom line / pragmatic question... hopefully not a FAQ. Why was it necessary to make "as" a reserved keyword? And more to the point, why was it necessary to prevent developers from being able to refer to attributes named "as"? For example, this code breaks as of 2.6 / 3.0: Class C:

Re: python an sqlite objects

2008-12-03 Thread eric
On Dec 3, 10:21 pm, Gerhard Häring <[EMAIL PROTECTED]> wrote: > azrael wrote: > > It logical that it would be more efficient and logical to use a object > > oriented database, but in this case I ask because of the portable > > nature of sqlite. > > > so, if I get it right, this should be possible [

Re: building an extension module with autotools?

2008-12-03 Thread Michael George
Gerhard Häring wrote: Michael George wrote: I've tried using automake, In my opinion, this is serious overkill. automake is good for making stuff work on a herd of different Unixen with various combinations of libc functions available etc. But for developing a Python extension, it doesn't h

Re: "as" keyword woes

2008-12-03 Thread Martin P. Hellwig
Warren DeLano wrote: A bottom line / pragmatic question... hopefully not a FAQ. Why was it necessary to make "as" a reserved keyword? Because it can be used at the import statement to let the imported thing be known under another name? Something like: >>> import xml.etree.ElementTree as E

Re: "as" keyword woes

2008-12-03 Thread Martin P. Hellwig
Martin P. Hellwig wrote: Warren DeLano wrote: A bottom line / pragmatic question... hopefully not a FAQ. Why was it necessary to make "as" a reserved keyword? Because it can be used at the import statement to let the imported thing be known under another name? Something like: >>> import

Re: building an extension module with autotools?

2008-12-03 Thread Michael George
Martin v. Löwis wrote: I've tried using automake, however I'm worried about libtool not getting the options right while building my module. You should use python-config(1) to obtain the command line options necessary to build and link extension modules. HTH, Martin Sweet, I think th

Re: "as" keyword woes

2008-12-03 Thread Albert Hopkins
On Wed, 2008-12-03 at 13:38 -0800, Warren DeLano wrote: > A bottom line / pragmatic question... hopefully not a FAQ. > > Why was it necessary to make "as" a reserved keyword? > > And more to the point, why was it necessary to prevent developers from > being able to refer to attributes named "as

Re: Mathematica 7 compares to other languages

2008-12-03 Thread Thomas M. Hermann
On Dec 3, 3:15 pm, Xah Lee <[EMAIL PROTECTED]> wrote: > On Dec 3, 8:24 am, Jon Harrop <[EMAIL PROTECTED]> wrote: > > > My example demonstrates several of Mathematica's fundamental limitations. > > enough babble Jon. > > Come flying $5 to my paypal account, and i'll give you real code, > amongest th

Re: How to instantiate in a lazy way?

2008-12-03 Thread Slaunger
On 3 Dec., 15:30, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Slaunger <[EMAIL PROTECTED]> wrote: > >  On 3 Dec., 11:30, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > > ? ? ? ? ?cls = self.__class__ > > > > ? ? ? ? ?if attr_name in cls.data_attr_names: > > > > self.data_attr_names should do ins

Re: "as" keyword woes

2008-12-03 Thread Steven D'Aprano
On Wed, 03 Dec 2008 22:02:24 +, Martin P. Hellwig wrote: > Warren DeLano wrote: >> A bottom line / pragmatic question... hopefully not a FAQ. >> >> Why was it necessary to make "as" a reserved keyword? > > Because it can be used at the import statement to let the imported thing > be known un

Re: "as" keyword woes

2008-12-03 Thread Warren DeLano
> Because it can be used at the import statement to let the imported thing > be known under another name? > Something like: > > >>> import xml.etree.ElementTree as ET Yes, but that syntax worked fine for years without "as" actually having to be a keyword. There must be something more going on h

Re: building an extension module with autotools?

2008-12-03 Thread Christian Heimes
Gerhard Häring wrote: #!/bin/sh python setup.py build cp build/lib.*/*.so . python test.py "python setup.py build_ext -i" is your friend. It installs the extensions inplace. No need for cp here. :) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: "as" keyword woes

2008-12-03 Thread Robert Kern
Steven D'Aprano wrote: While I feel sympathy for the OP, I do have to ask: he's been using Python 2.5 for, what, a couple of years now? How many times did he see the depreciation warning, and almost certainly the pending depreciation warning before that? Python-dev has been talking about making

  1   2   >