Re: web frameworks that support Python 3

2009-08-24 Thread Graham Dumpleton
On Aug 24, 6:34 am, Sebastian Wiesner basti.wies...@gmx.net wrote: At Sunday 23 August 2009 22:13:16 you wrote: I use Chinese and therefore Unicode very heavily, and so Python 3 is an unavoidable choice for me. Python 2.x supports Unicode just as well as Python 3.  Every common web

Re: elementtree

2009-08-24 Thread Stefan Behnel
Hi, elsa wrote: I know how to turn HTML into an ElementTree object I don't. ;) ElementTree doesn't have an HTML parser, so what do you use for parsing? but I don't know how to then view the structure of this object. Is there a method or module that you can give an ElementTree object to,

Re: [ANN] pyxser-1.2r --- Python-Object to XML serialization module

2009-08-24 Thread Stefan Behnel
Daniel Molina Wegener wrote: * Added encoded serialization of Unicode strings by using the user defined encoding as is passed to the serialization functions as enc parameter As you see, now Unicode strings are serialized as encoded byte string by using the encoding

Python and JMS

2009-08-24 Thread osky
Hi all, I would like to make a JMS client connection from Python to Progress Sonic ESB (JMS message provider similar to WebSphere MQ or Active MQ). What would be the best way to implement that within Python 2.6 ? Any ideas ? Thanks Oscar -- http://mail.python.org/mailman/listinfo/python-list

Re: sgmllib.py

2009-08-24 Thread Stefan Behnel
elsa wrote: I'm new to both this forum and Python, and I've got a bit stuck trying to learn how to parse HTML... If what you want to do is *parse* the HTML instead of trying to *learn* how to parse it, you might want to give the existing (external) HTML parser libraries a try. There's lxml.html

elementtree

2009-08-24 Thread elsa
I have a question about elementtree: I know how to turn HTML into an ElementTree object, but I don't know how to then view the structure of this object. Is there a method or module that you can give an ElementTree object to, and it returns some kind of graphical or printed representation of the

Simple IRC library

2009-08-24 Thread devaru
Hi all, I am new to Python language. I want to capture(either in database or a file) the conversation in IRC. Please suggest me some simple IRC library or code snippet for this. -- http://mail.python.org/mailman/listinfo/python-list

Re: Need cleanup advice for multiline string

2009-08-24 Thread Stefan Behnel
Steven D'Aprano wrote: I'm amused and somewhat perplexed that somebody with the non-English name of Stefan, writing from a .de email address, seems to be assuming that (1) everybody is on the Internet, and (2) everybody on the Internet speaks English. Oh, I totally don't. But most people

Re: Need cleanup advice for multiline string

