String to unicode - duplicating by function the effect of u prefix

2009-06-18 Thread CiTro
I'm looking for a way to convert a string to it's unicode "brother". This means: stringOne = "\u0026" stringTwo = u"\u0026" print unicode(stringOne) == stringTwo The result is false. What function should I use, to duplicate the effect of the "u" prefix ? -- http://mail.python.org/mailman/listi

Re: python tutorial

2009-06-18 Thread Steven D'Aprano
On Thu, 18 Jun 2009 15:58:37 +1000, steve wrote: > "Steven D'Aprano" wrote in > message news:pan.2009.06.18.01.42...@remove.this.cybersource.com.au... >> On Thu, 18 Jun 2009 10:36:01 +1000, steve wrote: >> >>> 1) Windows does not make a distinction between text and binary files. >> >> Of course i

Re: fastest native python database?

2009-06-18 Thread Pierre Quentel
On 18 juin, 05:28, per wrote: > hi all, > > i'm looking for a native python package to run a very simple data > base. i was originally using cpickle with dictionaries for my problem, > but i was making dictionaries out of very large text files (around > 1000MB in size) and pickling was simply too

Re: String to unicode - duplicating by function the effect of u prefix

2009-06-18 Thread Peter Otten
CiTro wrote: > I'm looking for a way to convert a string to it's unicode "brother". > > This means: > > stringOne = "\u0026" > stringTwo = u"\u0026" > > print unicode(stringOne) == stringTwo > > The result is false. What function should I use, to duplicate the > effect of the "u" prefix ? "\u

Re: TypeError: int argument required

2009-06-18 Thread Lawrence D'Oliveiro
In message , Rhodri James wrote: > On Wed, 17 Jun 2009 12:07:15 +0100, Lawrence D'Oliveiro > wrote: > > [snip example code] > >> You haven't managed to get rid of the backslashes. > > [snip other example code] > >> Now you've lost track of the original point of the discussion, which is >> ab

Re: fastest native python database?

2009-06-18 Thread Lawrence D'Oliveiro
In message <07ac7d7a-48e1-45e5-a21c- f2c259c75...@j12g2000vbl.googlegroups.com>, per wrote: > i'm looking for a native python package to run a very simple data > base. Use Python mapping objects. Most real-world databases will fit in memory anyway. -- http://mail.python.org/mailman/listinfo/py

Re: Regarding Python is scripting language or not

2009-06-18 Thread Arnaud Delobelle
Christian Heimes writes: > Terry Reedy wrote: >> If you mean 'be an instance of a class', which I think is the most >> natural reading, then Python *is* object-oriented and, if I understand >> what I have read correctly (so that ints are just (unboxed) ints and not >> members of an int class), Ja

Re: python tutorial

2009-06-18 Thread steve
"Steven D'Aprano" wrote in message news:pan.2009.06.18.07.05...@remove.this.cybersource.com.au... > On Thu, 18 Jun 2009 15:58:37 +1000, steve wrote: > >> "Steven D'Aprano" wrote in >> message news:pan.2009.06.18.01.42...@remove.this.cybersource.com.au... >>> On Thu, 18 Jun 2009 10:36:01 +1000,

Re: How can I enumerate (list) serial ports?

2009-06-18 Thread Jason
On Jun 18, 2:20 pm, Tim Golden wrote: > but I imagine that, behind the scenes, it's doing some sort > of conditional imports according to platform. I have, and yes indeed it does. > I imagine you'd > have to do something similar to get a list of port names. That's what I thought, although I mig

Re: Pythonic way to overwrite a file

2009-06-18 Thread Tim Wintle
On Wed, 2009-06-17 at 14:26 -0400, Cameron Pulsford wrote: > This is only supposed to handle text files, so when would reading it > all into memory become too much for most computers? I'm guessing there > aren't many source files of too great a size. I often use python with server log files - 1Tb

Re: python tutorial

