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

2009-08-24 Thread John Machin
On Aug 25, 2:08 am, Chris Withers wrote: > 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

Re: best way to display photos

2009-08-24 Thread Thomas Guettler
Some years ago I had the same problem. I wrote a simple app with pygtk. You get get it from here: http://guettli.sourceforge.net/gthumpy/src/README.html The next pictures get loaded in background. Switching from one image to the next is faster then in some other apps. But somehow it is not read

Re: your favorite debugging tool?

2009-08-24 Thread Robert Marshall
On 24 Aug 2009, Paul Rubin wrote: > Esmail writes: >> 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. > > Beyond print statements, I use pdb a lot. Winpdb (www.winpdb.org) is > even be

Re: Annoying octal notation

2009-08-24 Thread Mensanator
On Aug 24, 10:20�pm, Erik Max Francis wrote: > Steven D'Aprano wrote: > > 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 > >> decade

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

2009-08-24 Thread Stefan Behnel
Stefan Behnel wrote: > for all byte > strings, regardless of their encoding (since you can't even know if they > represent encoded text at all). Hmm, having written that, I guess it's actually best to encode byte strings as base64 instead. Otherwise, null bytes and other special byte values won't

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

2009-08-24 Thread Stefan Behnel
Daniel Molina Wegener wrote: > Stefan Behnel wrote: >> Daniel Molina Wegener wrote: >>> When the object is restored, by using pyxser.unserialize: >>> >>> pyobj = pyxser.unserialize(obj = xmldocstr, enc = "utf-8") >> But this is XML, right? What do you need to pass the encoding for at this >> point

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

2009-08-24 Thread Mensanator
On Aug 24, 8:21�pm, Mel wrote: > Mensanator wrote: > > [ ... ] > > >> If you want your data file to have values entered in hex, or oct, or even > >> unary (1=one, 11=two, 111=three, =four...) you can. > > > Unary? I think you'll find that Standard Positional Number > > Systems are not defined

Re: Python for professsional Windows GUI apps?

2009-08-24 Thread sturlamolden
On 25 Aug, 05:56, Peter Decker wrote: > I use the Dabo Class Designer to visually design my forms. So what's > you're point?  :) Nothing, except lobbying for wxFormBuilder for anyone who still doesn't know of it. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Services examples using "raw" xml?

2009-08-24 Thread Stefan Behnel
John Gordon wrote: > I'm developing a program that will use web services, which I have never > used before. > > There are several tutorials out there that advise you to get the WSDL > and then call a method (such as wsdl2py) that inspects the wsdl and > automagically generates the python classes a

Re: Most "active" coroutine library project?

2009-08-24 Thread Denis
You can also at gevent http://pypi.python.org/pypi/gevent On Aug 23, 10:02 pm, Phillip B Oldham wrote: > I've been taking a look at the multitude of coroutine libraries > available for Python, but from the looks of the projects they all seem > to be rather "quiet". I'd like to pick one up to us

Re: csv module and None values

2009-08-24 Thread John Yeung
On Aug 24, 5:00 pm, Peter Otten <__pete...@web.de> wrote: > If I understand you correctly the csv.writer already does > what you want: > > >>> w.writerow([1,None,2]) > 1,,2 > > just sequential commas, but that is the special treatment. > Without it the None value would be converted to a string > an

Re: Simple IRC library

2009-08-24 Thread alex23
devaru wrote: > 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. I recommend the circuits[1] library, which contains a sample irc bot [2]. You'll want to override the messa

Re: csv module and None values

2009-08-24 Thread John Yeung
On Aug 24, 1:30 pm, JKPeck wrote: > I'm trying to get the csv module (Python 2.6) to write data > records like Excel.  The excel dialect isn't doing it.  The > problem is in writing None values.  I want them to result > in just sequential commas - ,, but csv treats None specially, > as the doc say

Re: best way to display photos

2009-08-24 Thread 7stud
On Aug 24, 8:01 pm, Paul Rubin wrote: > samwyse writes: > > My big question is, what's the > > best way to display the photos.  I've used PIL in the past, but IIRC > > it uses an external program.  Pygame is the next obvious choice, but > > like PIL it requires an ad

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

