Re: Dumping all the sql statements as backup

2012-08-29 Thread Robert Miles
On 7/25/2012 8:56 AM, andrea crotti wrote: I have some long running processes that do very long simulations which at the end need to write things on a database. At the moment sometimes there are network problems and we end up with half the data on the database. The half-data problem is probably

Re: "convert" string to bytes without changing data (encoding)

2012-08-29 Thread Nobody
On Wed, 29 Aug 2012 19:39:15 -0400, Piet van Oostrum wrote: >> Reading from stdin/a file gets you bytes, and not a string, because >> Python cannot automagically guess what format the input is in. >> > Huh? Oh, it can certainly guess (in the absence of any other information, it uses the current l

Re: catch UnicodeDecodeError

2012-08-29 Thread Robert Miles
On 7/26/2012 5:51 AM, Jaroslav Dobrek wrote: And the cool thing is: you can! :) In Python 2.6 and later, the new Py3 open() function is a bit more hidden, but it's still available: from io import open filename = "somefile.txt" try: with open(filename, encoding="utf-8")

Re: A sad day for the scientific Python community. John Hunter, creator of matplotlib: 1968-2012.

2012-08-29 Thread George Silva
May he rest in peace. On Wed, Aug 29, 2012 at 11:41 PM, Fernando Perez wrote: > Dear friends and colleagues, > > I am terribly saddened to report that yesterday, August 28 2012 at > 10am, John D. Hunter died from complications arising from cancer > treatment at the University of Chicago hospital

Re: Sending USB commands with Python

2012-08-29 Thread Adam W.
On Wednesday, August 29, 2012 10:07:54 PM UTC-4, Dennis Lee Bieber wrote: > On Wed, 29 Aug 2012 16:45:10 -0700 (PDT), "Adam W." > > I'm a tad curious if using the notation > > > > b'\x1bA' > > > > without the .encode() would work. > > > > My concern is that you ma

Re: [pyxl] xlrd-0.8.0 .xlsx formatting_info=True not implemented

2012-08-29 Thread python-excel
John Yeung wrote: > > is there any other way to tell how many digits excel would round to > > when displaying a floating point number? that's my only reason for > > needing formatting_info=True. > > I have not personally used it, but OpenPyXL is another option for > working with .xlsx files, and

A sad day for the scientific Python community. John Hunter, creator of matplotlib: 1968-2012.

2012-08-29 Thread Fernando Perez
Dear friends and colleagues, I am terribly saddened to report that yesterday, August 28 2012 at 10am, John D. Hunter died from complications arising from cancer treatment at the University of Chicago hospital, after a brief but intense battle with this terrible illness. John is survived by his w

Re: Sending USB commands with Python

2012-08-29 Thread MRAB
On 30/08/2012 00:45, Adam W. wrote: On Wednesday, August 29, 2012 6:56:16 PM UTC-4, Dennis Lee Bieber wrote: BUT you do give a possible clue. Is the OP using a 3.x Python where strings are Unicode -- in which case the above may need to be explicitly declared as a "byte string" rather

Is socket.recvfrom broken in ActiveState Python 3.2?

2012-08-29 Thread bbeacham
Obviously, this my issue, but I cannot figure out what I am doing wrong. I have the Python echo server example implemented with the server on a Windows 7 computer and the client on a Linux Redhat server. The line 'data = sock.recv(1024)' works as expected on the Linux client. However, the line

Re: Sending USB commands with Python

2012-08-29 Thread Adam W.
On Wednesday, August 29, 2012 6:56:16 PM UTC-4, Dennis Lee Bieber wrote: > > BUT you do give a possible clue. Is the OP using a 3.x Python where > > strings are Unicode -- in which case the above may need to be explicitly > > declared as a "byte string" rather than text (unicode) string. >

Re: "convert" string to bytes without changing data (encoding)

2012-08-29 Thread Piet van Oostrum
Heiko Wundram writes: > Reading from stdin/a file gets you bytes, and > not a string, because Python cannot automagically guess what format the > input is in. > Huh? Python 3.3.0rc1 (v3.3.0rc1:8bb5c7bc46ba, Aug 25 2012, 10:09:29) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help"

Re: "convert" string to bytes without changing data (encoding)

2012-08-29 Thread Piet van Oostrum
Ross Ridge writes: > > But it is in fact only stored in one particular way, as a series of bytes. > No, it can be stored in different ways. Certainly in Python 3.3 and beyond. And in 3.2 also, depending on wide/narrow build. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142B

Re: Sending USB commands with Python

2012-08-29 Thread Cameron Simpson
On 30Aug2012 08:29, I wrote: | UTF-16? ISTR that Windows often uses big endian UTF-16 [...] Sorry, little-endian. Anyway... -- Cameron Simpson Ed Campbell's pointers for long trips: 3. Stop and take a break before you really need it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending USB commands with Python