2009-06-18 Thread Ben Finney
"steve" writes: > So far I've been pointed to a discussion of C, a discussion of DOS, > and a discussion of Windows NT 4. Great. Glad to see that you know how > to use the Internet. Says the person who doesn't want to attach an identity to his messages. (Yes, that's ad hominem if used to dismiss

Re: Regarding Python is scripting language or not

2009-06-18 Thread Bruno Desthuilliers
Asun Friere a écrit : (snip) OTOH the whole notion of defining OO by the use of classes automatically excludes from consideration prototype-based OO languages (eg. Self) which arguably offer a purer approach to OO than class centric languages. FWIW, there's no notion of "class" in the minimal

please help...writing set to a file

2009-06-18 Thread yadin
Good day every one! I got this python program that returns me a set like this.. Set ([‘A\n’, B\n’, ‘C\n’, ‘D\n’, ‘E\n’, ‘F\n’, ‘G\n’ ]) And a list pp = [‘100\n’ ‘200\n’ ‘300\n’ ‘400\n’] I was reading this from a file…. How can I transform this to something that looks like this Column1 Column 2

Re: fastest native python database?

2009-06-18 Thread pdpi
On Jun 18, 8:09 am, Pierre Quentel wrote: > On 18 juin, 05:28, per wrote: > > > > > > > hi all, > > > i'm looking for a native python package to run a very simple data > > base. i was originally using cpickle with dictionaries for my problem, > > but i was making dictionaries out of very large te

Re: please help...writing set to a file

2009-06-18 Thread Benjamin Kaplan
On Thu, Jun 18, 2009 at 5:24 AM, yadin wrote: > Good day every one! > > I got this python program that returns me a set like this.. > Set ([‘A\n’, B\n’, ‘C\n’, ‘D\n’, ‘E\n’, ‘F\n’, ‘G\n’ ]) > And a list pp = [‘100\n’ ‘200\n’ ‘300\n’ ‘400\n’] > I was reading this from a file…. > How can I transfor

Re: please help...writing set to a file

2009-06-18 Thread Dave Angel
yadin wrote: Good day every one! I got this python program that returns me a set like this.. Set ([‘A\n’, B\n’, ‘C\n’, ‘D\n’, ‘E\n’, ‘F\n’, ‘G\n’ ]) And a list pp =‘100\n’ ‘200\n’ ‘300\n’ ‘400\n’] I was reading this from a file…. How can I transform this to something that looks like this Column1

Packing a ctypes struct containing bitfields.

2009-06-18 Thread Karthik
Hello Everybody, I'm trying to create a packed structure in ctypes (with one 64-bit element that is bitfielded to 48 bits), unsuccessfully: === from ctypes import * class foo (Structure): _pack_ = 1 _fields_ = [ ("bar",c_ulonglong, 48), ]

pyserial question

2009-06-18 Thread Piter_
Hi all. I try to control some equipment from python trough comport. I have not succeeded in pyserial. But if I use this terminal: http://hw-server.com/files/priloha/termv19b.zip http://hw-server.com/software/termv19b.html It works with following settings. Boud rate: 9600 Data bids: 8 Parity: none

Re: UDP queue size

2009-06-18 Thread Nick Craig-Wood
Martin P. Hellwig wrote: > Scott David Daniels wrote: > > 找尋自己的一片天 wrote: > >> I got a problem about UDP. > >> > >> How do I get the UDP buffer size? > >> > >> When the server had some delay in handling incoming UDP, it will lost > >> some package. I wonder it's because the system

Re: CAD file format specifications?

2009-06-18 Thread Anthra Norell
norseman wrote: Anthra Norell wrote: Andres Acosta wrote: HI there Anthara have you checked out www.Blender.org, It is open source and accepts a lot of your formats. for import and export. Anrdres Anthra Norell wrote: Hi, Anyone working with CAD who knows about numeric data entry? I have 3

Default namespace and attributes with ElementTree 1.3

2009-06-18 Thread Racinet Georges
Hi there, I've got a problem with the way ElementTree 1.3a3-20070912 handles attributes with the default namespace feature (please feel free to redirect me if this isn't the proper place to discuss such matters). >>> from elementtree import ElementTree as ET >>> e = ET.fromstring('') >>> ET

Re: python tutorial

2009-06-18 Thread D'Arcy J.M. Cain
On 18 Jun 2009 07:05:20 GMT Steven D'Aprano wrote: > Technically, the Windows file systems record the length of text files and > so an explicit EOF character is redundant, nevertheless, the behaviour of > stopping the read at \0x1A is expected. Whether you want to claim it is I really loved CP

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-18 Thread Piet van Oostrum
> Charles Yeomans (CY) wrote: >CY> Memory management may be an "implementation detail", but it is >CY> unfortunately one that illustrates the so-called law of leaky >CY> abstractions. So I think that one has to write code that follows the >CY> memory management scheme of whatever language on

Re: python tutorial