2009-08-24 Thread Ned Deily
In article , 7stud wrote: > On Aug 24, 2:41 pm, "Martin v. Löwis" wrote: > > > I can't figure out a way to programatically set the encoding for > > > sys.stdout.  So where does that leave me? > > > > You should be setting the terminal encoding administratively, not > > programmatically. > > >

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 on Monday 24 August 2009 09:00 wrote in comp.lang.python: > 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 encodi

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

2009-08-24 Thread Tim Roberts
Ryniek90 wrote: > >Sorry, but i don't know where those pipes came from : P > >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 windo

Re: Python for professsional Windows GUI apps?

2009-08-24 Thread Peter Decker
On Mon, Aug 24, 2009 at 10:26 PM, sturlamolden wrote: > On 25 Aug, 03:51, Peter Decker wrote: > >> I've used in fairly regularly for about 2 years now. I haven't had to >> write that ugly wxPython code for so long that every time I see >> examples on their mail list I wanna barf. > > I prefer wxFo

Re: Python for professsional Windows GUI apps?

2009-08-24 Thread Che M
> I'm especially concerned about the lack of controls, the lack of > updates (lots of controls in wxWidgets are 1.0 deadware), I use wxPython. No lack of controls there, and most are up to date. Which "lots" in wxWidgets are you thinking of? > I need controls for business apps like access to d

Re: Python for professsional Windows GUI apps?

2009-08-24 Thread Steve
You can also use Windows Forms with IronPython http://www.ironpython.info/index.php/Contents#Windows_Forms -- http://mail.python.org/mailman/listinfo/python-list

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

2009-08-24 Thread Stephen Hansen
> > > You should be setting the terminal encoding administratively, not > > programmatically. > > > > The terminal encoding has always been utf-8. It was not set > programmatically. > > It seems to me that python 3.1's string handling is broken. > Apparently, in python 3.1 I am unable to explicitl

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

2009-08-24 Thread Erik Max Francis
ryniek wrote: On 24 Sie, 22:34, ryniek wrote: On 24 Sie, 16:56, John Machin wrote: On Aug 25, 12:46 am, Tim Golden 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 th

Re: Annoying octal notation

2009-08-24 Thread Erik Max Francis
Steven D'Aprano wrote: 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"

Next week: the 9th PyWeek game programming challenge!

2009-08-24 Thread Richard Jones
The ninth PyWeek challenge starts this weekend, running between Sunday 30th August to Sunday 6th September (00:00UTC to 00:00UTC) The PyWeek challenge invites entrants to write a game in one week from scratch either as an individual or in a team. Entries must be developed in Python, during the

Re: Protecting against callbacks queuing up?

2009-08-24 Thread ryles
On Aug 23, 8:14 pm, Esben von Buchwald wrote: > I thought that this code would do the trick, but it obviously doesn't > help at all, and i can't understand why... > >      def doCallback(self): >          if self.process_busy==False: >              self.process_busy=True >              self.data_c

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

2009-08-24 Thread 7stud
On Aug 24, 2:41 pm, "Martin v. Löwis" wrote: > > I can't figure out a way to programatically set the encoding for > > sys.stdout.  So where does that leave me? > > You should be setting the terminal encoding administratively, not > programmatically. > The terminal encoding has always been utf-8.

Putting together a larger matrix from smaller matrices

2009-08-24 Thread Matjaz Bezovnik
Dear all, I'm but a layman so do not take offence at this maybe over simple question. This is something which is done often in FEM methods, and the alike. I have matrix A of 3x3 elements, and B, of the same number of elements, 3x3. What would be the most obvious way to assemble a matrix which:

Any Softphone wrote in Python?

2009-08-24 Thread Rodrigo do Carmo
Hi python-community, I would like to ask you if someone know any open source softphone wrote entirely in Python. The thing is that I want to write a honeyphone but starting from a softphone. Sorry if you think that I haven't "googled" enough. Regards, Rodrigo. -- http://mail.python.org/mailman/l

Re: Web Services examples using "raw" xml?

2009-08-24 Thread Asun Friere
On Aug 25, 5:41 am, John Gordon wrote: > >   File "/usr/lib/python2.3/site-packages/suds/client.py", line 59 >     @classmethod >     ^ > SyntaxError: invalid syntax > If memory serves me correctly, decorators were introduced in python2.4. That would account for your SyntaxError. -- http://mai