2009-08-24 Thread Stefan Behnel
Mensanator wrote: On Aug 23, 2:25�pm, Stefan Behnel wrote: Mensanator wrote: asking how many Jews you can fit into a Volswagen. None, because it's already full. A spelling error does not make it any less offensive. As it stands, I find the joke above perfectly acceptable. Using the word

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Piet van Oostrum
Scott David Daniels scott.dani...@acm.org (SDD) wrote: SDD James Harris wrote:... Another option: 0.(2:1011), 0.(8:7621), 0.(16:c26b) where the three characters 0.( begin the sequence. Comments? Improvements? SDD I did a little interpreter where non-base 10 numbers SDD (up to base 36)

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
MRAB wrote: James Harris wrote: On 23 Aug, 00:16, Mel mwil...@the-wire.com wrote: James Harris wrote: I have no idea why Ada which uses the # also apparently uses it to end a number 2#1011#, 8#7621#, 16#c26b# Interesting. They do it because of this example from

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
J. Cliff Dyer wrote: I had an objection to using spaces in numeric literals last time around and it still stands, and it still stands in the new one. What happens if you use a literal like 0x10f 304? Is 304 treated as decimal or hexadecimal? It's not clear how you would begin to combine it.

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread James Harris
On 24 Aug, 02:19, Max Erickson maxerick...@gmail.com wrote: ... It can be assumed however that .9. isn't in binary? That's a neat idea. But an even simpler scheme might be: .octal.100 .decimal.100 .hex.100 .binary.100 .trinary.100 until it gets to this anyway:

Re: Literal concatenation, strings vs. numbers

2009-08-24 Thread Erik Max Francis
Ben Finney wrote: Yet, as was pointed out, that behaviour would be inconsistent with the concatenation of string literals:: abc r'def' ughi 'jkl' u'abcdefghijkl' So, different representations of literals are parsed as separate literals, then concatenated. To have the behaviour you

Re: Python/Fortran interoperability

2009-08-24 Thread nmm1
In article 5134d9f1-0e23-4e05-a817-bf0cc9e85...@w6g2000yqw.googlegroups.com, sturlamolden sturlamol...@yahoo.no wrote: On 24 Aug, 02:26, nos...@see.signature (Richard Maine) wrote: You missed the word OOP, which seemed like the whole point. Not that the particular word is used in the Fortran

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Hendrik van Rooyen
On Monday 24 August 2009 01:04:37 bartc wrote: That's a neat idea. But an even simpler scheme might be: .octal.100 .decimal.100 .hex.100 .binary.100 .trinary.100 until it gets to this anyway: .thiryseximal.100 Yeah right. So now I first have to type a string, which probably has a

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread James Harris
On 24 Aug, 09:05, Erik Max Francis m...@alcyone.com wrote: ... Here's another suggested number literal format. First, keep the familar 0x and 0b of C and others and to add 0t for octal. (T is the third letter of octal as X is the third letter of hex.) The numbers above would be  

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
James Harris wrote: On 24 Aug, 09:05, Erik Max Francis m...@alcyone.com wrote: Here's another suggested number literal format. First, keep the familar 0x and 0b of C and others and to add 0t for octal. (T is the third letter of octal as X is the third letter of hex.) The numbers above would be

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
James Harris wrote: On 24 Aug, 02:19, Max Erickson maxerick...@gmail.com wrote: It can be assumed however that .9. isn't in binary? That's a neat idea. But an even simpler scheme might be: .octal.100 .decimal.100 .hex.100 .binary.100 .trinary.100 until it gets to this anyway: .thiryseximal.100

Re: Protecting against callbacks queuing up?

2009-08-24 Thread Hendrik van Rooyen
On Monday 24 August 2009 02:14:24 Esben von Buchwald wrote: Hello I'm using Python for S60 1.9.7 on my Nokia phone. I've made a program that gets input from an accelerometer sensor, and then calculates some stuff and displays the result. The sensor framework API does a callback to a

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
Hendrik van Rooyen wrote: I also tried to include an example of a literal with a base of a Googol but I ran out of both ink and symbols. :-) ... or particles in the observable Universe, for that matter. -- Erik Max Francis m...@alcyone.com http://www.alcyone.com/max/ San Jose, CA, USA 37

Re: basic thread question

2009-08-24 Thread Piet van Oostrum
Dennis Lee Bieber wlfr...@ix.netcom.com (DLB) wrote: DLB On Sun, 23 Aug 2009 22:14:17 -0700, John Nagle na...@animats.com DLB declaimed the following in gmane.comp.python.general: Multiple Python processes can run concurrently, but each process has a copy of the entire Python system, so the

Re: Items inheriting attributes from its container?

2009-08-24 Thread Bruno Desthuilliers
Kreso a écrit : I would like to create a list-like container class so that, additionally to usual list methods, I could attach attributes to the container instances. However, I would like it so that the items contained in the particular instance of container somehow 'inherit' those attributes

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread James Harris
On 24 Aug, 09:30, Erik Max Francis m...@alcyone.com wrote: James Harris wrote: On 24 Aug, 09:05, Erik Max Francis m...@alcyone.com wrote: Here's another suggested number literal format. First, keep the familar 0x and 0b of C and others and to add 0t for octal. (T is the third letter of

Re: Newbie: list comprehension troubles..

2009-08-24 Thread Bruno Desthuilliers
mm a écrit : Hi, I'm trying to replace this... # this works but there must be a more pythonic way, right? tlist = [] for obj in self.objs: t = obj.intersect(ray) if (t != None): hint 1 : this is Python, you don't need parens around conditionals.

Re: sgmllib.py