2012-08-29 Thread Cameron Simpson
On 29Aug2012 17:57, Dennis Lee Bieber wrote: | On Wed, 29 Aug 2012 14:21:30 -0700 (PDT), "Adam W." | declaimed the following in | gmane.comp.python.general: | > You are correct about the 2 being the number of bytes written. However when I issue a read command I get: | > | > >>> ep.write('\x1BA

Re: How to program test(expr) ?

2012-08-29 Thread Terry Reedy
On 8/29/2012 11:04 AM, Franck Ditter wrote: I use Python 3.2.3 + Idle. Is it possible to program test(e) which takes an expression e and whose execution produces at the toplevel an echo of e and the effects and result of its evaluation ? No, not as Python is delivered. # file foo.py def foo(

Re: ctypes - python2.7.3 vs python3.2.3

2012-08-29 Thread Jan Kuiken
On 8/28/12 23:51 , John Gordon wrote: In <18eb8025-7545-4d10-9e76-2e41deaad...@googlegroups.com> Rolf writes: uint32_t myfunction (char ** _mydata) { char mydata[16]; strcpy(mydata, "Hello Dude!"); *_mydata = mydata; return 0; } mydata is an auto variable, which goe

Re: Sending USB commands with Python

2012-08-29 Thread Adam W.
On Wednesday, August 29, 2012 4:09:49 PM UTC-4, Dennis Lee Bieber wrote: > > Don't the commands require an character? "\x1BA" (or >"\x1B\x41") > > OTOH, if the is issued behind the scenes, I'm not sure which esc char it is asking for, I don't think libusb is providing its own,

Re: Cut out XML subtree

2012-08-29 Thread Andreas Perstinger
On Wed, 29 Aug 2012 18:17:18 +0200 Florian Lindner wrote: > I want to cut out an XML subtree like that: [snip] > Is there a way I can do that using etree or DOM? The first is > prefered... Python 3.2.2 (default, Sep 5 2011, 22:09:30) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" o

Cut out XML subtree

2012-08-29 Thread Florian Lindner
Hello, I have a (rather small, memory consumption is not an issue) XML document. The application is still at the planning stage, so none of the XML parsers from the stdlib is choosen yet. I want to cut out an XML subtree like that: Now I want to get the subB note inclu

Re: Flexible string representation, unicode, typography, ...

2012-08-29 Thread Chris Angelico
On Thu, Aug 30, 2012 at 1:43 AM, wrote: > If "Python" has found a new way to cover the set > of the Unicode characters, why not proposing it > to the Unicode consortium? Python's open source. If some other language wants to borrow the idea, they can look at the code, or alternatively, just read

Re: Flexible string representation, unicode, typography, ...

2012-08-29 Thread wxjmfauth
Le mercredi 29 août 2012 14:01:57 UTC+2, Dave Angel a écrit : > On 08/29/2012 07:40 AM, wxjmfa...@gmail.com wrote: > > > > > > > > Forget Python and all these benchmarks. The problem is on an other > > > level. Coding schemes, typography, usage of characters, ... For a > > > given coding sch

How to program test(expr) ?

2012-08-29 Thread Franck Ditter
Hi ! I use Python 3.2.3 + Idle. Is it possible to program test(e) which takes an expression e and whose execution produces at the toplevel an echo of e and the effects and result of its evaluation ? # file foo.py def foo(x) : print('x =',x) return x+1 test(foo(5)) # RUN ! # produces at the

Re: [pyxl] xlrd-0.8.0 .xlsx formatting_info=True not imlemented

2012-08-29 Thread John Yeung
> is there any other way to tell how many digits excel would round to > when displaying a floating point number? that's my only reason for > needing formatting_info=True. I have not personally used it, but OpenPyXL is another option for working with .xlsx files, and it might provide the formatting

Re: Are the property Function really useful?

2012-08-29 Thread Mark Lawrence
On 29/08/2012 11:32, levinie...@gmail.com wrote: Rather more useful than your question :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I get logging.FileHandler to close the file on each emit?

2012-08-29 Thread rikardhulten
On Wednesday, August 29, 2012 2:48:57 PM UTC+2, Mark Lawrence wrote: > On 29/08/2012 11:18, wrote: > > > I use logging.FileHandler (on windows) and I would like to be able to > > delete the file while the process is running and have it create the file > > again on next log event. > > > > > >

Re: Issue installing pyopencv in mac

2012-08-29 Thread Mark Lawrence
On 29/08/2012 11:21, Rakesh Rocker RuLZzz wrote: I tried installing pyopencv in mac but i gives me an error I have installed all the dependent softwares like opencv,boost, etcstill unable to fix it. also i have updated xcode and using python 2.7 I also tried using mac port but still no use

Re: Sending USB commands with Python

2012-08-29 Thread Adam W.
On Wednesday, August 29, 2012 2:45:17 AM UTC-4, Tim Roberts wrote: > Which operating system are you using? If you are on Windows, then the > > operating system has already loaded a printer driver for this device. > > > The libusb or libusbx libraries can be used to talk to USB devices. There

Re: Can I get logging.FileHandler to close the file on each emit?

2012-08-29 Thread Mark Lawrence
On 29/08/2012 11:18, rikardhul...@gmail.com wrote: I use logging.FileHandler (on windows) and I would like to be able to delete the file while the process is running and have it create the file again on next log event. On windows (not tried linux) this is not possible because the file is locke

Re: Flexible string representation, unicode, typography, ...

2012-08-29 Thread Chris Angelico
On Wed, Aug 29, 2012 at 9:40 PM, wrote: > For a given coding scheme, all code points/characters are > equivalent. Expecting to handle a sub-range in a coding > scheme without shaking that coding scheme is impossible. Not all codepoints are equally likely. That's the whole point behind variable-l

Re: What do I do to read html files on my pc?

2012-08-29 Thread Umesh Sharma
You can use httplib library to download the html and then for extracting the text from it either you can use any library (google for it) or you can use regular expression for it . -- http://mail.python.org/mailman/listinfo/python-list

Re: Flexible string representation, unicode, typography, ...

2012-08-29 Thread Dave Angel
On 08/29/2012 07:40 AM, wxjmfa...@gmail.com wrote: > > Forget Python and all these benchmarks. The problem is on an other > level. Coding schemes, typography, usage of characters, ... For a > given coding scheme, all code points/characters are equivalent. > Expecting to handle a sub-range in a co

Re: Are the property Function really useful? yes.

2012-08-29 Thread Dave Angel
On 08/29/2012 06:32 AM, levinie...@gmail.com wrote: -- DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: Flexible string representation, unicode, typography, ...

2012-08-29 Thread wxjmfauth
Le mercredi 29 août 2012 06:16:05 UTC+2, Ian a écrit : > On Tue, Aug 28, 2012 at 8:42 PM, rusi wrote: > > > In summary: > > > 1. The problem is not on jmf's computer > > > 2. It is not windows-only > > > 3. It is not directly related to latin-1 encodable or not > > > > > > The only question

Re: Flexible string representation, unicode, typography, ...

2012-08-29 Thread wxjmfauth
Le lundi 27 août 2012 22:37:03 UTC+2, (inconnu) a écrit : > Le lundi 27 août 2012 22:14:07 UTC+2, Ian a écrit : > > > On Mon, Aug 27, 2012 at 1:16 PM, wrote: > > > > > > > - Why int32 and not uint32? No idea, I tried to find an > > > > > > > answer without asking. > > > > > > > > > >

Are the property Function really useful?

2012-08-29 Thread levinie001
Are the property Function really useful?   Where can i use the property function? -- http://mail.python.org/mailman/listinfo/python-list

Re: What do I do to read html files on my pc?

2012-08-29 Thread mikcec82
Il giorno lunedì 27 agosto 2012 12:59:02 UTC+2, mikcec82 ha scritto: > Hallo, > > > > I have an html file on my pc and I want to read it to extract some text. > > Can you help on which libs I have to use and how can I do it? > > > > thank you so much. > > > > Michele Hi Peter and thanks

Issue installing pyopencv in mac

2012-08-29 Thread Rakesh Rocker RuLZzz
I tried installing pyopencv in mac but i gives me an error I have installed all the dependent softwares like opencv,boost, etcstill unable to fix it. also i have updated xcode and using python 2.7 I also tried using mac port but still no use can anybody help meThanks in advance. -- http:

Can I get logging.FileHandler to close the file on each emit?

2012-08-29 Thread rikardhulten
I use logging.FileHandler (on windows) and I would like to be able to delete the file while the process is running and have it create the file again on next log event. On windows (not tried linux) this is not possible because the file is locked by the process, can I get it to close the file aft

Re: Flexible string representation, unicode, typography, ...

2012-08-29 Thread Steven D'Aprano
On Tue, 28 Aug 2012 22:15:31 -0600, Ian Kelly wrote: > On Tue, Aug 28, 2012 at 8:42 PM, rusi wrote: >> How difficult would it be to giving the choice of string engine as a >> command-line flag? >> This would avoid the nuisance of having two binaries -- narrow and >> wide. > > Quite difficult.

IDE of the all python version installed cant uploaded

2012-08-29 Thread Mario Blanco
I have from time ago installed Python 2.6, 2.7, 3.2 and the last 3.3 beta but now I can upload the window version not the prompt command some advice is needed i desintalled and reinstall and nothing!! thanks in advance Mario -- http://mail.python.org/mailman/listinfo/python-list