Re: Python for professsional Windows GUI apps?

2009-08-24 Thread sturlamolden
On 25 Aug, 03:51, Peter Decker wrote: > I've used in fairly regularly for about 2 years now. I haven't had to > write that ugly wxPython code for so long that every time I see > examples on their mail list I wanna barf. I prefer wxFormBuilder. GUIs should be designed visually whenever possible.

Re: best way to display photos

2009-08-24 Thread Paul Rubin
samwyse writes: > My big question is, what's the > best way to display the photos. I've used PIL in the past, but IIRC > it uses an external program. Pygame is the next obvious choice, but > like PIL it requires an add-in. That leaves Tkinter. Has anyone used > it to display .JPG files, perhap

Re: Python for professsional Windows GUI apps?

2009-08-24 Thread Peter Decker
On Mon, Aug 24, 2009 at 11:49 AM, Stephen Hansen wrote: > P.S. I have no idea why I'm pumping Dabo so much in this though I've never > used it! I've used in fairly regularly for about 2 years now. I haven't had to write that ugly wxPython code for so long that every time I see examples on their m

best way to display photos

2009-08-24 Thread samwyse
I have several thousand photographs that I need to quickly classify, all by myself. After extensive searches, I have been unable to find anything to my liking, so desire to write something myself. I'm thinking about displaying a photo and waiting for keystrokes to tag it; 'i' for interior, 'e' fo

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

2009-08-24 Thread Mensanator
On Aug 24, 7:25 pm, Steven D'Aprano wrote: > On Mon, 24 Aug 2009 16:23:06 -0700, James Harris wrote: > > Sure but while I wouldn't normally want to type something as obscure as > > 32"rst" into a file of data I might want to type 0xff00 or similar. That > > is far clearer than 65280 in some cases.

Re: Literal concatenation, strings vs. numbers

2009-08-24 Thread greg
Ben Finney wrote: So, different representations of literals are parsed as separate literals, then concatenated. To have the behaviour you describe, the case needs to be made separately that digit concatenation should not be consistent with the established string literal parsing behaviour. I th

Re: Annoying octal notation

2009-08-24 Thread Steven D'Aprano
On Mon, 24 Aug 2009 12:40:24 -0500, Derek Martin wrote: > On Mon, Aug 24, 2009 at 05:03:28PM +, Steven D'Aprano wrote: >> 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,

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

2009-08-24 Thread Steven D'Aprano
On Mon, 24 Aug 2009 16:23:06 -0700, James Harris wrote: > Sure but while I wouldn't normally want to type something as obscure as > 32"rst" into a file of data I might want to type 0xff00 or similar. That > is far clearer than 65280 in some cases. > > My point was that int('ff00', 16) is OK for t

Re: basic thread question

2009-08-24 Thread sturlamolden
On 25 Aug, 01:26, Piet van Oostrum wrote: > That's because it doesn't use copy-on-write. Thereby losing most of its > advantages. I don't know SUA, but I have vaguely heard about it. SUA is a version of UNIX hidden inside Windows Vista and Windows 7 (except in Home and Home Premium), but very fe

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

2009-08-24 Thread Dave Angel
You shouldn't want either a colon or a pipe symbol in the filename string (not counting the drive letter prefix). A single colon gives you surprising behavior, and two will give you Invalid Argument. See inline responses. ryniek wrote: On 24 Sie, 22:34, ryniek wrote: Ok, but ho

Re: Graph library recommendations for large graphs

2009-08-24 Thread Istvan Albert
On Aug 24, 5:37 pm, VanL wrote: > > Can anybody who has worked with large graphs before give a recommendation? > when using large graphs another limitation may come from the various graph algorithm run times. Most likely you will need to squeeze out as much as possible and a python implementation

Re: basic thread question

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

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

2009-08-24 Thread James Harris
On 24 Aug, 14:05, Mel wrote: > James Harris wrote: > > On 24 Aug, 02:19, Max Erickson 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.

Re: Graph library recommendations for large graphs

2009-08-24 Thread Bearophile
You may try the Python bindings for the Boost Graph Library, the graph you talk about may fit in 2GB of a 32 bit OS too (this is the first link I have found, it's a lot of time I don't use those graph bindings): http://banyan.usc.edu/log/c_cpp/boost-graph-library-python-bindings Bye, bearophile --