2009-06-18 Thread Peter Bell
> "Steven D'Aprano" writes >http://support.microsoft.com/kb/156258 That says that Windows NT 3.5 and NT 4 couldn't make a distinction between text and binary files. I don't think that advances your case. If they had changed the Windows behaviour, yes, but Windows 7 seems to be compatible with

Re: generator expression works in shell, NameError in script

2009-06-18 Thread guthrie
On Jun 17, 6:38 pm, Steven Samuel Cole wrote: > Still don't really understand why my initial code didn't work, though... Your code certainly looks reasonable, and looks to me like it "should" work. The comment of partial namespace is interesting, but unconvincing (to me) - but I am not a Python e

Re: Regarding Python is scripting language or not

2009-06-18 Thread Jochen Schulz
Terry Reedy: > Jochen Schulz wrote: >> >> If, by "object-oriented" you mean "everything has to be put into >> classes", then Python is not object-oriented. > > That depends on what you mean by 'put into classes' (and 'everything'). :) What I meant was that in Python you can write code without de

Re: please help...writing set to a file

2009-06-18 Thread Alan G Isaac
On 6/18/2009 5:24 AM yadin apparently wrote: > I got this python program that returns me a set like this.. > Set ([‘A\n’, B\n’, ‘C\n’, ‘D\n’, ‘E\n’, ‘F\n’, ‘G\n’ ]) > And a list pp = [‘100\n’ ‘200\n’ ‘300\n’ ‘400\n’] > I was reading this from a file…. > How can I transform this to something that lo

Re: TypeError: int argument required

2009-06-18 Thread Rhodri James
On Thu, 18 Jun 2009 08:29:53 +0100, Lawrence D'Oliveiro wrote: Now compare that with Lie Ryan's examples which, instead of using backslashes, instead used alternative quotes plus backslashes in one example, and in the other example, alternative quotes, alternatives to literal quotes, and back

Re: Packing a ctypes struct containing bitfields.

2009-06-18 Thread Nick Craig-Wood
Karthik wrote: > Hello Everybody, > > I'm trying to create a packed structure in ctypes (with one 64-bit > element that is bitfielded to 48 bits), > unsuccessfully: > > === > from ctypes import * > > class foo (Structure): > _pack_ = 1 > _fields_

command-line one-liners a la Perl?

2009-06-18 Thread kj
I'm a recovering Perl addict, and I'm jonesin' badly for command-line one-liners, like % perl -lne '@f=split "\t";print join "\t",@f[3,1] if $f[2]=~/frobozz/i' in.txt How can I get my fix with Python? kynn -- http://mail.python.org/mailman/listinfo/python-list

Re: generator expression works in shell, NameError in script

2009-06-18 Thread nn
On Jun 18, 8:38 am, guthrie wrote: > On Jun 17, 6:38 pm, Steven Samuel Cole > wrote: > > > Still don't really understand why my initial code didn't work, though... > > Your code certainly looks reasonable, and looks to me like it "should" > work. The comment of partial namespace is interesting, b

Re: command-line one-liners a la Perl?

2009-06-18 Thread MRAB
kj wrote: I'm a recovering Perl addict, and I'm jonesin' badly for command-line one-liners, like % perl -lne '@f=split "\t";print join "\t",@f[3,1] if $f[2]=~/frobozz/i' in.txt How can I get my fix with Python? python -c "print 'Hello world!'" Although you need to remember that Python m

pyserial. How to set Handshaking to "RST on TX".

2009-06-18 Thread Piter_
Hi all I try to drive some equipment trough serial port. So far I could do it with some windows com port terminal if handhaking set to "RTS on TX". http://hw-server.com/software/termv19b.html But I cant find out how to set it in pyserial. Thanks in advance for any hint. -- http://mail.python.org/

Re: command-line one-liners a la Perl?

2009-06-18 Thread unayok
On Jun 18, 9:36 am, kj wrote: > I'm a recovering Perl addict, and I'm jonesin' badly for command-line > one-liners, like > >   % perl -lne '@f=split "\t";print join "\t",@f[3,1] if $f[2]=~/frobozz/i' > in.txt > > How can I get my fix with Python? > > kynn I'd encourage you to learn the ways of P

Re: Regarding Python is scripting language or not

2009-06-18 Thread Aaron Brady
On Jun 18, 6:07 am, Jochen Schulz wrote: > Terry Reedy: > > > Jochen Schulz wrote: > > >> If, by "object-oriented" you mean "everything has to be put into > >> classes", then Python is not object-oriented. > > > That depends on what you mean by 'put into classes' (and 'everything'). > > :) What I

