Fwd: Python 2 or 3 ? with Django , My SQL and YUI

2011-02-22 Thread Grigory Javadyan
-- Forwarded message -- From: Grigory Javadyan grigory.javad...@gmail.com Date: Tue, Feb 22, 2011 at 12:01 PM Subject: Re: Python 2 or 3 ? with Django , My SQL and YUI To: Sumit sumit1...@gmail.com Python 2 only. See

Re: python and parsing an xml file

2011-02-22 Thread Paul Anton Letnes
Den 21.02.11 18.30, skrev Matt Funk: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: ?xml version=1.0 encoding=UTF-8? !-- Settings for the algorithm to be performed -- Algorithm

Re: python and parsing an xml file

2011-02-22 Thread Stefan Behnel
Matt Funk, 21.02.2011 23:08: On 2/21/2011 11:22 AM, Terry Reedy wrote: On 2/21/2011 12:30 PM, Matt Funk wrote: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Why? mmmh. not sure how to answer this question exactly.

Re: LDFLAGS problem

2011-02-22 Thread Robin Becker
On 21/02/2011 22:36, Philip Semanchuk wrote: .. running build_ext building '_mysql' extension creating build/temp.freebsd-7.0-RELEASE-i386-2.7 gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,2,'final',0)

Re: Creating Long Lists

2011-02-22 Thread Kelson Zawack
The answer it turns out is the garbage collector. When I disable the garbage collector before the loop that loads the data into the list and then enable it after the loop the program runs without issue. This raises a question though, can the logic of the garbage collector be changed so that it is

Whats new in Python 3: concurrent-futures example error?

2011-02-22 Thread Paddy
I just noted the example here: http://docs.python.org/dev/whatsnew/3.2.html#pep-3148-the-concurrent-futures-module import concurrent.futures, shutil with concurrent.futures.ThreadPoolExecutor(max_workers=4) as e: e.submit(shutil.copy, 'src1.txt', 'dest1.txt') e.submit(shutil.copy,

Re: Creating Long Lists

2011-02-22 Thread Ben Finney
Kelson Zawack zawack...@gis.a-star.edu.sg writes: This raises a question though, can the logic of the garbage collector be changed so that it is not triggered in instances like this were you really do want to put lots and lots of stuff in memory. Have you considered using a more specialised

Re: Creating Long Lists

2011-02-22 Thread Peter Otten
Kelson Zawack wrote: The answer it turns out is the garbage collector. When I disable the garbage collector before the loop that loads the data into the list and then enable it after the loop the program runs without issue. This raises a question though, can the logic of the garbage

Tkinter Text Widget Background Color

2011-02-22 Thread Sathish S
Hi Ppl, I'm using the Tkinter Text Widget in my user interface. I'm trying to create a blinking effect for this Text Widget. I saw from the documentation I can set the color if the widget when I create it. x=Text(root,bg='#CFF') However, I couldn't find any property or function that set's the

Re: LDFLAGS problem

2011-02-22 Thread Robin Becker
On 21/02/2011 22:46, Stefan Krah wrote: error: command 'gcc' failed with exit status 1 where should I be looking to fix this problem? Try the patch from http://bugs.python.org/issue10547 or use an svn checkout. The patch didn't make it into 2.7.1. Stefan Krah well that fixes

Re: Creating Long Lists

2011-02-22 Thread Kelson Zawack
I am using python 2.6.2, so it may no longer be a problem. I am open to using another data type, but the way I read the documentation array.array only supports numeric types, not arbitrary objects. I also tried playing around with numpy arrays, albeit for only a short time, and it seems that

Re: python and parsing an xml file

2011-02-22 Thread Ian
On 21/02/2011 22:08, Matt Funk wrote: Why? mmmh. not sure how to answer this question exactly. I guess it's a design decision. I am not saying that it is best one, but it seemed suitable to me. I am certainly open to suggestions. But here are some requirements: 1) My boss needs to be able to

Re: Tkinter Text Widget Background Color

2011-02-22 Thread Peter Otten
Sathish S wrote: Hi Ppl, I'm using the Tkinter Text Widget in my user interface. I'm trying to create a blinking effect for this Text Widget. I saw from the documentation I can set the color if the widget when I create it. x=Text(root,bg='#CFF') However, I couldn't find any property

Re: python and parsing an xml file