Re: Distutils evil voodoo: install into a package

2009-08-24 Thread Diez B. Roggisch
Pavel Panchekha schrieb: Before you flame me, I know that what I'm trying to do is beyond evil. But I nonetheless want to do it. Feel free to rant if you must. :) I have a package that I want to install into another package. For example, I have the packages pya and pyb. pya is guaranteed to be i

Re: Graph library recommendations for large graphs

2009-08-24 Thread Diez B. Roggisch
VanL schrieb: I am working on a project that will require building and querying large graph objects (initially 8M nodes, 30-40M edges; eventually 40M nodes, 100M edges). NetworkX seems to be the most popular, but I am concerned that a dict representation for nodes would use too much memory -- m

Distutils evil voodoo: install into a package

2009-08-24 Thread Pavel Panchekha
Before you flame me, I know that what I'm trying to do is beyond evil. But I nonetheless want to do it. Feel free to rant if you must. :) I have a package that I want to install into another package. For example, I have the packages pya and pyb. pya is guaranteed to be installed before pyb is, so

Re: Reading binary files

2009-08-24 Thread David Robinow
>> This works for a simple binary file, but the actual file I'm trying to >> read is give throwing an error that the file cannot be found. Here is the >> name of the my file: >> 2009.08.02_06.52.00_WA-1_0001_00_0662_0.jstars >> >> Should python have trouble reading this file name or extension? > >

Re: Python/Fortran interoperability

2009-08-24 Thread Richard Maine
James Van Buskirk wrote: > "Richard Maine" wrote in message > news:1j4y84p.v5docbtueccmn%nos...@see.signature... > > > One might plausibly regard this as a kludge, but it is a kludge that is > > part of the Fortran standard and is guaranteed to work with all Fortran > > compilers. I almost sa

Graph library recommendations for large graphs

2009-08-24 Thread VanL
I am working on a project that will require building and querying large graph objects (initially 8M nodes, 30-40M edges; eventually 40M nodes, 100M edges). NetworkX seems to be the most popular, but I am concerned that a dict representation for nodes would use too much memory -- my initial test

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

2009-08-24 Thread ryniek
On 24 Sie, 22:34, ryniek wrote: > On 24 Sie, 16:56, John Machin wrote: > > > On Aug 25, 12:46 am, Tim Golden 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

Re: csv module and None values

2009-08-24 Thread Peter Otten
JKPeck wrote: > I'm trying to get the csv module (Python 2.6) to write data records > like Excel. The excel dialect isn't doing it. The problem is in > writing None values. I want them to result in just sequential commas > - ,, but csv treats None specially, as the doc says, > > "To make it as

Re: Python/Fortran interoperability

