ANN: Portable Python 1.1 released

2009-03-23 Thread Perica Zivkovic
Included in this release: - This release contains three different packages for three different Python versions – Python 2.5.4, Python 2.6.1 and Python 3.0.1. Packages are totally independent and can run side-by-side each other or any other Python installation. Software

EuroSciPy 2009, Leipzig, Germany, July 25-26

2009-03-23 Thread Mike Müller
EuroSciPy 2009 == We're pleased to announce the EuroSciPy 2009 Conference to be held in Leipzig, Germany on July 25-26, 2009. http://www.euroscipy.org This is the second conference after the successful conference last year. Again, EuroSciPy will be a venue for the European

Paver 1.0 released

2009-03-23 Thread Kevin Dangoor
After months of use in production and about two months of public testing for 1.0, Paver 1.0 has been released. The changes between Paver 0.8.1, the most recent stable release, and 1.0 are quite significant. Paver 1.0 is easier, cleaner, less magical and just better all around. The backwards

pylint 0.17.0 and astng 0.18.0 release

2009-03-23 Thread Emile Anclin
Hello, we are glad to announce the release of pylint 0.17.0 http://www.logilab.org/project/pylint/0.17.0 which is based on a major refactoring of astng (0.18.0) http://www.logilab.org/project/logilab-astng/0.18.0 . For python 2.5, pylint will now use python's _ast module which is much faster

Re: file.read() doesn't read the whole file

2009-03-23 Thread Sreejith K
Try and write an example that shows the problem in fifteen lines or less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r') snap.seek(offset) data =

Re: file.read() doesn't read the whole file

2009-03-23 Thread Sreejith K
Try and write an example that shows the problem in fifteen lines or less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r') snap.seek(offset) data =

how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread valpa
I only need the 3 digits after '.' Is there any way other than converting from/to string? -- http://mail.python.org/mailman/listinfo/python-list

Re: file.read() doesn't read the whole file

2009-03-23 Thread Sreejith K
Try and write an example that shows the problem in fifteen lines or less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r') snap.seek(offset) data =

How can I do bit operation on python float value

2009-03-23 Thread valpa
I have a python float 1.2345678. I know that it is stored as a double in C type. And I know it actually is 1010101010101 -like format. Then I want to do some bit operation on it. How? Sure, I want a float output when I finish the operation. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread alex23
On Mar 23, 4:40 pm, valpa valpass...@gmail.com wrote: I only need the 3 digits after '.' Is there any way other than converting from/to string? I'm not sure if this is the canonical way but it works: d = Decimal('1.23456789') three_places = Decimal('0.001') # or anything that has the

Re: Unicode problem in ucs4

2009-03-23 Thread abhi
On Mar 20, 5:47 pm, M.-A. Lemburg m...@egenix.com wrote: On 2009-03-20 12:13, abhi wrote: On Mar 20, 11:03 am, Martin v. Löwis mar...@v.loewis.de wrote: Any idea on why this is happening? Can you provide a complete example? Your code looks correct, and should just work. How do you

Re: How can I do bit operation on python float value

2009-03-23 Thread John Machin
On Mar 23, 5:44 pm, valpa valpass...@gmail.com wrote: I have a python float 1.2345678. I know that it is stored as a double in C type. And I know it actually is 1010101010101 -like format. Then I want to do some bit operation on it. How? Sure, I want a float output when I finish the

Re: how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread Hyunchul Kim
In that case, I usually use # when rounding is proper, s = '1.23456789' print round(float(s)) or # when cut out is proper, from math import floor print floor(float(s)*1000)/1000 Hyunchul valpa wrote: I only need the 3 digits after '.' Is there any way other than converting from/to string?

Re: how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread Steven D'Aprano
On Sun, 22 Mar 2009 23:40:38 -0700, valpa wrote: I only need the 3 digits after '.' Is there any way other than converting from/to string? You should Read the Fine Manual: http://docs.python.org/library/decimal.html [quote] The quantize() method rounds a number to a fixed exponent. This

Re: splitting a large dictionary into smaller ones

2009-03-23 Thread Steven D'Aprano
On Sun, 22 Mar 2009 23:10:21 -0400, Terry Reedy wrote: Searching for a key in, say, 10 dicts will be slower than searching for it in just one. The only reason I would do this would be if the dict had to be split, say over several machines. But then, you could query them in parallel. That