Announcing www.python-excel.org

2009-06-18 Thread Chris Withers
Hi All, Google unfortunately has a knack of presenting prospective Python users who need to work with Excel files with information that is now really rather out of date. To try and help with this, I've setup a small website at: http://www.python-excel.org ...to try and list the latest recom

Re: Newbie queue question

2009-06-18 Thread Piet van Oostrum
> Jure Erznožnik (JE) wrote: >JE> Hi, >JE> I'm pretty new to Python (2.6) and I've run into a problem I just >JE> can't seem to solve. >JE> I'm using dbfpy to access DBF tables as part of a little test project. >JE> I've programmed two separate functions, one that reads the DBF in main >JE> t

Tutorial on working with Excel files in Python (without COM and cross platform!) at EuroPython 2009

2009-06-18 Thread Chris Withers
Hi All, Too many people in the Python community *still* think the only way to work with Excel files in Python is using COM on Windows. To try and correct this, I'm giving a tutorial at this year's EuroPython conference in Birmingham, UK on Monday, 29th June that will cover working with Excel

Re: fastest native python database?

2009-06-18 Thread J Kenneth King
per writes: > hi all, > > i'm looking for a native python package to run a very simple data > base. i was originally using cpickle with dictionaries for my problem, > but i was making dictionaries out of very large text files (around > 1000MB in size) and pickling was simply too slow. > > i am no

Re: logging.fileConfig limitations?

2009-06-18 Thread Vinay Sajip
On Jun 17, 9:05 pm, Mani Ghasemlou wrote: > Hi all, > > C:\Documents and Settings\ßéäöÜ2\Local Settings\Application > Data\MyApp\MyApp.log > > Now it turns out that the logging module can't find "C:/Documents and > Settings/ßéäöÜ2/Local Settings/Application Data/MyApp/MyApp.log" > specified

A question on scope...

2009-06-18 Thread Wells Oliver
In writing out python classes, it seems the 'self' is optional, meaning that inside a class method, "self.foo = bar" has the same effect as "foo = bar". Is this right? If so, it seems a little odd- what's the rationale? Or am I mistaken? -- Wells Oliver we...@submute.net -- http://mail.python.o

Re: Exotic Logics

2009-06-18 Thread Michael Torrie
William Clifford wrote: > I've read one can do all of the 16 binary operations with clever uses > of NAND or NOR. That is correct. In fact semiconductor logic is done using these two principle gates. See http://en.wikipedia.org/wiki/NAND_logic . Quite interesting really. -- http://mail.python

Re: A question on scope...

2009-06-18 Thread MRAB
Wells Oliver wrote: In writing out python classes, it seems the 'self' is optional, meaning that inside a class method, "self.foo = bar" has the same effect as "foo = bar". Is this right? If so, it seems a little odd- what's the rationale? Or am I mistaken? Inside a function or method "foo =

Re: TypeError: int argument required

2009-06-18 Thread Lie Ryan
Rhodri James wrote: > On Thu, 18 Jun 2009 08:29:53 +0100, Lawrence D'Oliveiro > wrote: > >> Now compare that with Lie Ryan's examples which, instead of using >> backslashes, instead used alternative quotes plus backslashes in one >> example, and in the other example, alternative quotes, alternati

Re: Tutorial on working with Excel files in Python (without COM and cross platform!) at EuroPython 2009