2009-08-24 Thread James Van Buskirk
"Richard Maine" wrote in message news:1j4y84p.v5docbtueccmn%nos...@see.signature... > There might be a confusion here (and I'm not even sure on whose part) on > a picky but important detail of wording. I have seen multiple people > confused by this one before. In fact, some potential confusion w

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

2009-08-24 Thread Martin v. Löwis
> I can't figure out a way to programatically set the encoding for > sys.stdout. So where does that leave me? You should be setting the terminal encoding administratively, not programmatically. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Services examples using "raw" xml?

2009-08-24 Thread Diez B. Roggisch
John Gordon schrieb: I'm developing a program that will use web services, which I have never used before. There are several tutorials out there that advise you to get the WSDL and then call a method (such as wsdl2py) that inspects the wsdl and automagically generates the python classes and metho

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

2009-08-24 Thread ryniek
On 24 Sie, 16:56, John Machin wrote: > On Aug 25, 12:46 am, Tim Golden 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.. Colo

Pmw optionmenu color

2009-08-24 Thread J Wolfe
Hello, It seems like this should be easy to do... change the background color of the Pmw optionmenu. I have not been able to find this. Anyone have a hint or know how to do this? Thanks, Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 04:40:14PM -0300, Gabriel Genellina wrote: > En Mon, 24 Aug 2009 14:40:24 -0300, Derek Martin > escribió: > > >Why is it so hard for you to accept that intelligent people can > >disagree with you, and that what's right for you might be bad for > >others? > > Ask the same

Re: Python/Fortran interoperability

2009-08-24 Thread sturlamolden
On 24 Aug, 21:24, n...@cam.ac.uk wrote: > You might also like to consider the converse problem: how to write > a Fortran function that takes a C string of arbitrary length and > uses it. That's what the code I showed you does. -- http://mail.python.org/mailman/listinfo/python-list

Re: csv module and None values

2009-08-24 Thread JKPeck
On Aug 24, 11:30 am, JKPeck wrote: > I'm trying to get the csv module (Python 2.6) to write data records > like Excel.  The excel dialect isn't doing it.  The problem is in > writing None values.  I want them to result in just sequential commas > - ,, but csv treats None specially, as the doc says

Re: Python/Fortran interoperability

2009-08-24 Thread nmm1
In article , glen herrmannsfeldt wrote: > >< Consider, for example: > > > >< This is not currently allowed and r

Re: Web Services examples using "raw" xml?

2009-08-24 Thread John Nagle
John Gordon wrote: I'm developing a program that will use web services, which I have never used before. Web services in general, or some Microsoft interface? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: How does the file.seek() work ?

2009-08-24 Thread gert
On Aug 24, 9:37 pm, Tim Chase wrote: > > I want the file pointer set to 100 and overwrite everything from there > [snip] > > def application(environ, response): > >     query=os.path.join(os.path.dirname(__file__),'teemp') > >     range=environ.get('HTTP_RANGE','bytes=0-').replace > > ('by

Web Services examples using "raw" xml?

2009-08-24 Thread John Gordon
I'm developing a program that will use web services, which I have never used before. There are several tutorials out there that advise you to get the WSDL and then call a method (such as wsdl2py) that inspects the wsdl and automagically generates the python classes and methods you need for interac

Re: Annoying octal notation

2009-08-24 Thread Gabriel Genellina
En Mon, 24 Aug 2009 14:40:24 -0300, Derek Martin escribió: Why is it so hard for you to accept that intelligent people can disagree with you, and that what's right for you might be bad for others? Ask the same question yourself please. -- Gabriel Genellina -- http://mail.python.org/mailma

Re: How does the file.seek() work ?

2009-08-24 Thread Tim Chase
I want the file pointer set to 100 and overwrite everything from there [snip] def application(environ, response): query=os.path.join(os.path.dirname(__file__),'teemp') range=environ.get('HTTP_RANGE','bytes=0-').replace ('bytes=','').split(',') offset=[] for r in range: of

Re: Python/Fortran interoperability

2009-08-24 Thread nmm1
In article <7abee4bb-b18a-4680-817b-7e76aed40...@c2g2000yqi.googlegroups.com>, sturlamolden wrote: > >> Precisely. =A0And the kludge does NOT work under all circumstances, >> which is why I said that it doesn't work very well. > >Do you have an example? I gave you one. Also see below. >> Consi

Re: Python/Fortran interoperability

2009-08-24 Thread glen herrmannsfeldt
In comp.lang.fortran n...@cam.ac.uk wrote: (snip) < Precisely. And the kludge does NOT work under all circumstances, < which is why I said that it doesn't work very well. < Consider, for example:

Re: your favorite debugging tool?

2009-08-24 Thread Paul Rubin
Esmail writes: > 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. Beyond print statements, I use pdb a lot. Winpdb (www.winpdb.org) is even better, but is kind of cumbersome to get working

Re: Python/Fortran interoperability

2009-08-24 Thread sturlamolden
On 24 Aug, 20:55, n...@cam.ac.uk wrote: > Precisely.  And the kludge does NOT work under all circumstances, > which is why I said that it doesn't work very well. Do you have an example? > Consider, for example: > >     SUBROUTINE Fred (X) BIND(C) >     CHARACTER*(*) :: X >     END SUBROUTINE Fr

Re: Python/Fortran interoperability

2009-08-24 Thread nmm1
In article <1j4y84p.v5docbtueccmn%nos...@see.signature>, Richard Maine wrote: > >Only character strings of length 1 are interoperable, as the term >"interoperable" is defined in the Fortran standard. However, that does >not mean that only character strings of length 1 will work with C. The >distin

How does the file.seek() work ?

2009-08-24 Thread gert
I want the file pointer set to 100 and overwrite everything from there curl -C 100 -T upload2.wsgi http://192.168.2.17/appwsgi/wsgi/upload2.wsgi -v w+ overwrites my file completely r+ overwrites nothing a+ only makes my file bigger import os def application(environ, response): query=os.path

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

2009-08-24 Thread 7stud
On Aug 24, 12:19 pm, Stefan Behnel wrote: > 7stud wrote: > > python 3.1 won't let me > > explicitly encode my unicode string > > Sure it does. But encoding a non-ASCII string to ASCII will necessarily fail. > As you should be able to see in the python 3.1 example I posted, I did not encode the st

Re: Python memory management <-> virtualized server environments

2009-08-24 Thread Martin P. Hellwig
gravityzoo-dmo wrote: Hello everyone, I was wondering if anyone here has had any experience in running Python in a virtualized server environment? The reason I'm asking is the recent thing I noticed when running my server application (written in Python + Twisted); The memory of the server applic

Re: Reading binary files

2009-08-24 Thread Dave Angel
Ronn Ross wrote: On Mon, Aug 24, 2009 at 11:18 AM, Ronn Ross wrote: On Mon, Aug 24, 2009 at 10:43 AM, Albert Hopkins wrote: 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

Re: Bash-like brace expansion

2009-08-24 Thread John Haxby
Peter Waller wrote: Okay, I got fed up with there not being any (obvious) good examples of how to do bash-like brace expansion in Python, so I wrote it myself. Here it is for all to enjoy! If anyone has any better solutions or any other examples of how to do this, I'd be glad to hear from them.

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

2009-08-24 Thread Stefan Behnel
7stud wrote: > python 3.1 won't let me > explicitly encode my unicode string Sure it does. But encoding a non-ASCII string to ASCII will necessarily fail. > and python 3.1 implicitly does > the encoding with the wrong codec. That's not a Python problem, though. Your terminal is configured for U

Re: Python/Fortran interoperability

2009-08-24 Thread Richard Maine
sturlamolden wrote: > You also said we can only interop with > length-1 character strings. My kludge was valid Fortran and works with > strings of any length up to some sane limit that you can specify. There might be a confusion here (and I'm not even sure on whose part) on a picky but important

List iterator thread safety

2009-08-24 Thread Emanuele D'Arrigo
Let's say I have a list accessed by two threads, one removing list items via "del myList[index]" statement the other iterating through the list and printing out the items via "for item in myList:" statement. Am I right to say this -won't- generate exceptions because the list iterator is not concern

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 05:03:28PM +, Steven D'Aprano wrote: > 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 pre

csv module and None values

2009-08-24 Thread JKPeck
I'm trying to get the csv module (Python 2.6) to write data records like Excel. The excel dialect isn't doing it. The problem is in writing None values. I want them to result in just sequential commas - ,, but csv treats None specially, as the doc says, "To make it as easy as possible to interf

Python memory management <-> virtualized server environments

2009-08-24 Thread gravityzoo-dmo
Hello everyone, I was wondering if anyone here has had any experience in running Python in a virtualized server environment? The reason I'm asking is the recent thing I noticed when running my server application (written in Python + Twisted); The memory of the server application seems to only grow

Re: Python/Fortran interoperability

2009-08-24 Thread sturlamolden
On 24 Aug, 18:20, n...@cam.ac.uk wrote: >This obviosuly proves you wrong: > > Er, no, it doesn't.  I suggest that you read what I said more > carefully - and the Fortran standard.  As I said, you can kludge > them up, and that is precisely one such kludge - You said we have to kludge them up as ar

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 ty

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 m

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 tha

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 trail

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 c

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

2009-08-24 Thread 7stud
On Aug 24, 9:56 am, "Martin v. Löwis" 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 3.1: ===pyt

Re: Reading binary files

2009-08-24 Thread Ronn Ross
On Mon, Aug 24, 2009 at 11:18 AM, Ronn Ross wrote: > > > On Mon, Aug 24, 2009 at 10:43 AM, Albert Hopkins > wrote: > >> 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

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 ce

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 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, thanks. > Do

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 wi

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 barcode

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 (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 ba

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: 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: 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 ent

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: 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. Oth

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 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. Anything else

  1   2   >