Re: lipo: can't figure out the architecture type of

2009-03-23 Thread VJ
On Mar 19, 4:48 pm, Vijayendra Bapte vijayendra.ba...@gmail.com wrote: Hi, I am getting an gcc compilation error while installing FSEvents (http://pypi.python.org/packages/source/p/pyobjc-framework-FSEvents/ pyobjc-framework-FSEvents-2.2b1.tar.gz) package on my Mac (OS X 10.4.11, Intel Core

Re: Unicode problem in ucs4

2009-03-23 Thread John Machin
On Mar 23, 6:18 pm, abhi abhigyan_agra...@in.ibm.com wrote: [snip] Hi Mark,      Thanks for the help. I tried PyUnicode_AsWideChar() but I am getting the same result i.e. only the first letter. sample code: #includePython.h static PyObject *unicode_helper(PyObject *self,PyObject *args){

Re: Async serial communication/threads sharing data

2009-03-23 Thread Hendrik van Rooyen
Nick Craig-Wood ni...g-wood.com wrote: I wrote a serial port to TCP proxy (with logging) with twisted. The problem I had was that twisted serial ports didn't seem to have any back pressure. By that I mean I could pump data into a 9600 baud serial port at 10 Mbit/s. Twisted would then

Re: Unicode problem in ucs4

2009-03-23 Thread John Machin
On Mar 23, 6:41 pm, John Machin sjmac...@lexicon.net had a severe attack of backslashitis: [presuming littleendian] The ucs4 string will look like \t\0\0\0e \0\0\0s\0\0\0t\0\0\0 in memory. I suspect that your wprintf is grokking only 16-bit doodads -- \t\0 is printed and then \0\0 is

Re: splitting a large dictionary into smaller ones

2009-03-23 Thread John Machin
On Mar 23, 1:32 pm, per perfr...@gmail.com wrote: hi all, i have a very large dictionary object that is built from a text file that is about 800 MB -- it contains several million keys.  ideally i would like to pickle this object so that i wouldnt have to parse this large file to compute the

Re: how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread Mark Dickinson
On Mar 23, 7:01 am, alex23 wuwe...@gmail.com wrote: On Mar 23, 4:40 pm, valpa valpass...@gmail.com wrote: I only need the 3 digits after '.' Is there any way other than converting from/to string? I'm not sure if this is the canonical way but it works: d = Decimal('1.23456789')

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-23 Thread Tim Golden
venutaurus...@gmail.com wrote: On Mar 21, 3:05 pm, Tim Golden m...@timgolden.me.uk wrote: venutaurus...@gmail.com wrote: Thank you Sir for your reply. It is working for me. But is failing if I have Unicode characters in my path. I tried giving a 'u' in front of the path but still it fails at

Re: How can I do bit operation on python float value

2009-03-23 Thread valpa
On 3月23日, 上午3时18分, John Machin sjmac...@lexicon.net wrote: On Mar 23, 5:44 pm, valpa valpass...@gmail.com wrote: I have a python float 1.2345678. I know that it is stored as a double in C type. And I know it actually is 1010101010101 -like format. Then I want to do some bit operation on

Re: python 3, subclassing TextIOWrapper.

2009-03-23 Thread lambertdw
For D. Murray's suggestion---I think that we programmers have to learn the idiom. We don't always control open, such as subprocess.Popen(). Thank you. I hope these thoughts help with issue 5513 and the related questions to follow about complete removal of file in python3. Opening the file in

Re: how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread Mark Dickinson
On Mar 23, 6:40 am, valpa valpass...@gmail.com wrote: I only need the 3 digits after '.' Is there any way other than converting from/to string? And in Python 3.0, just use the built-in round function: from decimal import Decimal round(Decimal('1.23456789'), 3) Decimal('1.235') This uses

Re: How can I do bit operation on python float value

2009-03-23 Thread Mark Dickinson
On Mar 23, 8:44 am, valpa valpass...@gmail.com wrote: Yes, I want to do a operation. Right, but what operation, and why? Are you trying to do something that's mathematically meaningful? If so, there may be a better (more portable/faster/clearer) way than bit-twiddling. Mark --

Re: Unicode problem in ucs4

2009-03-23 Thread M.-A. Lemburg
On 2009-03-23 08:18, abhi wrote: On Mar 20, 5:47 pm, M.-A. Lemburg m...@egenix.com wrote: unicodeTest.c #includePython.h static PyObject *unicode_helper(PyObject *self,PyObject *args){ PyObject *sampleObj = NULL; Py_UNICODE *sample = NULL; if (!PyArg_ParseTuple(args, O,

Re: how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread Mensanator
On Mar 23, 2:24�am, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Sun, 22 Mar 2009 23:40:38 -0700, valpa wrote: I only need the 3 digits after '.' Is there any way other than converting from/to string? You should Read the Fine Manual:

Re: Async serial communication/threads sharing data

2009-03-23 Thread Nick Craig-Wood
Jean-Paul Calderone exar...@divmod.com wrote: On Sun, 22 Mar 2009 12:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: I wrote a serial port to TCP proxy (with logging) with twisted. The problem I had was that twisted serial ports didn't seem to have any back pressure. By that I

Re: How can I do bit operation on python float value

2009-03-23 Thread John Machin
On Mar 23, 7:44 pm, valpa valpass...@gmail.com wrote: On 3月23日, 上午3时18分, John Machin sjmac...@lexicon.net wrote: On Mar 23, 5:44 pm, valpa valpass...@gmail.com wrote: I have a python float 1.2345678. I know that it is stored as a double in C type. And I know it actually is

Re: How can I do bit operation on python float value

2009-03-23 Thread Miles
On Mon, Mar 23, 2009 at 2:44 AM, valpa wrote: I have a python float 1.2345678. I know that it is stored as a double in C type. And I know it actually is 1010101010101 -like format. Then I want to do some bit operation on it. How? Sure, I want a float output when I finish the operation. Just

Re: how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread Steven D'Aprano
On Mon, 23 Mar 2009 01:45:53 -0700, Mensanator wrote: but you can create a helper function very easily: def round(dec, places, rounding=decimal.ROUND_HALF_UP): � � return dec.quantize(decimal.Decimal(str(10**-places)), rounding) Still ugly. I would do this: a = Decimal('1.23456789')

Re: Unicode problem in ucs4

2009-03-23 Thread abhi
On Mar 23, 3:04 pm, M.-A. Lemburg m...@egenix.com wrote: On 2009-03-23 08:18, abhi wrote: On Mar 20, 5:47 pm, M.-A. Lemburg m...@egenix.com wrote: unicodeTest.c #includePython.h static PyObject *unicode_helper(PyObject *self,PyObject *args){    PyObject *sampleObj = NULL;          

Re: Safe to call Py_Initialize() frequently?

2009-03-23 Thread Mark Hammond
On 23/03/2009 12:14 PM, Graham Dumpleton wrote: On Mar 21, 10:27 am, Mark Hammondskippy.hamm...@gmail.com wrote: Calling Py_Initialize and Py_Finalize multiple times does leak (Python 3 has mechanisms so this need to always be true in the future, but it is true now for non-trivial apps.

Re: splitting a large dictionary into smaller ones

2009-03-23 Thread Dave Angel
As others have said, a database is probably the right answer. There, the data is kept on disk, and only a few records at a time are read for each access, with modification transactions usually being synchronous. However, there are use cases where your approach makes more sense. And it

Re: Safe to call Py_Initialize() frequently?

2009-03-23 Thread Graham Dumpleton
On Mar 23, 10:00 pm, Mark Hammond skippy.hamm...@gmail.com wrote: On 23/03/2009 12:14 PM, Graham Dumpleton wrote: On Mar 21, 10:27 am, Mark Hammondskippy.hamm...@gmail.com  wrote: Calling Py_Initialize and Py_Finalize multiple times does leak (Python 3 has mechanisms so this need to

Re: splitting a large dictionary into smaller ones

2009-03-23 Thread Dave Angel
As others have said, a database is probably the right answer. There, the data is kept on disk, and only a few records at a time are read for each access, with modification transactions usually being synchronous. However, there are use cases where your approach makes more sense. And it

Re: Using python 3 for scripting?

2009-03-23 Thread Timo Myyrä
Not too keen on working with Solaris either. Did some small configuration last time I worked there and it was all a mess. I'm trying to convince them to switch to OpenBSD :) Timo -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode problem in ucs4

2009-03-23 Thread M.-A. Lemburg
On 2009-03-23 11:50, abhi wrote: On Mar 23, 3:04 pm, M.-A. Lemburg m...@egenix.com wrote: Thanks Marc, John, With your help, I am at least somewhere. I re-wrote the code to compare Py_Unicode and wchar_t outputs and they both look exactly the same. #includePython.h static

Re: Style formating of multiline query, advise

2009-03-23 Thread someon
On Mar 19, 10:26 am, Marco Mariani ma...@sferacarta.com wrote: someone wrote: Also, for SQL, (A) why are you using nested joins?, and inner select produce smaller set which is then joined with other table, kind a optimization Did you time it? I've did explain on both kinds of query

Re: Unicode problem in ucs4

2009-03-23 Thread abhi
On Mar 23, 4:37 pm, M.-A. Lemburg m...@egenix.com wrote: On 2009-03-23 11:50, abhi wrote: On Mar 23, 3:04 pm, M.-A. Lemburg m...@egenix.com wrote: Thanks Marc, John,          With your help, I am at least somewhere. I re-wrote the code to compare Py_Unicode and wchar_t outputs and they

Escaping optional parameter in WHERE clause

2009-03-23 Thread someone
Hi, as you can see below I have some optional parameter for my query (mf, age). They are in WHERE clause only if not empty. In this function they are not escaped as, for example, 'search' parameter, cause I can't pass them to execute function, which does escaping automatically. I could write

Re: Async serial communication/threads sharing data

2009-03-23 Thread Jean-Paul Calderone
On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul Calderone exar...@divmod.com wrote: [snip] In the case of a TCP to serial forwarder, you don't actually have to implement either a producer or a consumer, since both the TCP connection and the serial

Looking for a Python Django Freelancer

2009-03-23 Thread dajor85...@googlemail.com
For a Python Google Apps Project with Django we are looking for a technical developer offsite. IF you are interesting please send your CV and rate to daniel.jor...@fellow-consulting.de -- http://mail.python.org/mailman/listinfo/python-list

Re: Escaping optional parameter in WHERE clause

2009-03-23 Thread MRAB
someone wrote: Hi, as you can see below I have some optional parameter for my query (mf, age). They are in WHERE clause only if not empty. In this function they are not escaped as, for example, 'search' parameter, cause I can't pass them to execute function, which does escaping automatically.

Re: Escaping optional parameter in WHERE clause

2009-03-23 Thread andrew cooke
note that your version is open to sql injection attacks, while mrab's reply isn't. andrew someone wrote: if mf: mf = AND mf = %s % mf if age: age = AND age = %s % age -- http://mail.python.org/mailman/listinfo/python-list

Re: splitting a large dictionary into smaller ones

2009-03-23 Thread Tim Chase
i have a very large dictionary object that is built from a text file that is about 800 MB -- it contains several million keys. ideally i would like to pickle this object so that i wouldnt have to parse this large file to compute the dictionary every time i run my program. however currently the

Re: Escaping optional parameter in WHERE clause

2009-03-23 Thread andrew cooke
ah, sorry, from title i guess you were aware of this. andrew andrew cooke wrote: note that your version is open to sql injection attacks, while mrab's reply isn't. andrew someone wrote: if mf: mf = AND mf = %s % mf if age: age = AND age = %s

Re: Escaping optional parameter in WHERE clause

2009-03-23 Thread someon
On Mar 23, 1:48 pm, MRAB goo...@mrabarnett.plus.com wrote: someone wrote: Hi, as you can see below I have some optional parameter for my query (mf, age). They are in WHERE clause only if not empty. In this function they are not escaped as, for example, 'search' parameter, cause I can't

Portable Python 1.1 released

2009-03-23 Thread Perica Zivkovic
Dear people, Portable Python 1.1 is released in three flavors: Python 2.5.4, 2.6.1 and 3.0.1. More information: Included in this release: - This release contains three different packages for three different Python versions – Python 2.5.4, Python 2.6.1 and Python 3.0.1.

Re: Unicode problem in ucs4

2009-03-23 Thread abhi
On Mar 23, 4:57 pm, abhi abhigyan_agra...@in.ibm.com wrote: On Mar 23, 4:37 pm, M.-A. Lemburg m...@egenix.com wrote: On 2009-03-23 11:50, abhi wrote: On Mar 23, 3:04 pm, M.-A. Lemburg m...@egenix.com wrote: Thanks Marc, John,          With your help, I am at least somewhere. I

Re: file.read() doesn't read the whole file

2009-03-23 Thread R. David Murray
Sreejith K sreejith...@gmail.com wrote: Try and write an example that shows the problem in fifteen lines or less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r')

Re: file.read() doesn't read the whole file

2009-03-23 Thread Steve Holden
Sreejith K wrote: Try and write an example that shows the problem in fifteen lines or less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r') snap.seek(offset)

Re: what features would you like to see in 2to3?

2009-03-23 Thread Steve Holden
Kay Schluehr wrote: On 22 Mrz., 20:39, Benjamin Peterson benja...@python.org wrote: It's GSoC time again, and I've had lots of interested students asking about doing on project on improving 2to3. What kinds of improvements and features would you like to see in it which student programmers

Re: script files with python (instead of tcsh/bash)?

2009-03-23 Thread Esmail
MRAB wrote: Two quick questions: As a replacement for grep I would use the re module and its methods? What about awk which I regularly use to extract fields based on position but not column number, what should I be using in Python to do the same? Just use string slicing. Would that be

Re: splitting a large dictionary into smaller ones

2009-03-23 Thread Steve Holden
per wrote: hi all, i have a very large dictionary object that is built from a text file that is about 800 MB -- it contains several million keys. ideally i would like to pickle this object so that i wouldnt have to parse this large file to compute the dictionary every time i run my

Re: script files with python (instead of tcsh/bash)?

2009-03-23 Thread Esmail
Hi Gabriel, Gabriel Genellina wrote: En Sun, 22 Mar 2009 11:05:22 -0300, MRAB goo...@mrabarnett.plus.com escribió: Esmail wrote: Nick Craig-Wood wrote: Esmail ebo...@hotmail.com wrote: .. As a replacement for grep I would use the re module and its methods? Perhaps; but strings have

Re: Escaping optional parameter in WHERE clause

2009-03-23 Thread Steve Holden
MRAB wrote: someone wrote: Hi, as you can see below I have some optional parameter for my query (mf, age). They are in WHERE clause only if not empty. In this function they are not escaped as, for example, 'search' parameter, cause I can't pass them to execute function, which does escaping

Re: script files with python (instead of tcsh/bash)?

2009-03-23 Thread Esmail
Hello again Nick, thanks for the additional script example. I was able to put something together where I read the whole file into a list as a series of lines (via readlines()) and then loop through the lines seeing if the target string was in the line .. seems to have worked reasonably well. I

Re: Lambda forms and scoping

2009-03-23 Thread R. David Murray
Gabriel Genellina gagsl-...@yahoo.com.ar wrote: However, I think that a Python closure is not quite the same thing as a 'computer science' closure, for the same reason that people coming from a language with variables-and-values as opposed to namespaces get confused when dealing with

Re: loading program's global variables in ipython

2009-03-23 Thread Esmail
Peter Otten wrote: Use %run -i myfile.py or execfile(myfile.py) # not ipython-specific thanks for these suggestions Peter, I have had exactly the same problem and was looking for a way around it -- this will be very helpful. Esmail ps: for some reason I am unable to post to the

Re: Generator

2009-03-23 Thread R. David Murray
John Posner jjpos...@snet.net wrote: [snip] If you want next(g) to yield 3, you'd have to do something like: g = (x for x in s[:]) where s[:] makes a copy of s that is then iterated over. BTW, this simpler statement works, too: g = iter(s[:]) Yes, but one

Relative Imports, why the hell is it so hard?

2009-03-23 Thread CinnamonDonkey
Hi All, I'm fairly new to Python so I still have a lot to learn. But I'd like to know how to correectly use relative imports. Please, please... please! don't go off on rants about why you think relative imports should not be used. I've got 15+ years in C++ and relative inclusion of other

Re: Relative Imports, why the hell is it so hard?

2009-03-23 Thread Maxim Khitrov
On Mon, Mar 23, 2009 at 10:16 AM, CinnamonDonkey cinnamondon...@googlemail.com wrote: Hi All, I'm fairly new to Python so I still have a lot to learn. But I'd like to know how to correectly use relative imports. Please, please... please! don't go off on rants about why you think relative

Re: Relative Imports, why the hell is it so hard?

2009-03-23 Thread skip
Please, please... please! don't go off on rants about why you think relative imports should not be used. I've got 15+ years in C++ and relative inclusion of other sections of code has never been a problem. As far as I am concerned what I am trying to do is perfectly

Re: Relative Imports, why the hell is it so hard?

2009-03-23 Thread CinnamonDonkey
Hi Guys, Thanx for the quick responses, it is very much appreciated! Skip, that's a good point about C++ != Python and I assure you I am very much aware of that ;-). Looking at http://www.python.org/dev/peps/pep-0328/#guido-s-decision would suggest, unless I am completely miss-understanding the

Re: [python-list] Re: Strange crash issue on Windows w/ PyGTK, Cairo...

2009-03-23 Thread CJ Kucera
CJ Kucera wrote: Okay, I've got a reproducible testcase of this available up here: http://apocalyptech.com/pygtk-zlib/ I'm no longer *totally* convinced that it's a zlib issue... zlib's call actually returns a valid string, and the error happens later in the app. Hello, again, list. One

Re: Relative Imports, why the hell is it so hard?

2009-03-23 Thread Maxim Khitrov
On Mon, Mar 23, 2009 at 11:22 AM, CinnamonDonkey cinnamondon...@googlemail.com wrote: Looking at http://www.python.org/dev/peps/pep-0328/#guido-s-decision would suggest, unless I am completely miss-understanding the example, that '.' refers to the current level and '..' pops up a level. That

Re: Relative Imports, why the hell is it so hard?

2009-03-23 Thread Gabriel Genellina
En Mon, 23 Mar 2009 12:22:21 -0300, CinnamonDonkey cinnamondon...@googlemail.com escribió:     \ App     |   main.py     +--\subpack1     |   |   __init__.py     |   |   module1.py     |     +--\subpack2     |   |   __init__.py     |   |   module2.py     Module1 needs to access

Re: pickle.load() extremely slow performance

2009-03-23 Thread Jim Garrison
Benjamin Peterson wrote: Terry Reedy tjreedy at udel.edu writes: 3.1a1 is out and I believe it has the io improvements. Massive ones, too. It'd be interesting to see your results on the alpha. On 3.1a1 the unpickle step takes 2.4 seconds, an 1875% improvement. Thanks. --

Re: Relative Imports, why the hell is it so hard?

2009-03-23 Thread CinnamonDonkey
My applogies if this is a silly question... but what makes something a package? and does that mean that what I am trying to do is not possible ? :( On 23 Mar, 15:53, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Mon, 23 Mar 2009 12:22:21 -0300, CinnamonDonkey  

Re: Relative Imports, why the hell is it so hard?

2009-03-23 Thread Maxim Khitrov
On Mon, Mar 23, 2009 at 12:19 PM, CinnamonDonkey cinnamondon...@googlemail.com wrote: My applogies if this is a silly question... but what makes something a package? and does that mean that what I am trying to do is not possible ? A package is a directory that has an __init__.py file. That

pylint 0.17.0 and astng 0.18.0 release

2009-03-23 Thread Emile Anclin
Hello, we are glad to announce the release of pylint 0.17.0 http://www.logilab.org/project/pylint/0.17.0 which is based on a major refactoring of astng (0.18.0) http://www.logilab.org/project/logilab-astng/0.18.0 . For python 2.5, pylint will now use python's _ast module which is much faster than

Re: Using python 3 for scripting?

2009-03-23 Thread Alan G Isaac
On 3/22/2009 12:41 PM Chris Rebert apparently wrote: 2.6.1, the latest non-3.x release is probably best. Most libraries haven't been ported to 3.x yet, so Python 3 has yet to become widespread. This seems slightly optimistic to me. Until a week ago, there was not a NumPy release for 2.6.

Re: Relative Imports, why the hell is it so hard?

2009-03-23 Thread Gabriel Genellina
En Mon, 23 Mar 2009 13:19:51 -0300, CinnamonDonkey cinnamondon...@googlemail.com escribió: My applogies if this is a silly question... but what makes something a package? A package is a directory with an __init__.py file [that Python is aware of]. and does that mean that what I am

Re: pickle.load() extremely slow performance

2009-03-23 Thread Jean-Paul Calderone
On Mon, 23 Mar 2009 10:57:54 -0500, Jim Garrison j...@acm.org wrote: Benjamin Peterson wrote: Terry Reedy tjreedy at udel.edu writes: 3.1a1 is out and I believe it has the io improvements. Massive ones, too. It'd be interesting to see your results on the alpha. On 3.1a1 the unpickle step

Re: script files with python (instead of tcsh/bash)?

2009-03-23 Thread Alan G Isaac
On 3/21/2009 9:26 AM Esmail apparently wrote: I also write out some gnuplot scripts that later get executed to generate .jpg images. See Gnuplot.py Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative Imports, why the hell is it so hard?

2009-03-23 Thread rocky
On Mar 23, 11:22 am, CinnamonDonkey cinnamondon...@googlemail.com wrote: Hi Guys, Thanx for the quick responses, it is very much appreciated! Skip, that's a good point about C++ != Python and I assure you I am very much aware of that ;-). Looking

Re: how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread Mensanator
On Mar 23, 5:48 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Mon, 23 Mar 2009 01:45:53 -0700, Mensanator wrote: but you can create a helper function very easily: def round(dec, places, rounding=decimal.ROUND_HALF_UP): return

Re: pickle.load() extremely slow performance

2009-03-23 Thread Steve Holden
Jean-Paul Calderone wrote: On Mon, 23 Mar 2009 10:57:54 -0500, Jim Garrison j...@acm.org wrote: Benjamin Peterson wrote: Terry Reedy tjreedy at udel.edu writes: 3.1a1 is out and I believe it has the io improvements. Massive ones, too. It'd be interesting to see your results on the alpha.

Re: Async serial communication/threads sharing data

2009-03-23 Thread Nick Craig-Wood
Jean-Paul Calderone exar...@divmod.com wrote: On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul Calderone exar...@divmod.com wrote: [snip] In the case of a TCP to serial forwarder, you don't actually have to implement either a producer or a

mocking xmlrpclib

2009-03-23 Thread J Kenneth King
At the risk of sounding like I don't know what I'm doing, I must say that I am finding it rather difficult/tedious to mock the xmlrpclib interface using minimock. I refuse to believe that I'm the only developer to have tried this before, but google isn't being my friend and I can't seem to get

Syntax error when importing a file which starts with a number

2009-03-23 Thread simon . woolf
Hello, all. I don't suppose anyone has any idea why it seems to be impossible to import any file which starts with a number? You get a syntax error, whether the file exists or not. Try it yourself: import foo ImportError: No module named foo import 1foo File stdin, line 1 import 1foo

Re: Syntax error when importing a file which starts with a number

2009-03-23 Thread simon . woolf
Forgot to mention: I'm on Python 2.5.2, on Ubuntu 8.10. Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable automatic interning

2009-03-23 Thread Hrvoje Niksic
George Sakkis george.sak...@gmail.com writes: I'm working on some graph generation problem where the node identity is significant (e.g. if node1 is node2: # do something) but ideally I wouldn't want to impose any constraint on what a node is I'm not sure if it helps in your case, but you can

Re: Syntax error when importing a file which starts with a number

2009-03-23 Thread Miles
On Mon, Mar 23, 2009 at 1:56 PM, simon.wo...@gmail.com wrote: Hello, all. I don't suppose anyone has any idea why it seems to be impossible to import any file which starts with a number?  You get a syntax error, whether the file exists or not. Identifiers can't start with a number.

Re: Syntax error when importing a file which starts with a number

2009-03-23 Thread Gabriel Genellina
En Mon, 23 Mar 2009 14:56:21 -0300, simon.wo...@gmail.com escribió: I don't suppose anyone has any idea why it seems to be impossible to import any file which starts with a number? You get a syntax error, whether the file exists or not. You don't import a file, you import a module. And a

Mail client in Python?

2009-03-23 Thread Ken D'Ambrosio
Idle curiosity: is there a (decent) IMAP mail client (web or local) written in Python? I've got a project that needs doing, and it just occurred to me that a mail client might be the ideal interface; I'd have to change some back-end stuff (to do database queries instead of IMAP or POP queries),

Re: Syntax error when importing a file which starts with a number

2009-03-23 Thread andrew cooke
The grammar indicates that the module name is an identifier, and identifiers can't start with digits (you can't have a variable name that starts with a '1' either). This is probably quite fundamental (I guess the lexer will implement it) so suspect it is impossible to change. That means it is a

Re: Syntax error when importing a file which starts with a number

2009-03-23 Thread MRAB
simon.wo...@gmail.com wrote: Hello, all. I don't suppose anyone has any idea why it seems to be impossible to import any file which starts with a number? You get a syntax error, whether the file exists or not. Try it yourself: import foo ImportError: No module named foo import 1foo

Re: Syntax error when importing a file which starts with a number

2009-03-23 Thread andrew cooke
andrew cooke wrote: ffs. feature, not bug. sorry. This is probably quite fundamental (I guess the lexer will implement it) so suspect it is impossible to change. That means it is a bug, not a feature (and it's quite a reasonable restriction, since it reduces ambiguity). --

Re: Mail client in Python?

2009-03-23 Thread Petite Abeille
On Mar 23, 2009, at 7:14 PM, Ken D'Ambrosio wrote: Idle curiosity: is there a (decent) IMAP mail client (web or local) written in Python? I've got a project that needs doing, and it just occurred to me that a mail client might be the ideal interface; I'd have to change some back-end stuff

Re: Using python 3 for scripting?

2009-03-23 Thread Nick Craig-Wood
Alan G Isaac alan.is...@gmail.com wrote: On 3/22/2009 12:41 PM Chris Rebert apparently wrote: 2.6.1, the latest non-3.x release is probably best. Most libraries haven't been ported to 3.x yet, so Python 3 has yet to become widespread. This seems slightly optimistic to me. Until a week

Re: Relative Imports, why the hell is it so hard?

2009-03-23 Thread bearophileHUGS
CinnamonDonkey: what makes something a package? If you don't know what a package is, then maybe you don't need packages. In your project is it possible to avoid using packages and just use modules in the same directory? Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Portable Python 1.1 released

2009-03-23 Thread Dutch Masters
This is a great piece of work. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

udp package header

2009-03-23 Thread mete
Hi all, I got a problem. İ want to send udp package and get this package (server and clinet ). it's easy to python but i want to look the udp header how can i do ? -- http://mail.python.org/mailman/listinfo/python-list

Wing IDE 3.1.8 released

2009-03-23 Thread Wingware
Hi, Wingware has released version 3.1.8 of Wing IDE, a bug-fix release for all three product levels of Wing IDE. *Release Highlights* This release includes the following: * Fixed problems seen with Subversion 1.4+ * Properly ignore settrace exception on x64 systems * Fixed perforce submit for

Re: Syntax error when importing a file which starts with a number

2009-03-23 Thread John Machin
On Mar 24, 4:56 am, simon.wo...@gmail.com wrote: It's a bit annoying, as I have an enforced naming scheme. Do you mean that some authority other than yourself is seriously insisting that the names of source files *must* start with one or more digits? What is the rationale for such a scheme? --

Re: pickle.load() extremely slow performance

2009-03-23 Thread Jim Garrison
Steve Holden wrote: Jean-Paul Calderone wrote: On Mon, 23 Mar 2009 10:57:54 -0500, Jim Garrison j...@acm.org wrote: Benjamin Peterson wrote: Terry Reedy tjreedy at udel.edu writes: 3.1a1 is out and I believe it has the io improvements. Massive ones, too. It'd be interesting to see your

Re: Unicode problem in ucs4

2009-03-23 Thread M.-A. Lemburg
On 2009-03-23 14:05, abhi wrote: Hi Marc, Is there any way to ensure that wchar_t size would always be 2 instead of 4 in ucs4 configured python? Googling gave me the impression that there is some logic written in PyUnicode_AsWideChar() which can take care of ucs4 to ucs2 conversion if

  1   2   >