2011-02-22 Thread python
Paul, How about skipping the whole xml thing? You can dynamically import any python module, even if it does not have a python filename. Great example! Can you do the same with a cStringIO based file that exists in memory vs. on disk? Your example requires a physical file on disk. Is it

running Python code from external application

2011-02-22 Thread Nadav Chernin
Hello, I need to run Python code from external application. In this external application i have 2 options to run: DLL or COM. Can i create dll or com from the Python code? Or how can i use Python27.dll to call the script and get returned values? Thanks --

Execute bit in .tar.gz file produced by distutils

2011-02-22 Thread Dan Goodman
Hi all, I have a problem with using distutils and was hoping someone might be able to help. The .exe and .zip files work fine - and easy_install uses the .zip file by default it seems - but in the .tar.gz file the execute bit is not set for any directories meaning a user on linux has to go

Re: python and parsing an xml file

2011-02-22 Thread Paul Anton Letnes
Den 22.02.11 13.29, skrev pyt...@bdurham.com: Paul, How about skipping the whole xml thing? You can dynamically import any python module, even if it does not have a python filename. Great example! Can you do the same with a cStringIO based file that exists in memory vs. on disk? Your

Re: return an object of a different class

2011-02-22 Thread Jean-Michel Pichavant
Steven D'Aprano wrote: On Mon, 21 Feb 2011 14:23:10 +0100, Jean-Michel Pichavant wrote: What is not legit, is to return different objects for which the caller has to test the type to know what attributes he can use. Well, I don't know... I'm of two minds. On the one hand, I find it

Python fails on math