2009-06-18 Thread Mike Driscoll
On Jun 18, 10:38 am, Chris Withers wrote: > Hi All, > > Too many people in the Python community *still* think the only way to > work with Excel files in Python is using COM on Windows. > > To try and correct this, I'm giving a tutorial at this year's EuroPython > conference in Birmingham, UK on Mo

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 14:50:28 +1200, Lawrence D'Oliveiro wrote: >In message <7x63ew3uo9@ruckus.brouhaha.com>, wrote: > >> Lawrence D'Oliveiro writes: >> >>> I don't think any countable set, even a countably-infinite set, can have >>> a fractal dimension. It's got to be uncountably infinite,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 14:50:28 +1200, Lawrence D'Oliveiro wrote: >In message <7x63ew3uo9@ruckus.brouhaha.com>, wrote: > >> Lawrence D'Oliveiro writes: >> >>> I don't think any countable set, even a countably-infinite set, can have >>> a fractal dimension. It's got to be uncountably infinite,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 14:50:28 +1200, Lawrence D'Oliveiro wrote: >In message <7x63ew3uo9@ruckus.brouhaha.com>, wrote: > >> Lawrence D'Oliveiro writes: >> >>> I don't think any countable set, even a countably-infinite set, can have >>> a fractal dimension. It's got to be uncountably infinite,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 07:35:35 +0200, Jaime Fernandez del Rio wrote: >On Wed, Jun 17, 2009 at 4:50 AM, Lawrence >D'Oliveiro wrote: >> In message <7x63ew3uo9@ruckus.brouhaha.com>,  wrote: >> >>> Lawrence D'Oliveiro writes: >>> I don't think any countable set, even a countably-infinite set,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 07:37:32 -0400, Charles Yeomans wrote: > >On Jun 17, 2009, at 2:04 AM, Paul Rubin wrote: > >> Jaime Fernandez del Rio writes: >>> I am pretty sure that a continuous sequence of >>> curves that converges to a continuous curve, will do so uniformly. >> >> I think a typical exam

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 08:18:52 -0700 (PDT), Mark Dickinson wrote: >On Jun 17, 3:46 pm, Paul Rubin wrote: >> Mark Dickinson writes: >> > It looks as though you're treating (a portion of?) the Koch curve as >> > the graph of a function f from R -> R and claiming that f

Re: Measuring Fractal Dimension ?

2009-06-18 Thread Charles Yeomans
On Jun 18, 2009, at 2:19 PM, David C. Ullrich wrote: On Wed, 17 Jun 2009 07:37:32 -0400, Charles Yeomans wrote: On Jun 17, 2009, at 2:04 AM, Paul Rubin wrote: Jaime Fernandez del Rio writes: I am pretty sure that a continuous sequence of curves that converges to a continuous curve, will

Re: walking a directory with very many files

2009-06-18 Thread Lie Ryan
Mike Kazantsev wrote: > On Wed, 17 Jun 2009 03:42:02 GMT > Lie Ryan wrote: > >> Mike Kazantsev wrote: >>> In fact, on modern filesystems it doesn't matter whether you >>> accessing /path/f9e95ea4926a4 with million files in /path >>> or /path/f/9/e/95ea with only hundred of them in each path. Form

Re: python tutorial

2009-06-18 Thread Robert Kern
On 2009-06-18 00:57, steve wrote: "Robert Kern" wrote in message news:mailman.1728.1245289092.8015.python-l...@python.org... On 2009-06-17 19:36, steve wrote: "Carl Banks" wrote in message news:2f6271b1-5ffa-4cec-81f8->>0276ad647...@p5g2000pre.googlegroups.com... On Jun 15, 7:56 pm, "steve"

ERROR: how to use a text file in a module?

2009-06-18 Thread Moni GV
Hi, Help with a "No such file ..." error. I have the next folder structure: ---Network contains:     --packets.py     --Temp contains:    -test.py Well, within packets.py I do this: from Temp.test import * Within test.py I do this: f = open ("topo.txt", "r") The error is: No such file "topo

Re: python tutorial

2009-06-18 Thread Lie Ryan
Ben Finney wrote: > You started out asking how to *interpret* it, which is fine for this > forum; but discussing it here isn't going to lead automatically to any > *midification* to a document developed within the core of Python. > I definitely want to see how python doc be midified, last time I

Re: python tutorial

2009-06-18 Thread Ethan Furman
steve wrote: "Robert Kern" wrote in message news:mailman.1728.1245289092.8015.python-l...@python.org... On 2009-06-17 19:36, steve wrote: "Carl Banks" wrote in message news:2f6271b1-5ffa-4cec-81f8->>0276ad647...@p5g2000pre.googlegroups.com... On Jun 15, 7:56 pm, "steve" wrote: I was jus

Re: Regarding Python is scripting language or not

2009-06-18 Thread Terry Reedy
Jochen Schulz wrote: Terry Reedy: Jochen Schulz wrote: If, by "object-oriented" you mean "everything has to be put into classes", then Python is not object-oriented. That depends on what you mean by 'put into classes' (and 'everything'). :) What I meant was that in Python you can write code

Help: Group based synchronize decorator

2009-06-18 Thread Vishal Shetye
I want to synchronize calls using rw locks per 'group' and my implementation is similar to http://code.activestate.com/recipes/465057/ except that I have my own Lock implementation. All my synchronized functions take 'whatGroup' as param. My lock considers 'group' while deciding on granting lock

Re: python tutorial