2009-08-24 Thread Dave Angel
elsa wrote: Hi all, I'm new to both this forum and Python, and I've got a bit stuck trying to learn how to parse HTML here is my problem I'm using a textbook that uses sgmllib.py for all its examples. I'm aware that sgmllib is not in the current release, however I want to get it to work,

Re: Python and JMS

2009-08-24 Thread Diez B. Roggisch
osky wrote: Hi all, I would like to make a JMS client connection from Python to Progress Sonic ESB (JMS message provider similar to WebSphere MQ or Active MQ). What would be the best way to implement that within Python 2.6 ? Any ideas ? I just recently learned about JCC - a

Re: sgmllib.py

2009-08-24 Thread Stefan Behnel
Dave Angel schrieb: elsa wrote: python sgmllib.py path/to/my/file.html example (1) The path in the error message simply refers to the full path string to your Python interpreter, and reflects %0 in your shell. So I'd assume you've got a script called 'python' on your path, which

Re: basic thread question

2009-08-24 Thread Dave Angel
Dennis Lee Bieber wrote: On Sun, 23 Aug 2009 22:14:17 -0700, John Nagle na...@animats.com declaimed the following in gmane.comp.python.general: Multiple Python processes can run concurrently, but each process has a copy of the entire Python system, so the memory and cache footprints

Re: elementtree

2009-08-24 Thread Dave Angel
Stefan Behnel wrote: Hi, elsa wrote: I know how to turn HTML into an ElementTree object I don't. ;) ElementTree doesn't have an HTML parser, so what do you use for parsing? but I don't know how to then view the structure of this object. Is there a method or module that you can

Re: elementtree

2009-08-24 Thread Stefan Behnel
Dave Angel wrote: Stefan Behnel wrote: elsa wrote: I know how to turn HTML into an ElementTree object I don't. ;) ElementTree doesn't have an HTML parser, so what do you use for parsing? Perhaps the OP was referring to XHTML, which should be eligible for ElementTree. But could you

Re: Python and JMS

2009-08-24 Thread Stefan Behnel
osky wrote: I would like to make a JMS client connection from Python to Progress Sonic ESB (JMS message provider similar to WebSphere MQ or Active MQ). Never needed this, but Google gives me this as first hit http://hjb.python-hosting.com/ and this c.l.py thread reference a little further

Re: Literal concatenation, strings vs. numbers (was: Numeric literals in other than base 10 - was Annoying octal notation)

2009-08-24 Thread Carl Banks
On Aug 23, 7:45 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: greg g...@cosc.canterbury.ac.nz writes: J. Cliff Dyer wrote: What happens if you use a literal like 0x10f 304? To me the obvious thing to do is concatenate them textually and then treat the whole thing as a single numeric

Re: can python make web applications?

2009-08-24 Thread Martin P. Hellwig
Deep_Feelings wrote: can python make powerfull database web applications that can replace desktop database applications? e.g: entrprise accounting programs,enterprise human resource management programs ...etc As the other replies already mentioned that these already exists, I would like to add

Re: basic thread question

2009-08-24 Thread Piet van Oostrum
Dave Angel da...@ieee.org (DA) wrote: DA Dennis Lee Bieber wrote: On Sun, 23 Aug 2009 22:14:17 -0700, John Nagle na...@animats.com declaimed the following in gmane.comp.python.general: Multiple Python processes can run concurrently, but each process has a copy of the entire Python

Re: elementtree

2009-08-24 Thread Carl Banks
On Aug 24, 12:13 am, Stefan Behnel stefan...@behnel.de wrote: Hi, elsa wrote: I know how to turn HTML into an ElementTree object I don't. ;) ElementTree doesn't have an HTML parser, so what do you use for parsing? The OP could be feeding the HTML through tidy, or it could be XHTML.

Re: your favorite debugging tool?

