Re: Two questions about logging

2012-01-12 Thread Jean-Michel Pichavant
Matthew Pounsett wrote: [snip] Second, I'm trying to get a handle on how libraries are meant to integrate with the applications that use them. The naming advice in the advanced tutorial is to use __name__ to name loggers, and to allow log messages to pass back up to the using application's logg

Re: how to install lxml in window xp?

2012-01-12 Thread Tamer Higazi
Am 12.01.2012 06:08, schrieb Brian Curtin: > On Wed, Jan 11, 2012 at 23:01, Tamer Higazi wrote: >> Use Linux! >> Specially Gentoo Linux! > > Not a useful answer. then take windows 7 instead of something that is no more supported by the vendor itself. I am running Python 64Bit on my Windows machi

stable object serialization to text file

2012-01-12 Thread Máté Koch
Hello All, I'm developing an app which stores the data in file system database. The data in my case consists of large python objects, mostly dicts, containing texts and numbers. The easiest way to dump and load them would be pickle, but I have a problem with it: I want to keep the data in versi

Re: stable object serialization to text file

2012-01-12 Thread Peter Otten
Máté Koch wrote: > I'm developing an app which stores the data in file system database. The > data in my case consists of large python objects, mostly dicts, containing > texts and numbers. The easiest way to dump and load them would be pickle, > but I have a problem with it: I want to keep the da

Re: stable object serialization to text file

2012-01-12 Thread Máté Koch
That's probably the easiest way as I don't store any binary data just strings and numbers. Thanks! On Jan 12, 2012, at 1:24 PM, Peter Otten wrote: > Máté Koch wrote: > >> I'm developing an app which stores the data in file system database. The >> data in my case consists of large python object

Re: Python lib for creating Database tables

2012-01-12 Thread Nathan Rice
On Wed, Jan 11, 2012 at 4:38 PM, Emeka wrote: > Hello All, > > I just made something pretty simple that I intend to use while creating > database tables. It is still in the basic form, and much needs to be added. > However, I use introspection to make it a bit easier and less work on the > user. >

Is there a way to merge two XML files via Python?

2012-01-12 Thread J
This is more a theory exercise and something I'm trying to figure out, and this is NOT a homework assignment... I'm trying to make a tool I use at work more efficient :) So this is at test tool that generates an XML file as it's output that is eventually used by a web service to display test resu

Re: Is there a way to merge two XML files via Python?

2012-01-12 Thread Stefan Behnel
J, 12.01.2012 17:04: > This is more a theory exercise and something I'm trying to figure out, > and this is NOT a homework assignment... > > I'm trying to make a tool I use at work more efficient :) > > So this is at test tool that generates an XML file as it's output that > is eventually used by

Re: Is there a way to merge two XML files via Python?

2012-01-12 Thread Dave Angel
On 01/12/2012 11:39 AM, Stefan Behnel wrote: J, 12.01.2012 17:04: This is more a theory exercise and something I'm trying to figure out, and this is NOT a homework assignment... I'm trying to make a tool I use at work more efficient :) So this is at test tool that generates an XML file as it's

Wing IDE 4.1.3 released

2012-01-12 Thread Wingware
Hi, Wingware has released version 4.1.3 of Wing IDE, an integrated development environment designed specifically for the Python programming language. Wing IDE is a cross-platform Python IDE that provides a professional code editor with vi, emacs, and other key bindings, auto-completion, call tip

Re: stable object serialization to text file

2012-01-12 Thread Terry Reedy
On 1/12/2012 7:24 AM, Peter Otten wrote: Máté Koch wrote: I'm developing an app which stores the data in file system database. The data in my case consists of large python objects, mostly dicts, containing texts and numbers. The easiest way to dump and load them would be pickle, but I have a pr

Symbolic expressions (or: partials and closures from the inside out)