2009-06-18 Thread Piet van Oostrum
> "Peter Bell" (PB) wrote: >>> "Steven D'Aprano" >PB> writes >>> http://support.microsoft.com/kb/156258 >PB> That says that Windows NT 3.5 and NT 4 couldn't make >PB> a distinction between text and binary files. I don't think >PB> that advances your case. And that was a bug apparently (e

Re: python tutorial

2009-06-18 Thread Terry Reedy
1) Windows does not make a distinction between text and binary files. 'Windows', in its broad sense of Windoes system, includes the standards and protocols mandated by its maker, Microsoft Corporation, and implemented in its C compiler, which it uses to compile the software that other inte

Re: Once again, comparison wxpython with PyQt

2009-06-18 Thread Sebastian Wiesner
> On Jun 18, 3:49 pm, "Diez B. Roggisch" wrote: >> Hans Müller wrote: >> > Here we have to select between wxPython and PyQt for a medium size >> > project. In this project several hundred dialogs are to be created. >> > This work will be done by a program generator which has to re-written. >> >>

Re: Once again, comparison wxpython with PyQt

2009-06-18 Thread Mike Driscoll
On Jun 18, 8:35 am, Hans Müller wrote: > Here we have to select between wxPython and PyQt for a medium size project. > In this project several hundred dialogs are to be created. This work will be > done by a > program generator which has to re-written. > > The question now is which framework shou

Re: Perl's @foo[3,7,1,-1] ?

2009-06-18 Thread Hyuga
On Jun 13, 6:22 pm, Brian Quinlan wrote: > MRAB wrote: > > Brian Quinlan wrote: > >> kj wrote: > >>> In Nick Craig-Wood > >>> writes: > > However I can't think of the last time I wanted to do this - array > elements having individual purposes are usually a sign that you should > b

Re: Measuring Fractal Dimension ?

2009-06-18 Thread Arnaud Delobelle
David C. Ullrich writes: > On Wed, 17 Jun 2009 08:18:52 -0700 (PDT), Mark Dickinson > wrote: > >>On Jun 17, 3:46 pm, Paul Rubin wrote: >>> Mark Dickinson writes: >>> > It looks as though you're treating (a portion of?) the Koch curve as >>> > the graph of a functi

Re: Newbie queue question

2009-06-18 Thread Jure Erznožnik
Thanks for the suggestions. I've been looking at the source code of threading support objects and I saw that non-blocking requests in queues use events, while blocking requests just use InterlockedExchange. So plain old put/get is much faster and I've managed to confirm this today with further test

Generator functions subclass generator?

2009-06-18 Thread Terry Reedy
An iterator class is a class with an __iter__ method that returns self and a __next__ method that on each call returns one not-yet-returned item of the actual or virtual collection it represents and raises StopIteration when there are no more items to return. 'Generator' (3.1 name) is one of s

xlutils 1.3.2 released!

2009-06-18 Thread Chris Withers
Hi All, I'm pleased to announce a new release of xlutils. This is a small collection of utilities that make use of both xlrd and xlwt to process Microsoft Excel files. The list of utilities included in this release are: xlutils.copy Tools for copying xlrd.Book objects to xlwt.Workbook objects

Re: ERROR: how to use a text file in a module?

2009-06-18 Thread Rhodri James
On Thu, 18 Jun 2009 19:57:46 +0100, Moni GV wrote: Help with a "No such file ..." error. I have the next folder structure: ---Network contains:     --packets.py     --Temp contains:    -test.py Well, within packets.py I do this: from Temp.test import * Wildcarded imports like this aren't

Re: python tutorial

2009-06-18 Thread Aahz
In article , D'Arcy J.M. Cain wrote: > >I really loved CP/M in its day but isn't it time we let go? +1 QOTW -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "as long as we like the same operating system, things are cool." --piranha -- http://mail.python.org/mail

TestFixtures 1.6.0 released!

2009-06-18 Thread Chris Withers
Hi All, I'm pleased to announce the first advertised release of TestFixtures. This is a collection of helpers and mock objects that are useful when writing unit tests or doc tests. The modules currently included are: *Comparison* This class lets you instantiate placeholders that can be used

Allocating memory to pass back via ctypes callback function

2009-06-18 Thread Scott
Hi, I'm using python ctypes to interact with the C API of a commercial-off- the-shelf application. I need to implement callback functions which will be called by the application. The callbacks take as a parameter a char** parameter for which the callback function will allocate memory and set the

Re: AT&T Usenet Netnews Service Shutting Down