2011-02-22 Thread christian schulze
Hey guys, I just found out, how much Python fails on simple math. I checked a simple equation for a friend. [code] from math import e as e from math import sqrt as sqrt 2*e*sqrt(3) - 2*e == 2*e*(sqrt(3) - 1) False [/code] So WTF? The equation is definitive equivalent. (See

Re: Python fails on math

2011-02-22 Thread Nitin Pawar
You may want to restrict the result to certain limit in the floating numbers each system has its own levels of floating numbers and even a small difference is a difference to return FALSE On Tue, Feb 22, 2011 at 6:50 PM, christian schulze xcr...@googlemail.comwrote: Hey guys, I just found

Re: Python fails on math

2011-02-22 Thread Grigory Javadyan
-- Forwarded message -- From: Grigory Javadyan grigory.javad...@gmail.com Date: Tue, Feb 22, 2011 at 5:32 PM Subject: Re: Python fails on math To: christian schulze xcr...@googlemail.com Everybody knows you can't just compare floating point values for equality with a simple ==.

Re: Python fails on math

2011-02-22 Thread Mel
christian schulze wrote: #1: 2.0 * e * sqrt(3.0) - 2.0 * e 3.9798408154464964 #2: 2.0 * e * (sqrt(3.0) -1.0) 3.979840815446496 I was wondering what exactly is failing here. The math module? Python, or the IEEE specifications? Limited-precision calculation, computer floating-point for

Re: Python fails on math

2011-02-22 Thread Tim Wintle
On Tue, 2011-02-22 at 05:20 -0800, christian schulze wrote: [code] from math import e as e from math import sqrt as sqrt 2*e*sqrt(3) - 2*e == 2*e*(sqrt(3) - 1) False [/code] I was wondering what exactly is failing here. The math module? Python, or the IEEE specifications? I'm not sure

Re: Python fails on math

2011-02-22 Thread Benjamin Kaplan
On Tue, Feb 22, 2011 at 8:20 AM, christian schulze xcr...@googlemail.com wrote: Hey guys, I just found out, how much Python fails on simple math. I checked a simple equation for a friend. [code] from math import e as e from math import sqrt as sqrt 2*e*sqrt(3) - 2*e == 2*e*(sqrt(3) - 1)

Re: Python fails on math

2011-02-22 Thread Ian
On 22/02/2011 13:20, christian schulze wrote: Hey guys, I just found out, how much Python fails on simple math. I checked a simple equation for a friend. [code] from math import e as e from math import sqrt as sqrt 2*e*sqrt(3) - 2*e == 2*e*(sqrt(3) - 1) False [/code] So WTF? The equation is

Re: Python fails on math

2011-02-22 Thread Jean-Michel Pichavant
christian schulze wrote: Hey guys, I just found out, how much Python fails on simple math. I checked a simple equation for a friend. [code] from math import e as e from math import sqrt as sqrt 2*e*sqrt(3) - 2*e == 2*e*(sqrt(3) - 1) e has no accurate representation in computer science.

Re: ImportError: No module named gobject

2011-02-22 Thread J. Gerlach
Am 21.02.2011 16:04, schrieb Luther: I've tried installing pygtk, pygobject, and gobject-introspection from source, but none of them will compile, and nothing I install through synaptic has any effect. I've tried too many things to post all the details here, but I'll post any details on

Re: Python fails on math

2011-02-22 Thread Duncan Booth
christian schulze xcr...@googlemail.com wrote: Hey guys, I just found out, how much Python fails on simple math. I checked a simple equation for a friend. [code] from math import e as e from math import sqrt as sqrt 2*e*sqrt(3) - 2*e == 2*e*(sqrt(3) - 1) False [/code] Try the same

Re: Python 2 or 3 ? with Django , My SQL and YUI

2011-02-22 Thread Dhaivat Pandya
On Feb 21, 11:01 pm, Sumit sumit1...@gmail.com wrote: Python 2 or 3 ? with Django , My SQL and YUI For a web project We have decided to work on Python 2 or 3 ? with Django , My SQL and YUI, and this would be the first time to work with Python, just now I explored a little and found Python -2

PY-Tkinter Title Bar Icon

2011-02-22 Thread Ganesh Kumar
Hai.. I am new to python Tkinter..I want Title Bar Icon.. plz..Guide me to set up icon in Title Bar. Advance Thanks Thanks -Ganesh. -- Did I learn something today? If not, I wasted it. -- http://mail.python.org/mailman/listinfo/python-list

Re: ImportError: No module named gobject

2011-02-22 Thread Benjamin Kaplan
On Tue, Feb 22, 2011 at 9:20 AM, J. Gerlach gerlach_jo...@web.de wrote: Am 21.02.2011 16:04, schrieb Luther: I've tried installing pygtk, pygobject, and gobject-introspection from source, but none of them will compile, and nothing I install through synaptic has any effect. I've tried too

Re: ANN: pyTenjin 1.0.0 - a high-speed and full-featured template engine

2011-02-22 Thread Dhaivat Pandya
On Feb 21, 8:15 pm, Makoto Kuwata k...@kuwata-lab.com wrote: Hi all, I released pyTenjin 1.0.0.http://pypi.python.org/pypi/Tenjin/http://www.kuwata-lab.com/tenjin/ This release contains a lot of enhancements and changes. Overview * Very fast: about 10 times faster than Django

Re: How to use Python well?

2011-02-22 Thread Grant Edwards
On 2011-02-20, Chris Jones cjns1...@gmail.com wrote: On Sat, Feb 19, 2011 at 05:27:24PM EST, Cameron Simpson wrote: [..] Any yet I (and others, based on stuff I've seen) find info to be a disaster. Why? - it forces the reader to use a non-standard pager to look at info, typically the

Re: PY-Tkinter Title Bar Icon

2011-02-22 Thread Terry Reedy
On 2/21/2011 7:06 AM, Ganesh Kumar wrote: Hai.. I am new to python Tkinter..I want Title Bar Icon.. plz..Guide me to set up icon in Title Bar. Search the tkinter doc for 'icon'. Then look at one of the references for details. -- Terry Jan Reedy --

Re: Making Line Graphs

2011-02-22 Thread Paul Anton Letnes
Den 21.02.11 10.34, skrev Jean-Michel Pichavant: spam head wrote: I'm looking for an easy way to display simple line graphs generated by a python program in Windows. It could be done from within the program, or I could write the information out to a file and call an external program. Either is

reading lines from non-terminating subprocess; threading, gtk

2011-02-22 Thread jfcg
Greetings, I am using Python 2.6 on Ubuntu. I have a problem with simultaneously reading lines from stdout of a subprocess. listargs.c: #include stdio.h #include unistd.h int main (int argc, char ** argv) { int i; // while (1) for (i=0; iargc; i++) { puts

Re: Making Line Graphs

2011-02-22 Thread Andrea Crotti
On Feb 22, 4:28 pm, Paul Anton Letnes paul.anton.let...@gmail.com wrote: +1, I like matplotlib a lot. Consider python(x,y) as an easy install path. It both shows plots interactively and let you save to file. I even use it for publications. Paul. +1 for matplotlib, incredibly powerful and

Re: Whats new in Python 3: concurrent-futures example error?

2011-02-22 Thread Terry Reedy
On 2/22/2011 4:45 AM, Paddy wrote: I just noted the example here: http://docs.python.org/dev/whatsnew/3.2.html#pep-3148-the-concurrent-futures-module import concurrent.futures, shutil with concurrent.futures.ThreadPoolExecutor(max_workers=4) as e: e.submit(shutil.copy, 'src1.txt',

Re: Creating Long Lists

2011-02-22 Thread Terry Reedy
On 2/22/2011 4:40 AM, Kelson Zawack wrote: The answer it turns out is the garbage collector. When I disable the garbage collector before the loop that loads the data into the list and then enable it after the loop the program runs without issue. This raises a question though, can the logic of

Re: Tkinter Text Widget Background Color

2011-02-22 Thread Terry Reedy
On 2/22/2011 6:50 AM, Peter Otten wrote: import Tkinter as tk from itertools import cycle root = tk.Tk() text = tk.Text(root, font=(Helvetica, 70)) text.pack() text.insert(tk.END, Hello, geocities) text.tag_add(initial, 1.0, 1.1) text.tag_add(initial, 1.7, 1.8) colors = cycle(red yellow

Re: Python fails on math

2011-02-22 Thread David C. Ullrich
In article 127fc97e-c210-4df1-952c-f6383d44b...@o8g2000vbq.googlegroups.com, christian schulze xcr...@googlemail.com wrote: Hey guys, I just found out, how much Python fails on simple math. I checked a simple equation for a friend. [code] from math import e as e from math import

Installing dependencies in Windows

2011-02-22 Thread RVince
Im installing to a Win7 machine, duplicating a CentOS setup. The dependences in CentOs for a particular project are: _ldap.so dsml.py easy-install.pth ldap ldapurl.py ldapurl.pyc ldapurl.pyo ldif.py libxml2.py libxml2.pyc libxml2mod.a libxml2mod.la libxml2mod.so libxslt.py libxslt.pyc libxsltmod.a

Re: Tkinter Text Widget Background Color

2011-02-22 Thread Jeff Hobbs
On Feb 22, 8:48 am, Terry Reedy tjre...@udel.edu wrote: On 2/22/2011 6:50 AM, Peter Otten wrote: import Tkinter as tk from itertools import cycle root = tk.Tk() text = tk.Text(root, font=(Helvetica, 70)) text.pack() text.insert(tk.END, Hello, geocities) text.tag_add(initial, 1.0,

Re: Tkinter Text Widget Background Color

2011-02-22 Thread Peter Otten
Terry Reedy wrote: On 2/22/2011 6:50 AM, Peter Otten wrote: import Tkinter as tk from itertools import cycle root = tk.Tk() text = tk.Text(root, font=(Helvetica, 70)) text.pack() text.insert(tk.END, Hello, geocities) text.tag_add(initial, 1.0, 1.1) text.tag_add(initial, 1.7, 1.8)

Re: Tkinter Text Widget Background Color

2011-02-22 Thread Sathish S
Jeff, Thanks a lot. It worked great for me as well. Thanks, Sathish On Tue, Feb 22, 2011 at 10:28 PM, Jeff Hobbs jeff.ho...@gmail.com wrote: On Feb 22, 8:48 am, Terry Reedy tjre...@udel.edu wrote: On 2/22/2011 6:50 AM, Peter Otten wrote: import Tkinter as tk from itertools import

Dynamic imports + relative imports in Python 3

2011-02-22 Thread zildjohn01
This is a copy-paste of a StackOverflow question. Nobody answered there, but I figured I might have better luck here. I have a Python 3 project where I'm dynamically importing modules from disk, using `imp.load_module`. But, I've run into an problem where relative imports fail, when the relative

Re: Tkinter Text Widget Background Color

2011-02-22 Thread Sathish S
Oops, i got the wrong person. Thanks Peter. I was able to achieve the blinking functionality. Thanks, Sathish On Tue, Feb 22, 2011 at 10:44 PM, Peter Otten __pete...@web.de wrote: Terry Reedy wrote: On 2/22/2011 6:50 AM, Peter Otten wrote: import Tkinter as tk from itertools import

Re: Python fails on math

2011-02-22 Thread Grant Edwards
On 2011-02-22, christian schulze xcr...@googlemail.com wrote: Hey guys, I just found out, how much Python fails on simple math. Python doesn't do math. It does floating point operations. They're different. Seriously. On all of the platforms I know of, it's IEEE 754 (base-2) floating point.

Re: running Python code from external application

2011-02-22 Thread Santoso Wijaya
Sounds like an embedding job. Have you taken a look at this documentationhttp://docs.python.org/extending/ ? ~/santa On Tue, Feb 22, 2011 at 4:30 AM, Nadav Chernin nadavcher...@gmail.comwrote: Hello, I need to run Python code from external application. In this external application i have 2

Re: Python fails on math

2011-02-22 Thread Roy Smith
In article ik0rmr$ck4$1...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: Python doesn't do equations. Python does floating point operations. More generally, all general-purpose programming languages have the same problem. You'll see the same issues in Fortran, C, Java,

Re: Python fails on math

2011-02-22 Thread Ian Kelly
On Tue, Feb 22, 2011 at 9:54 AM, David C. Ullrich dullr...@sprynet.com wrote: Anyway, I don't know why you're jumping to the conclusion that it's Python that's wrong here. Could be the math you learned in school is wrong. I mean you're assuming that (*)       a(b+c) = ab + ac but what makes

How to compile on OS X PPC? was: Re: [RELEASED] Python 3.2

2011-02-22 Thread Irmen de Jong
On 20-02-11 23:22, Georg Brandl wrote: On behalf of the Python development team, I'm delighted to announce Python 3.2 final release. Thanks to all the people who worked on this. However, I'm having trouble compiling a framework build from source on Mac OS 10.5.8 on PowerPC. No matter what I

Re: How to compile on OS X PPC? was: Re: [RELEASED] Python 3.2

2011-02-22 Thread Benjamin Kaplan
On Tue, Feb 22, 2011 at 1:33 PM, Irmen de Jong ir...@-nospam-xs4all.nl wrote: On 20-02-11 23:22, Georg Brandl wrote: On behalf of the Python development team, I'm delighted to announce Python 3.2 final release. Thanks to all the people who worked on this. However, I'm having trouble

Re: python and parsing an xml file

2011-02-22 Thread Matt Funk
Hi, first of all thanks everyone for the (at least to me) valuable discussion about xml and its usage domain. Also thanks for all the hints and suggestions. In terms of my problems, from what i can tell right now the ConfigObj4 (see:

Re: python and parsing an xml file

2011-02-22 Thread Matt Funk
One thing i forgot, in case anyone is at this point: the reason i chose ConfigObj over ConfigParser is that it allows subsections. matt On 2/22/2011 4:01 AM, Ian wrote: On 21/02/2011 22:08, Matt Funk wrote: Why? mmmh. not sure how to answer this question exactly. I guess it's a design

Re: Python fails on math

2011-02-22 Thread Grant Edwards
On 2011-02-22, Roy Smith r...@panix.com wrote: In article ik0rmr$ck4$1...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: Python doesn't do equations. Python does floating point operations. More generally, all general-purpose programming languages have the same problem.

Re: Python fails on math

2011-02-22 Thread Grant Edwards
On 2011-02-22, Ian Kelly ian.g.ke...@gmail.com wrote: On Tue, Feb 22, 2011 at 9:54 AM, David C. Ullrich dullr...@sprynet.com wrote: Anyway, I don't know why you're jumping to the conclusion that it's Python that's wrong here. Could be the math you learned in school is wrong. I mean you're

Re: How to compile on OS X PPC? was: Re: [RELEASED] Python 3.2

2011-02-22 Thread Irmen de Jong
On 22-02-11 19:57, Benjamin Kaplan wrote: Have you tried compiling it with Macports? The port file is too much of a mess for me to figure out exactly what is getting called in what circumstances, but whatever they're doing probably works. I have not, and I don't intend to. I figure

Re: Installing dependencies in Windows

2011-02-22 Thread John Gordon
In b832cf61-7712-4101-a72d-777d2bdb7...@l14g2000pre.googlegroups.com RVince rvinc...@gmail.com writes: Im installing to a Win7 machine, duplicating a CentOS setup. The dependences in CentOs for a particular project are: _ldap.so dsml.py easy-install.pth ldap ldapurl.py ldapurl.pyc

Re: Whats new in Python 3: concurrent-futures example error?

2011-02-22 Thread Paddy
My thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python fails on math

2011-02-22 Thread Stephen Hansen
On 2/22/11 5:20 AM, christian schulze wrote: I just found out, how much Python fails on simple math. 2*e*sqrt(3) - 2*e == 2*e*(sqrt(3) - 1) Everyone else has answered very well, so I won't comment on the actual question at hand-- it seems to have been answered completely. But! I shall go all

Dictionary with additional attributes

2011-02-22 Thread goodman
Hi, my question is this: Is it a bad idea to create a wrapper class for a dictionary so I can add attributes? E.g.: class DictWithAttrs(dict): pass More information: I'm using a nested defaultdict to store a machine-learning model, where the first key is a class, the second key is a feature,

Re: How to compile on OS X PPC? was: Re: [RELEASED] Python 3.2

2011-02-22 Thread Benjamin Kaplan
On Tue, Feb 22, 2011 at 2:54 PM, Irmen de Jong ir...@-nospam-xs4all.nl wrote: On 22-02-11 19:57, Benjamin Kaplan wrote: Have you tried compiling it with Macports? The port file is too much of a mess for me to figure out exactly what is getting called in what circumstances, but whatever

Re: Python fails on math

2011-02-22 Thread sturlamolden
On 22 Feb, 14:20, christian schulze xcr...@googlemail.com wrote: Hey guys, I just found out, how much Python fails on simple math. I checked a simple equation for a friend. Python does not fail. Floating point arithmetics and numerical approximations will do this. If you need symbolic maths,

Re: How to compile on OS X PPC? was: Re: [RELEASED] Python 3.2

2011-02-22 Thread Irmen de Jong
On 22-02-11 21:27, Benjamin Kaplan wrote: There really isn't a Macports build. Macports just downloads the source tarball and compiles it locally. It's only doing three things compared to compiling it yourself: update checking, dependency tracking, and applying some patches for problems that

Re: Dictionary with additional attributes

2011-02-22 Thread Robert Kern
On 2/22/11 1:49 PM, goodman wrote: Hi, my question is this: Is it a bad idea to create a wrapper class for a dictionary so I can add attributes? Nope. I do recommend adding a custom __repr__(), though. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma

Re: Dictionary with additional attributes

2011-02-22 Thread Santoso Wijaya
Instead of inheriting a dict, why not composing a dict into your model class, like: class Model(object): def __init__(self, *args, **kwargs): self._probabilities = defaultdict(lambda: defaultdict(float)) @property def features(self): # insert

Re: Python fails on math

2011-02-22 Thread christian schulze
On 22 Feb., 21:18, Stephen Hansen me+list/pyt...@ixokai.io wrote: On 2/22/11 5:20 AM, christian schulze wrote: I just found out, how much Python fails on simple math. 2*e*sqrt(3) - 2*e == 2*e*(sqrt(3) - 1) Everyone else has answered very well, so I won't comment on the actual question at

Re: Pickle compatibility between Python 2.7 and python 3.2

2011-02-22 Thread Michel Claveau - MVP
Hi! I am, also, very interested in the answers. Thank you for asking this question. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

python cgi webpage won't redirect before background children processes finish

2011-02-22 Thread Yingjie Lin
Hi all, I have a python cgi script which looks like this: [CODE STARTING HERE] open('x') print 'Content-Type:nbsp;text/html\n\n' .. print 'meta http-equiv=refresh content=15;url=%s' % myURL .. ### after printing the webpage os.system('python myfile.py') logfile.write('END OF

Re: python and parsing an xml file

2011-02-22 Thread John Nagle
On 2/21/2011 2:08 PM, Matt Funk wrote: Hi Terry, On 2/21/2011 11:22 AM, Terry Reedy wrote: On 2/21/2011 12:30 PM, Matt Funk wrote: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Why? mmmh. not sure how to answer

ctypes inheritance issue

2011-02-22 Thread Steve
I've filed a bug in python but I wanted to see if other ctypes users/ experts viewed this issue as a bug. Consider the following: python code: import ctypes class my_array( ctypes.Array ): _type_= ctypes.c_uint8 _length_ = 256 class my_array2( my_array ): pass Output: class

subprocess pipe question

2011-02-22 Thread Rita
I have a process like this, def run(cmd): #cmd=a process which writes a lot of data. Binary/ASCII data p=subprocess.Popen(cmd,stdout=subprocess.PIPE) I would like to get cmd's return code so I am doing this, def run(cmd): p=subprocess.Popen(cmd,stdout=subprocess.PIPE) rc=p.poll()

ANN: ActivePython 3.2.0.0 is now available

2011-02-22 Thread Sridhar Ratnakumar
ActiveState is pleased to announce ActivePython 3.2.0.0, a complete, ready-to-install binary distribution of Python 3.2. http://www.activestate.com/activepython/downloads What's New in ActivePython-3.2.0.0 == New Features Upgrades --- -

Re: subprocess pipe question

2011-02-22 Thread GMail Felipe
On 22/02/2011, at 20:44, Rita rmorgan...@gmail.com wrote: I have a process like this, def run(cmd): #cmd=a process which writes a lot of data. Binary/ASCII data p=subprocess.Popen(cmd,stdout=subprocess.PIPE) I would like to get cmd's return code so I am doing this, def run(cmd):

Re: subprocess pipe question

2011-02-22 Thread Chris Kaynor
On Tue, Feb 22, 2011 at 3:44 PM, Rita rmorgan...@gmail.com wrote: I have a process like this, def run(cmd): #cmd=a process which writes a lot of data. Binary/ASCII data p=subprocess.Popen(cmd,stdout=subprocess.PIPE) I would like to get cmd's return code so I am doing this, def

Python programming books

2011-02-22 Thread David Keeler
I am relatively new to python. I've been reading online docs and tutorials for 4-5 weeks now, but I like actual books. I am not new to programming and I have worked with quite a few languages. I'd like a good reference with basic stuff including classes and maybe some web programming, sockets,

Re: subprocess pipe question

2011-02-22 Thread Rob Williscroft
Rita wrote in news:AANLkTi=w95gxosc1tkt2bntgjqys1cbmdnojhokq4...@mail.gmail.com in gmane.comp.python.general: When using wait() it works a bit better but not consistent def run(cmd): p=subprocess.Popen(cmd,stdout=subprocess.PIPE) rc=p.wait() print rc return p.stdout When the

Re: Python fails on math

2011-02-22 Thread Terry Reedy
On 2/22/2011 2:42 PM, Grant Edwards wrote: Except that Python (and computer languages in general) don't deal with real numbers. They deal with floating point numbers, which aren't the same thing. [In case anybody is still fuzzy about that.] In particular, floats are a fixed finite set of

C12

2011-02-22 Thread Verde Denim
Anyone on the list have decent knowledge of C12 ? Please send me an email if you've got knowledge in this area. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to compile on OS X PPC? was: Re: [RELEASED] Python 3.2

2011-02-22 Thread Ned Deily
In article 4d640175$0$81482$e4fe5...@news.xs4all.nl, Irmen de Jong ir...@-nospam-xs4all.nl wrote: However, I'm having trouble compiling a framework build from source on Mac OS 10.5.8 on PowerPC. No matter what I try (gcc 4.0, gcc 4.2, different compiler options), the compilation aborts with

Re: Python programming books

2011-02-22 Thread Terry Reedy
On 2/22/2011 7:54 PM, David Keeler wrote: I am relatively new to python. I've been reading online docs and tutorials for 4-5 weeks now, but I like actual books. I am not new to programming and I have worked with quite a few languages. I'd like a good reference with basic stuff including classes

Re: Dictionary with additional attributes

2011-02-22 Thread goodman
On Feb 22, 1:32 pm, Robert Kern robert.k...@gmail.com wrote: On 2/22/11 1:49 PM, goodman wrote: Hi, my question is this: Is it a bad idea to create a wrapper class for a dictionary so I can add attributes? Nope. I do recommend adding a custom __repr__(), though. Good point. Thanks --

Re: subprocess pipe question

2011-02-22 Thread Rita
Thanks everyone for your replies. Chris, Unfortunately, I can't redirect the output to a file because there are other processes which use this processes output as stdin. Rob, I will give this a try. On Tue, Feb 22, 2011 at 7:48 PM, Chris Kaynor ckay...@zindagigames.comwrote: On Tue, Feb

Is setdefaultencoding bad?

2011-02-22 Thread moerchendiser2k3
Hi, I embedded Py2.6.1 in my app and I use UTF-8 encoded strings everywhere in the interface, so the interface between my app and Python is UTF-8 so I can simply write: print u\uC042 print u\uC042.encode(utf_8) and get the corresponding chinese char in the console. But currently

Re: Is setdefaultencoding bad?

2011-02-22 Thread Nobody
On Tue, 22 Feb 2011 19:34:21 -0800, moerchendiser2k3 wrote: Hi, I embedded Py2.6.1 in my app and I use UTF-8 encoded strings everywhere in the interface, so the interface between my app and Python is UTF-8 so I can simply write: print u\uC042 print u\uC042.encode(utf_8) and get the

Re: Python programming books

2011-02-22 Thread John Bokma
David Keeler dkeeler2...@sbcglobal.net writes: I am relatively new to python. I've been reading online docs and tutorials for 4-5 weeks now, but I like actual books. I am not new to programming and I have worked with quite a few languages. I'd like a good reference with basic stuff including

Accelerating For Loop

2011-02-22 Thread Şansal Birbaş
Hi All, I needed to find the cheapest combination among given data and I developed an algorithm for this task. It works correctly. But it takes much time (nearly 2 minutes) for second function to find the result while it is just one second for the first function. How can I improve the

Re: ctypes inheritance issue

2011-02-22 Thread Carl Banks
Steve wrote: I've filed a bug in python but I wanted to see if other ctypes users/ experts viewed this issue as a bug. Consider the following: python code: import ctypes class my_array( ctypes.Array ): _type_= ctypes.c_uint8 _length_ = 256 class my_array2( my_array ):

Re: python and parsing an xml file

2011-02-22 Thread Stefan Behnel
John Nagle, 22.02.2011 23:56: On 2/21/2011 2:08 PM, Matt Funk wrote: On 2/21/2011 11:22 AM, Terry Reedy wrote: On 2/21/2011 12:30 PM, Matt Funk wrote: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Why? mmmh. not

Looking for some PyPI query help

2011-02-22 Thread Travis Griggs
Howdy Python brethren. I'm a Smalltalker, doing a bit of research on packaging ecospaces, in other languages and environments (I just finished examining Debian for example). I found what seems to be the big repository at PyPI. What would be enough for me, is to enumerate all of the packages

Re: Looking for some PyPI query help

2011-02-22 Thread Martin v. Loewis
Am 23.02.2011 07:53, schrieb Travis Griggs: Howdy Python brethren. I'm a Smalltalker, doing a bit of research on packaging ecospaces, in other languages and environments (I just finished examining Debian for example). I found what seems to be the big repository at PyPI. Correct. There is a

Another lxml.objectify question

2011-02-22 Thread Johann Spies
Stefan has helped me in the past to make some progress on using lxml.objectify. I am trying to parse xml to create sql-compatible data. My problem is that the xml records are not consistant: some might have tags that does not appear in others. That makes it very difficult for me to setup an

Re: Accelerating For Loop

2011-02-22 Thread Chris Rebert
2011/2/22 Şansal Birbaş sansal.bir...@alarko-carrier.com.tr: Hi All, I needed to find the cheapest combination among given data and I developed an algorithm for this task. It works correctly. But it takes much time (nearly 2 minutes) for second function to find the result while it is just

RE: Accelerating For Loop

2011-02-22 Thread Şansal Birbaş
Nothing changed, Mr. Chris -Original Message- From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert Sent: Wednesday, February 23, 2011 9:37 AM To: Şansal Birbaş Cc: python-list@python.org Subject: Re: Accelerating For Loop 2011/2/22 Şansal Birbaş

[issue11283] incorrect pattern in the re module docs for conditional regex

2011-02-22 Thread wesley chun
New submission from wesley chun wes...@gmail.com: In the re docs, it states the following for the conditional regular expression syntax: (?(id/name)yes-pattern|no-pattern) Will try to match with yes-pattern if the group with given id or name exists, and with no-pattern if it doesn’t.

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Xavier Morel
Xavier Morel xavier.mo...@masklinn.net added the comment: Do tests currently exist for smtpd run as a script? I have to confess I didn't think to check. If not, our experience with converting compileall to argparse indicates a thorough test suite is needed (and even so we missed some

[issue11284] slow close file descriptors in subprocess, popen2, os.pepen*

2011-02-22 Thread s7v7nislands
New submission from s7v7nislands s7v7nisla...@gmail.com: when use popen*() and close_fds is True, python will close unused fds. but the MAXFD is not the real max. especially in freebsd, subprocess.MAXFD=655000. so python will try to close to many fd, it's too slow, in my test on freebsd,

[issue11284] slow close file descriptors in subprocess, popen2, os.pepen*

2011-02-22 Thread s7v7nislands
Changes by s7v7nislands s7v7nisla...@gmail.com: Added file: http://bugs.python.org/file20835/python27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11284 ___

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Xavier, I think these efforts are misguided in several ways: * Many of the undocumented command-line interfaces are intentionally undocumented -- they were there for the convenience of the developer for exercising the module

  1   2   3   >