2012-01-12 Thread Nathan Rice
Greetings, I have been writing a lot of code lately that involves creating symbolic expressions of one form or another, which are then fully evaluated at a later time. Examples of this include Elementwise, where I create expressions that act on every member of an iterable (there is a much improve

ANN: pysendfile 0.2.0 released

2012-01-12 Thread Giampaolo Rodolà
Hi folks, I'm pleased to announce the 0.2.0 release of pysendfile: http://code.google.com/p/pysendfile === About === This is a python interface to sendfile(2) system call available on most UNIX systems. sendfile(2) provides a "zero-copy" way of copying data from one file descriptor to another (a

Reading and writing to a file creates null characters

2012-01-12 Thread Denhua
Hi, I've got a file which I'd like to read, modify and write. # file contents a b c d My script reads the file contents into a list and rotates the list and writes it back to the same file. Problem is that the output contains null characters. I don't know where they are coming from. #!/usr/bin/

Re: Reading and writing to a file creates null characters

2012-01-12 Thread Roy Smith
In article <4f7d125a-2713-4b57-a108-2a56ae653...@h3g2000yqe.googlegroups.com>, Denhua wrote: > [omitted] > f.write("\n".join(newlist)) > f.close() > > # output > > [root@Inferno html]# python rotate.py > ['b', 'c', 'd', 'a'] > [root@Inferno html]# python rotate.py > ['c', 'd', 'a', '\x00\x00\

Re: Reading and writing to a file creates null characters

2012-01-12 Thread MRAB
On 12/01/2012 22:26, Denhua wrote: Hi, I've got a file which I'd like to read, modify and write. # file contents a b c d My script reads the file contents into a list and rotates the list and writes it back to the same file. Problem is that the output contains null characters. I don't know whe

Re: Two questions about logging

2012-01-12 Thread K Richard Pixley
On 1/11/12 18:19 , Matthew Pounsett wrote: Second, I'm trying to get a handle on how libraries are meant to integrate with the applications that use them. The naming advice in the advanced tutorial is to use __name__ to name loggers, and to allow log messages to pass back up to the using applica

Re: stable object serialization to text file

2012-01-12 Thread K Richard Pixley
On 1/11/12 12:16 , Máté Koch wrote: Hello All, I'm developing an app which stores the data in file system database. The data in my case consists of large python objects, mostly dicts, containing texts and numbers. The easiest way to dump and load them would be pickle, but I have a problem wit

Re: how to install lxml in window xp?

2012-01-12 Thread alex23
Tamer Higazi wrote: > So, instead of making yourself continuously headache for an outdated OS > I advise [...] Please don't recommend people use another OS when they ask an explicit question about a particular OS. It just makes you come across as a zealot. Not everyone is working within an envir

Re: ERROR:root:code for hash md5 was not found

2012-01-12 Thread Steven D'Aprano
On Wed, 11 Jan 2012 22:13:16 -0800, mike wrote: [...] > esekilx5030 [7:09am] [roamFroBl/pysibelius/bin] -> python Python 2.7.2 > (default, Jun 16 2011, 15:05:49) [GCC 4.5.0] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import sys > print(sys.version) > imp

How to remove ellipses from long paths in traceback?

2012-01-12 Thread Jason Veldicott
Hi, Long paths in python traceback are contracted with ellipses. eg: TclError: couldn't load library "C:/Python26/tcl/tk8.5/../../bin/tk85.dll" Is there any way to see the full path? Surprisingly, search didn't reveal an answer to this question. Thanks Jason -- http://mail.python.org/mailm

Re: ERROR:root:code for hash md5 was not found

2012-01-12 Thread alex23
On Jan 13, 1:34 pm, Steven D'Aprano wrote: > What is pysibelius? I can't find it on the web. Does it have anything to > do with Sibelius the music composition software? Yes, please provide more information about the pysibelius package, especially if this is the case. The few tenuous Python/Sibel

Zealotry [was Re: how to install lxml in window xp?]

2012-01-12 Thread Steven D'Aprano
On Thu, 12 Jan 2012 18:50:13 -0800, alex23 wrote: > Tamer Higazi wrote: >> So, instead of making yourself continuously headache for an outdated OS >> I advise [...] > > Please don't recommend people use another OS when they ask an explicit > question about a particular OS. It just makes you come

Re: Zealotry [was Re: how to install lxml in window xp?]

2012-01-12 Thread alex23
On Jan 13, 3:02 pm, Steven D'Aprano wrote: > Why is it that only Linux and Mac users are accused of being "zealots"? Oh please. Don't tar me with the Windows brush. I'd have used the same term no matter what OS was being recommended. > If I ask how to install (say) MYOB or Photoshop on Linux, an

Re: Zealotry [was Re: how to install lxml in window xp?]

2012-01-12 Thread alex23
On Jan 13, 3:02 pm, Steven D'Aprano wrote: > Why is it that only Linux and Mac users are accused of being "zealots"? Incidentally, in the post I replied to, Tamer was talking about Windows 7, so there's that too. Are you just riding out the Friday afternoon clock? -- http://mail.python.org/ma

Re: How to remove ellipses from long paths in traceback?

2012-01-12 Thread Brian Curtin
On Thu, Jan 12, 2012 at 22:34, Jason Veldicott wrote: > Hi, > > Long paths in python traceback are contracted with ellipses.  eg: >   TclError: couldn't load library "C:/Python26/tcl/tk8.5/../../bin/tk85.dll" > > Is there any way to see the full path? > > Surprisingly, search didn't reveal an answ

Re: Zealotry

2012-01-12 Thread Ben Finney
Steven D'Aprano writes: > On Thu, 12 Jan 2012 18:50:13 -0800, alex23 wrote: > > > Tamer Higazi wrote: > >> So, instead of making yourself continuously headache for an > >> outdated OS I advise [...] > > > > Please don't recommend people use another OS when they ask an > > explicit question abou

Re: How to remove ellipses from long paths in traceback?

2012-01-12 Thread Christian Heimes
Am 13.01.2012 05:34, schrieb Jason Veldicott: > Hi, > > Long paths in python traceback are contracted with ellipses. eg: > TclError: couldn't load library "C:/Python26/tcl/tk8.5/../../bin/tk85.dll" > > Is there any way to see the full path? The dots don't look like an ellipses to me. An ellip

Re: Zealotry

2012-01-12 Thread Chris Angelico
On Fri, Jan 13, 2012 at 5:02 PM, Ben Finney wrote: > Giving a recommendation for a different OS is not zealotry. The line to zealotry is (probably) crossed when _every_ problem is met with "Install XYZ then". But that can still be correct. If you're currently using flat files and NetBEUI to mana

Re: [Python-ideas] Symbolic expressions (or: partials and closures from the inside out)

2012-01-12 Thread Chris Rebert
On Thu, Jan 12, 2012 at 3:03 PM, Terry Reedy wrote: > On 1/12/2012 3:45 PM, Nathan Rice wrote: > print isinstance(3, const) >> >> True > > > A Contraints instance defines a set. 'const' is the set 'odd_ge_3' > It would look better if you used standard syntax and do the inclusion check > in a

Re: [Python-ideas] Symbolic expressions (or: partials and closures from the inside out)

2012-01-12 Thread Nathan Rice
>> I have been writing a lot of code lately that involves creating >> symbolic expressions of one form or another, which are then fully >> evaluated at a later time.  Examples of this include Elementwise, > > > Python is designed for concrete, rather than symbolic computation. But the > latter has

Re: Zealotry [was Re: how to install lxml in window xp?]

2012-01-12 Thread Noah Hall
On Fri, Jan 13, 2012 at 5:47 AM, alex23 wrote: > On Jan 13, 3:02 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: >> Why is it that only Linux and Mac users are accused of being "zealots"? > > Incidentally, in the post I replied to, Tamer was talking about > Windows 7, so there's that

Re: Zealotry [was Re: how to install lxml in window xp?]

2012-01-12 Thread Stefan Behnel
alex23, 13.01.2012 06:41: > On Jan 13, 3:02 pm, Steven D'Aprano wrote: >> Why is it that only Linux and Mac users are accused of being "zealots"? > > Oh please. Don't tar me with the Windows brush. I'd have used the same > term no matter what OS was being recommended. > >> If I ask how to install