2009-06-18 Thread Jive Dadson
newsmas...@bellsouth.net wrote: Please note that on or around July 15, 2009, AT&T will no longer be offering access to the Usenet Netnews service. If you wish to continue reading Usenet newsgroups, access is available through third-party vendors. http://support.att.net/usenet Distribution: AT

Re: Measuring Fractal Dimension ?

2009-06-18 Thread Mark Dickinson
On Jun 18, 7:26 pm, David C. Ullrich wrote: > On Wed, 17 Jun 2009 08:18:52 -0700 (PDT), Mark Dickinson > >Right.  Or rather, you treat it as the image of such a function, > >if you're being careful to distinguish the curve (a subset > >of R^2) from its parametrization (a continuous function > >R -

Re: Exotic Logics

2009-06-18 Thread Dave Angel
Michael Torrie wrote: William Clifford wrote: I've read one can do all of the 16 binary operations with clever uses of NAND or NOR. That is correct. In fact semiconductor logic is done using these two principle gates. See http://en.wikipedia.org/wiki/NAND_logic . Quite interesting

Re: question about a command like 'goto ' in Python's bytecode orit's just a compiler optimization?

2009-06-18 Thread JanC
Hendrik van Rooyen wrote: > It is my opinion that it is not possible to make a useful machine, > virtual or real, which executes instructions sequentially, if the > instruction set does not contain a conditional jump of some sort. > > I have tried doing it using conditional calls, and it fails on

Re: python tutorial

2009-06-18 Thread Carl Banks
On Jun 17, 5:36 pm, "steve" wrote: > >"Carl Banks" wrote in message > >news:2f6271b1-5ffa-4cec-81f8->>0276ad647__begin_mask_n#9g02mg7!__...__end_mask_i?a63jfad$...@p5g2000pre.googlegroups.com... > >On Jun 15, 7:56 pm, "steve" wrote: > >> I was just looking at the python tutorial, and I noticed t

Re: Measuring Fractal Dimension ?

2009-06-18 Thread Paul Rubin
David C. Ullrich writes: > >> obviously converges to f, but not uniformly. On a closed interval, > >> any continuous function is uniformly continuous. > > > >Isn't (-?, ?) closed? > > What is your version of the definition of "closed"? I think the whole line is closed, but I hadn't realized any

Is this pylint error message valid or silly?

2009-06-18 Thread Matthew Wilson
Here's the code that I'm feeding to pylint: $ cat f.py from datetime import datetime def f(c="today"): if c == "today": c = datetime.today() return c.date() And here's what pylint says: $ pylint -e f.py No config file found, using defau

Re: Packing a ctypes struct containing bitfields.

2009-06-18 Thread Karthik
On Jun 18, 6:29 pm, Nick Craig-Wood wrote: > Karthik wrote: > >  Hello Everybody, > > >  I'm trying to create a packed structure in ctypes (with one 64-bit > >  element that is bitfielded to 48 bits), > >  unsuccessfully: > > > === > >  from ctypes import * > > >  

Re: GUI(eclipse+pydev/SPE) freeze when doing python auto-completion under Linux

2009-06-18 Thread Fabio Zadrozny
> yes, the same problem even on an empty program. every file has the same > problem. > > for example, if I new a file and input the following: > import os > os. > after I input '.', it will pop up the window, and i can select the function > of os module or continue input. but after that, no action

Re: Tutorial on working with Excel files in Python (without COM and cross platform!) at EuroPython 2009

2009-06-18 Thread John Machin
Mike Driscoll gmail.com> writes: > On Jun 18, 10:38 am, Chris Withers wrote: > > working with Excel files in Python using the pure-python libraries xlrd, > > xlwt and xlutils. > As I recall, these utilities don't allow the programmer to access > Excel's formulas. Is that still an issue? xlwt

Re: Once again, comparison wxpython with PyQt

2009-06-18 Thread Jive Dadson
Qt has far better documentation, and it has Qt Designer. The documentation is a big deal. I wrote a little project in wxPython, and I spent 90% of my time just trying to find the names of member functions and then to figure out what they do. Why not use Qt C++? I like Python a lot. Heck, I

Calling subprocess with arguments