2009-08-24 Thread Jean-Michel Pichavant
Esmail wrote: Hi all, What is your favorite tool to help you debug your code? I've been getting along with 'print' statements but that is getting old and somewhat cumbersome. I'm primarily interested in utilities for Linux (but if you have recommendations for Windows, I'll take them too :) I

Re: Newbie: list comprehension troubles..

2009-08-24 Thread Francesco Bochicchio
On 24 Ago, 01:27, mm matta...@gmail.com wrote: Hi, I'm trying to replace this...         # this works but there must be a more pythonic way, right?         tlist = []         for obj in self.objs:             t = obj.intersect(ray)             if (t != None):                

Re: Is Python what I need?

2009-08-24 Thread Jean-Michel Pichavant
Peter Otten wrote: newbie wrote: I'm interested in developing computer based, interactive programs for students in a special school who have an aversion to pen and paper. I've searched the net to find ready made software that will meet my needs but it is either written to a level much

Python for professsional Windows GUI apps?

2009-08-24 Thread Gilles Ganault
Hello I was wondering if some people in this ng use Python and some GUI toolkit (PyWin32, wxWidgets, QT, etc.) to build professional applications, and if yes, what it's like, the pros and cons, etc. I'm especially concerned about the lack of controls, the lack of updates (lots of

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread NevilleDNZ
On Aug 23, 9:42 pm, James Harris james.harri...@googlemail.com wrote: The numbers above would be 0b1011, 0t7621, 0xc26b Algol68 has the type BITS, that is converted to INT with the ABS operator. The numbers above would be: 2r1011, 8r7621, 16rc26b r is for radix:

Re: [ANN] pyxser-1.2r --- Python-Object to XML serialization module

2009-08-24 Thread Daniel Molina Wegener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Stefan Behnel stefan...@behnel.de on Monday 24 August 2009 03:16 wrote in comp.lang.python: Daniel Molina Wegener wrote: * Added encoded serialization of Unicode strings by using the user defined encoding as is passed to the

Temat:,Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Ryniek90
John Machin wrote: Erik Max Francis max at alcyone.com writes: I also suspect the pipe symbol. I don't know if it's an invalid character to Windows, but it's certainly a bad idea. The '|' character means something special to the shell. The pipe character is not a

Re: [ANN] pyxser-1.2r --- Python-Object to XML serialization module

2009-08-24 Thread Stefan Behnel
Daniel Molina Wegener wrote: unicode objects are encoded into the encoding that the XML document encoding has, and as you say, the whole XML document has one encoding. There is no mixing of byte encoded strings with different encodings in the outout document. Ok, that's what I hoped anyway.

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Mel
James Harris wrote: On 24 Aug, 02:19, Max Erickson maxerick...@gmail.com wrote: [ ... ] int('100', 3) 9 int('100', 36) 1296 This is fine typed into the language directly but couldn't be entered by the user or read-in from or written to a file. That's rather beside the point. Literals

Re: conditional for-statement

2009-08-24 Thread Bruno Desthuilliers
seb a écrit : Hi, i was wondering if there is a syntax alike: for i in range(10) if i 5: print i equivalent to for i in (for i in range(10) if i5): print i what about : for i in range(6, 10): print i g More seriously: for i in range(10): if i 5: print i --

P3 weird sys.stdout.write()

2009-08-24 Thread Jerzy Jalocha N
I've stumbled upon the following in Python 3: Python 3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information. import sys sys.stdout.write() 0 sys.stdout.write(something) something9 write() is appending the length of the

Re: P3 weird sys.stdout.write()

2009-08-24 Thread Diez B. Roggisch
Jerzy Jalocha N wrote: I've stumbled upon the following in Python 3: Python 3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information. import sys sys.stdout.write() 0 sys.stdout.write(something) something9 write()

Re: P3 weird sys.stdout.write()

2009-08-24 Thread André
On Aug 24, 10:13 am, Jerzy Jalocha N jjalo...@gmail.com wrote: I've stumbled upon the following in Python 3: Python 3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information. import sys sys.stdout.write() 0

Re: Is Python what I need?

2009-08-24 Thread Peter Otten
Jean-Michel Pichavant wrote: From the distance it looks like these children need a good teacher rather than a bad (or just starting) programmer. Wow, that is rude. Let's keep this list friendly, won't we ? I may have been too blunt, and if my message has come across as an insult I apologize

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Sun, Aug 23, 2009 at 06:13:31AM +, Steven D'Aprano wrote: On Sat, 22 Aug 2009 22:19:01 -0500, Derek Martin wrote: On Sat, Aug 22, 2009 at 02:55:51AM +, Steven D'Aprano wrote: And the great thing is that now you get to teach yourself to stop writing octal numbers implicitly and be

Re: P3 weird sys.stdout.write()

2009-08-24 Thread Jerzy Jalocha N
import sys n = sys.stdout.write('something') something n 9 Yes, that works as expected, now, similar to 2.6. Thank you both, Diez and André! -Jerzy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/Fortran interoperability

2009-08-24 Thread sturlamolden
On 24 Aug, 10:24, n...@cam.ac.uk wrote: In article 5134d9f1-0e23-4e05-a817-bf0cc9e85...@w6g2000yqw.googlegroups.com, sturlamolden  sturlamol...@yahoo.no wrote: On 24 Aug, 02:26, nos...@see.signature (Richard Maine) wrote: You missed the word OOP, which seemed like the whole point. Not that

Re: Python/Fortran interoperability

2009-08-24 Thread Paul van Delst
sturlamolden wrote: On 24 Aug, 02:57, nos...@see.signature (Richard Maine) wrote: Does anyone use OOP in Fortran anyway? I do - currently for learning (and eventually training) purposes so I don't distribute any of the code. But, the fact that... Fortran 2003 compilers are not ubiquitous.

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Sun, Aug 23, 2009 at 01:13:32PM +, Matthew Woodcraft wrote: Dennis Lee Bieber wlfr...@ix.netcom.com writes: About the only place one commonly sees leading zeros on decimal numbers, in my experience, is zero-filled COBOL data decks (and since classic COBOL stores in BCD anyway...

Re: Object Reference question

2009-08-24 Thread Bruno Desthuilliers
josef a écrit : (snip) I think that something like a = MyClass0(name = 'a', ...) is a bit redundant. Are definitions treated the same way? How would one print or pass function names? In Python, classes and functions are objects too. The class and def statements are mostly syntactic sugar

IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Ryniek90
John Machin wrote: Erik Max Francis max at alcyone.com writes: I also suspect the pipe symbol. I don't know if it's an invalid character to Windows, but it's certainly a bad idea. The '|' character means something special to the shell. The pipe character is not a valid character in a

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 08:56:48AM -0500, Derek Martin wrote: On Sun, Aug 23, 2009 at 01:13:32PM +, Matthew Woodcraft wrote: A more common case is dates. I suppose this is true, but [...] I tend to also discount this example, because when we write dates with leading zeros, usually it's

Re: Trying To Catch Invalid User Input

2009-08-24 Thread Victor Subervi
That's nice. Thanks! V On Sun, Aug 23, 2009 at 5:02 PM, Dennis Lee Bieber wlfr...@ix.netcom.comwrote: On Sun, 23 Aug 2009 10:04:57 -0500, Victor Subervi victorsube...@gmail.com declaimed the following in gmane.comp.python.general: Hi; I have the following: style = raw_input('What

Re: basic thread question

2009-08-24 Thread sturlamolden
On 18 Aug, 22:10, Derek Martin c...@pizzashack.org wrote: I have some simple threaded code...  If I run this with an arg of 1 (start one thread), it pegs one cpu, as I would expect.  If I run it with an arg of 2 (start 2 threads), it uses both CPUs, but utilization of both is less than 50%.  

Re: Is Python what I need?

2009-08-24 Thread David Robinow
On Mon, Aug 24, 2009 at 9:32 AM, Peter Otten__pete...@web.de wrote: If you are trying to teach children that are unwilling to use pen and paper putting them in front of a computer doesn't help you and them one bit. As a starting programmer you'll have to spend a lot of time in front of your

Re: basic thread question

2009-08-24 Thread sturlamolden
On 24 Aug, 13:21, Piet van Oostrum p...@cs.uu.nl wrote: But os.fork() is not available on Windows. And I guess refcounts et al. will soon destroy the sharing. Well, there is os.fork in Cygwin and SUA (SUA is the Unix subsytem in Windows Vista Professional). Cygwin's fork is a bit sluggish.

Reading binary files

2009-08-24 Thread Ronn Ross
I need to read a binary file. When I open it up in a text editor it is just junk. Does Python have a class to help with this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Temat:,Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Dave Angel
Ryniek90 wrote: div class=moz-text-flowed style=font-family: -moz-fixed John Machin wrote: Erik Max Francis max at alcyone.com writes: I also suspect the pipe symbol. I don't know if it's an invalid character to Windows, but it's certainly a bad idea. The '|' character means

Re: Numeric literals in other than base 10 - was Annoying octal?notation

2009-08-24 Thread garabik-news-2005-05
J. Cliff Dyer j...@sdf.lonestar.org wrote: I had an objection to using spaces in numeric literals last time around and it still stands, and it still stands in the new one. Or, we can use U+00A0 NO-BREAK SPACE, once we already have unicode variable names :-) (probably some people would find it

Re: Reading binary files

2009-08-24 Thread Rami Chowdhury
The built-in file type deals with this just fine. You can simply specify when opening the file that it is to be opened as binary: http://docs.python.org/library/functions.html#open On Mon, 24 Aug 2009 07:35:09 -0700, Ronn Ross ronn.r...@gmail.com wrote: I need to read a binary file. When I

Re: Reading binary files

2009-08-24 Thread Albert Hopkins
On Mon, 2009-08-24 at 10:35 -0400, Ronn Ross wrote: I need to read a binary file. When I open it up in a text editor it is just junk. Does Python have a class to help with this? Yes, the file class. myfile = open('/path/to/binary/file', 'rb') -a --

Re: Temat:,Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Tim Golden
Dave Angel wrote: You still haven't gotten rid of those illegal colons in the filename. They're not legal in Windows, as has been pointed out a couple of times in this thread. Ummm.. Colons are of course legal in Windows filenames as designating the Alternate Data Streams: code with open

Re: Python for professsional Windows GUI apps?

2009-08-24 Thread sturlamolden
On 24 Aug, 14:08, Gilles Ganault nos...@nospam.com wrote: I'm especially concerned about the lack of controls, the lack of updates (lots of controls in wxWidgets are 1.0 deadware), and problems linked to how to update users' PC remotely when I build a new version using eg. Py2exe. There is

Re: P3 weird sys.stdout.write()

2009-08-24 Thread Dave Angel
Jerzy Jalocha N wrote: I've stumbled upon the following in Python 3: Python 3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information. import sys sys.stdout.write() 0 sys.stdout.write(something)

Re: Temat:, Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread John Machin
On Aug 25, 12:46 am, Tim Golden m...@timgolden.me.uk wrote: Dave Angel wrote: You still haven't gotten rid of those illegal colons in the filename.   They're not legal in Windows, as has been pointed out a couple of times in this thread. Ummm.. Colons are of course legal in Windows

Re: Python/Fortran interoperability

2009-08-24 Thread Kurt Smith
On Sun, Aug 23, 2009 at 9:21 AM, Stefan Behnelstefan...@behnel.de wrote: n...@cam.ac.uk wrote: I am interested in surveying people who want to interoperate between Fortran and Python to find out what they would like to be able to do more conveniently, especially with regard to types not

problem to write a THREAD enabled python extension

2009-08-24 Thread Andreas Otto
Hi, the following scenario: 1. using GIL 2. a pthread is created in a library and have to be announced to python 3. the thread is created in a PyObject_CallObject function call from extension c code using a other extension c-code function called from python code python

Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Stephen Hansen
The proper path is C:\\Users\\Ryniek's WinSe7en\\MyNewGGBackup(2009-08-23 14:59:02).tar.bz2 and that string literal is \U, without any pipes :) The truth is that script works on linux (ubuntu) but not on windows (neither Win7 nor WinXP). Maybe it's good idea to use raw string for

Fedex + SOAP

2009-08-24 Thread Greg Taylor
Fedex has recently started the process to transition from their XML- based Web Services to the new SOAP-based equivalent. I've been trying unsuccessfully to get an example SOAP transaction working with their new service, but am running into validation problems. I was wondering if anyone has

Re: Python for professsional Windows GUI apps?

2009-08-24 Thread sturlamolden
On 24 Aug, 14:08, Gilles Ganault nos...@nospam.com wrote: and problems linked to how to update users' PC remotely when I build a new version using eg. Py2exe. Remote update is a problem regardless of language. It typically involves the following steps: 1. Download the update from a server

Re: problem to write a THREAD enabled python extension

2009-08-24 Thread Stefan Behnel
Andreas Otto wrote: Hi, the following scenario: 1. using GIL 2. a pthread is created in a library and have to be announced to python 3. the thread is created in a PyObject_CallObject function call from extension c code using a other extension c-code function called

Re: P3 weird sys.stdout.write()

2009-08-24 Thread Jerzy Jalocha N
On Mon, Aug 24, 2009 at 10:52 AM, Dave Angelda...@ieee.org wrote: The write() function changed in 3.0, but not in the way you're describing.  It now (usually) has a return value, the count of the number of characters written. [...] But because you're running from the interpreter, you're seeing

Re: your favorite debugging tool?

2009-08-24 Thread Esmail
Hello, thank you all for your suggestions/comments. While I do believe in a minimalist approach (part of the reason I find Python so appealing), using print statements sometimes only goes so far (for me). I probably should look into using iPython in the context of debugging (I already use this

print() and unicode strings (python 3.1)

2009-08-24 Thread 7stud
==python 2.6 == import sys print sys.getdefaultencoding() s = u\u20ac print s.encode(utf-8) $ python2.6 1test.py ascii € =python 3.1 === import sys print(sys.getdefaultencoding()) s = € print(s.encode(utf-8)) print(s) $ python3.1 1test.py utf-8 b'\xe2\x82\xac' Traceback

Re: Annoying octal notation

2009-08-24 Thread Carl Banks
On Aug 24, 6:56 am, Derek Martin c...@pizzashack.org wrote:  I think hard-coding dates is more uncommon than using octal. ;-)  [It unquestionably is, for me personally.] You just don't get it, do you? Do you really think this is a contest over what's more common and the winner gets to choose

Re: Protecting against callbacks queuing up?

2009-08-24 Thread Esben von Buchwald
Hendrik van Rooyen wrote: see if there is an after method somewhere. What you have to do is to break the link between the callback and the processing. Your code above is all in the callback thread, despite the fact that you call another function to do the processing. So if you replace the

Re: Literal concatenation, strings vs. numbers (was: Numeric literals in other than base 10 - was Annoying octal notation)

2009-08-24 Thread Steven D'Aprano
On Mon, 24 Aug 2009 12:45:25 +1000, Ben Finney wrote: greg g...@cosc.canterbury.ac.nz writes: J. Cliff Dyer wrote: What happens if you use a literal like 0x10f 304? To me the obvious thing to do is concatenate them textually and then treat the whole thing as a single numeric literal.

Re: Need cleanup advice for multiline string

2009-08-24 Thread Steven D'Aprano
On Mon, 24 Aug 2009 09:40:03 +0200, Stefan Behnel wrote: Or you could enter the 21 century and understand that guys has become a generic term for people of any sex. Is that true for everyone who understands and/or writes English? In that case, I'm fine with your above statement. Otherwise,

Re: Python for professsional Windows GUI apps?

2009-08-24 Thread Stephen Hansen
I was wondering if some people in this ng use Python and some GUI toolkit (PyWin32, wxWidgets, QT, etc.) to build professional applications, and if yes, what it's like, the pros and cons, etc. My company does. A few years ago we decided to re-write our entire aging product line in

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 05:22:39PM +0200, Hendrik van Rooyen wrote: Assuming I'm right about that, then the use of a leading 0 to represent octal actually predates the prevalence of using 0 in dates by almost two decades. Not quite - at the time I started, punch cards and data entry

Re: print() and unicode strings (python 3.1)

2009-08-24 Thread Martin v. Löwis
I don't understand why I'm getting an encode error in python 3.1. The default encoding is not relevant here at all. Look at sys.stdout.encoding. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6 still not giving memory back to the OS...

2009-08-24 Thread Chris Withers
Martin v. Löwis wrote: Today, there are two cases when malloc returns memory on a typical Unix system (in particular, in Linux malloc): a) if the malloc block block is small (below page size), it is allocated from the brk heap, where it can only be returned if the last page of that heap is

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Scott David Daniels
Piet van Oostrum wrote: Scott David Daniels scott.dani...@acm.org (SDD) wrote: SDD James Harris wrote:... Another option: 0.(2:1011), 0.(8:7621), 0.(16:c26b) where the three characters 0.( begin the sequence. Comments? Improvements? SDD I did a little interpreter where non-base 10

Re: Barcodes

2009-08-24 Thread Chris Withers
Ronn Ross wrote: I found this library, but no documentation(https://cybernetics.hudora.biz/projects/wiki/huBarcode). Has anyone used this or know of a similar library with better documentation? Yup, reportlab has really good barcode generation stuff. I use it to generate labels with

Re: Need cleanup advice for multiline string

2009-08-24 Thread Stefan Behnel
Steven D'Aprano wrote: On Mon, 24 Aug 2009 09:40:03 +0200, Stefan Behnel wrote: Or you could enter the 21 century and understand that guys has become a generic term for people of any sex. Is that true for everyone who understands and/or writes English? In that case, I'm fine with your above

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 08:31:13AM -0700, Carl Banks wrote: On Aug 24, 6:56 am, Derek Martin c...@pizzashack.org wrote:  I think hard-coding dates is more uncommon than using octal. ;-)  [It unquestionably is, for me personally.] You just don't get it, do you? I think I get it just fine,

Re: Annoying octal notation

2009-08-24 Thread Steven D'Aprano
On Mon, 24 Aug 2009 09:14:25 -0500, Derek Martin wrote: Assuming I'm right about that, then the use of a leading 0 to represent octal actually predates the prevalence of using 0 in dates by almost two decades. And while using leading zeros in other contexts is familiar to me, I would

Re: Reading binary files

2009-08-24 Thread Ronn Ross
On Mon, Aug 24, 2009 at 11:18 AM, Ronn Ross ronn.r...@gmail.com wrote: On Mon, Aug 24, 2009 at 10:43 AM, Albert Hopkins mar...@letterboxes.orgwrote: On Mon, 2009-08-24 at 10:35 -0400, Ronn Ross wrote: I need to read a binary file. When I open it up in a text editor it is just junk.

Re: print() and unicode strings (python 3.1)

2009-08-24 Thread 7stud
On Aug 24, 9:56 am, Martin v. Löwis mar...@v.loewis.de wrote: I don't understand why I'm getting an encode error in python 3.1. The default encoding is not relevant here at all. Look at sys.stdout.encoding. Regards, Martin Hi, Thanks for the response. I get US-ASCII for both 2.6 and

Re: Python for professsional Windows GUI apps?

2009-08-24 Thread rurpy
On 08/24/2009 06:08 AM, Gilles Ganault wrote: I was wondering if some people in this ng use Python and some GUI toolkit (PyWin32, wxWidgets, QT, etc.) to build professional applications, and if yes, what it's like, the pros and cons, etc. I'm especially concerned about the lack of

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 04:47:43PM +, Steven D'Aprano wrote: Except of course to anyone familiar with mathematics in the last, oh, five hundred years or so. Mathematics has used a positional system for numbers for centuries now: leading zeroes have been insignificant, just like trailing

Re: Annoying octal notation

2009-08-24 Thread Steven D'Aprano
On Mon, 24 Aug 2009 11:21:46 -0500, Derek Martin wrote: since the old syntax is prevalent both within and without the Python community, making the change is, was, and always will be a bad idea. Octal syntax isn't prevalent *at all*, except in a small number of niche areas. You've said that

Re: Is Python what I need?

2009-08-24 Thread Robert Kern
On 2009-08-24 08:32 AM, Peter Otten wrote: Jean-Michel Pichavant wrote: From the distance it looks like these children need a good teacher rather than a bad (or just starting) programmer. Wow, that is rude. Let's keep this list friendly, won't we ? I may have been too blunt, and if my

Re: Annoying octal notation

2009-08-24 Thread Harald Luessen
On Mon, 24 Aug 2009 Derek Martin wrote: Those participating in this thread have pretty much all seem to agree that the only places where decimal numbers with leading zeros really are common are either in rather specialized applications, such as computer-oriented data or serial numbers (which

  1   2   3   >