2009-06-18 Thread Tyler Laing
I've been trying any variation I can think of to do this properly, but here's my problem: I want to execute this command string: vlc -I rc This allows vlc to be controlled via a remote interface instead of the normal gui interface. Now, say, I try this from subprocess: >>>p=subprocess.Popen('v

Re: generator expression works in shell, NameError in script

2009-06-18 Thread ryles
On Jun 18, 9:56 am, nn wrote: > On Jun 18, 8:38 am, guthrie wrote: > > > > > On Jun 17, 6:38 pm, Steven Samuel Cole > > wrote: > > > > Still don't really understand why my initial code didn't work, though... > > > Your code certainly looks reasonable, and looks to me like it "should" > > work. T

KeyboardInterrupt eats my error and then won't be caught

2009-06-18 Thread Philip Semanchuk
Hi all, I need help understanding how Python deals with Ctrl-C. A user has reported a bug in my posix_ipc module. When a Python app is waiting to acquire an IPC semaphore and the user hits Ctrl-C, my code should return a custom error indicating that the semaphore wait was interrupted by a s

Re: GUI(eclipse+pydev/SPE) freeze when doing python auto-completion under Linux

2009-06-18 Thread Wei, Xiaohai
Thanks for your reply. where is the error log? I can not find it at /var/log I have a virtual network card to bridge kvm virtual machine. will it cause problem? as you said configuration of interpretor, how should I configure the interpretor? Thanks James On Fri, Jun 19, 2009 at 9:32 AM, Fabi

Re: generator expression works in shell, NameError in script

2009-06-18 Thread greg
ssc wrote: class SignupForm(Form): titles = ['Dr', 'Miss', 'Mr', 'Mrs', 'Ms',] title_choices = [(0, '')] + list((titles.index(t)+1, t) for t in titles) Does the generator expression have its own little namespace or so ? Yes. The generator expression is a function, with its own loca

Re: generator expression works in shell, NameError in script

2009-06-18 Thread greg
nn wrote: This is certainly an odd one. This code works fine under 2.6 but fails in Python 3.1. class x: ... lst=[2] ... gen=[lst.index(e) for e in lst] In 3.x it was decided that the loop variables in a list comprehension should be local, and not leak into the surrounding scope. T

Re: Is this pylint error message valid or silly?

2009-06-18 Thread Ben Finney
Matthew Wilson writes: > Here's the code that I'm feeding to pylint: > > $ cat f.py > from datetime import datetime > > def f(c="today"): > > if c == "today": > c = datetime.today() > > return c.date() > > > And here's what pylint says: > >

Re: Packing a ctypes struct containing bitfields.

2009-06-18 Thread Lawrence D'Oliveiro
In message , Karthik wrote: > from ctypes import * Don't do that. -- http://mail.python.org/mailman/listinfo/python-list

Re: walking a directory with very many files

2009-06-18 Thread Lawrence D'Oliveiro
In message <20090618081423.2e035...@coercion>, Mike Kazantsev wrote: > On Thu, 18 Jun 2009 10:33:49 +1200 > Lawrence D'Oliveiro wrote: > >> In message <20090617214535.10866...@coercion>, Mike Kazantsev wrote: >> >>> On Wed, 17 Jun 2009 23:04:37 +1200 >>> Lawrence D'Oliveiro wrote: >>> In

Re: walking a directory with very many files

2009-06-18 Thread Lawrence D'Oliveiro
In message , Ethan Furman wrote: > Lawrence D'Oliveiro wrote: >> In message <20090617214535.10866...@coercion>, Mike Kazantsev wrote: >> >> >>>On Wed, 17 Jun 2009 23:04:37 +1200 >>>Lawrence D'Oliveiro wrote: >>> >>> In message <20090617142431.2b25f...@malediction>, Mike Kazantsev wrote: >>

Re: walking a directory with very many files

2009-06-18 Thread Lawrence D'Oliveiro
In message <%zv_l.19493$y61.5...@news-server.bigpond.net.au>, Lie Ryan wrote: > Yeah, it might be possible to just mv the file from outside, but not > being able to enter a directory just because you've got too many files > in it is kind of silly. Sounds like a problem with your file/directory-m

Re: AT&T Usenet Netnews Service Shutting Down

2009-06-18 Thread Terry Reedy
Jive Dadson wrote: newsmas...@bellsouth.net wrote: Please note that on or around July 15, 2009, AT&T will no longer be offering access to the Usenet Netnews service. If you wish to continue reading Usenet newsgroups, access is available through third-party vendors. news.gmane.org (free) mirr

Re: Is this pylint error message valid or silly?

2009-06-18 Thread Terry Reedy
Matthew Wilson wrote: Here's the code that I'm feeding to pylint: $ cat f.py from datetime import datetime def f(c="today"): pylint infers that you intend users to pass a string. Human would guess the same at this point. if c == "today": c = datetim