setup.py question

2007-08-28 Thread Eric S. Johansson
I have an environment where I have a bunch of data files or use would like Python application. I want to use the data_files specification of set up to distribute those files. But I also need to change ownership and permissions. I know there's some way to do this because I've done it once bef

Re: status of Programming by Contract (PEP 316)?

2007-08-28 Thread Russ
On Aug 28, 10:58 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > Why do you think that would ad a strong positive capability? > To me at least it seems a big fat lot of over-engineering, not > needed in 99% of programs. In the remaining 1%, it would still not > be needed since Python provides o

Re: status of Programming by Contract (PEP 316)?

2007-08-28 Thread Michele Simionato
On Aug 29, 7:21 am, Russ <[EMAIL PROTECTED]> wrote: > > Thanks for that information. That's too bad, because it seems like a > strong positive capability to add to Python. I wonder why the cold > reception. Were there problems with the idea itself or just the > implementation? Or is it just a low p

Re: status of Programming by Contract (PEP 316)?

2007-08-28 Thread Russ
On Aug 28, 9:35 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > Russ wrote: > > I just stumbled onto PEP 316: Programming by Contract for Python > > (http://www.python.org/dev/peps/pep-0316/). This would be a great > > addition to Python, but I see that it was submitted way back in 2003, > > and it

Re: Creating a multi-tier client/server application

2007-08-28 Thread Paul Rubin
Jeff <[EMAIL PROTECTED]> writes: > Here's a broad overview of what I need to do: cross-platform, client- > side GUI apps that interact with a server backed by a database. I'd > also like the possibility of having a web interface for small portions > of the app. ... any advice on anything I've m

Re: status of Programming by Contract (PEP 316)?

2007-08-28 Thread Steven Bethard
Russ wrote: > I just stumbled onto PEP 316: Programming by Contract for Python > (http://www.python.org/dev/peps/pep-0316/). This would be a great > addition to Python, but I see that it was submitted way back in 2003, > and its status is "deferred." I did a quick search on > comp.lang.python, > bu

Re: tempfile.mkstemp and os.fdopen

2007-08-28 Thread Gabriel Genellina
On 28 ago, 22:21, billiejoex <[EMAIL PROTECTED]> wrote: > Another question: I have to open file for writing ('wb') but I noticed > that both tempfile.mkstemp() and os.fdopen() accept a "mode" argument. > It's not clear *when* do I have to specify such mode. When using > tempfile.mkstemp? > > Moreo

test

2007-08-28 Thread ddyche
-- http://mail.python.org/mailman/listinfo/python-list

Creating a multi-tier client/server application

2007-08-28 Thread Jeff
Hello everyone. I've searched through the archives here, and it seems that questions similar to this one have come up in the past, but I was hoping that I could pick your Pythonic brains a bit. Here's a broad overview of what I need to do: cross-platform, client- side GUI apps that interact with

Re: Newbie question - sorting a slice

2007-08-28 Thread Paul McGuire
On Aug 28, 9:43 pm, hwg <[EMAIL PROTECTED]> wrote: > I've searched the group and didn't see the answer to this... > > Why doesn't this work?: > > >>> letters = ['d', 'a', 'e', 'c', 'b'] > >>> letters[1:3].sort() > > This returns None. > > Why? letters[1:3] is ['a', 'e', 'c']Sorting that shou

Re: Newbie question - sorting a slice

2007-08-28 Thread half . italian
On Aug 28, 7:43 pm, hwg <[EMAIL PROTECTED]> wrote: > I've searched the group and didn't see the answer to this... > > Why doesn't this work?: > > >>> letters = ['d', 'a', 'e', 'c', 'b'] > >>> letters[1:3].sort() > > This returns None. > > Why? letters[1:3] is ['a', 'e', 'c']Sorting that shou

Re: Compiling Source with alternate Openssl lib

2007-08-28 Thread Kevin T. Ryan
On Aug 28, 2:09 pm, "Kevin T. Ryan" <[EMAIL PROTECTED]> wrote: > Hi All - > > I'm trying to compile Python on a Centos machine (RHEL) 3.8 for a > hosting account that I just set up and I'm having 2 issues: > > 1. I ran into an issue with the "hashlib" module [I think] because it > bumps it up agai

Newbie question - sorting a slice

2007-08-28 Thread hwg
I've searched the group and didn't see the answer to this... Why doesn't this work?: >>> letters = ['d', 'a', 'e', 'c', 'b'] >>> letters[1:3].sort() >>> This returns None. Why? letters[1:3] is ['a', 'e', 'c']Sorting that should return ['a', 'c', 'e'] hwg -- http://mail.python.org/mai

Re: Pythonic way of reading a textfile line by line without throwing an exception

2007-08-28 Thread Asun Friere
On Aug 29, 9:49 am, "Deivys Ramirez" <[EMAIL PROTECTED]> wrote: > What's the "pythonic" way of reading a text file, line by line, > without throwing an exception when there's nothing to be read? > > I've been trying to map my while(!eof(fp)) mindset to the file object > Python gives me when I call

Re: Gmane's been quiet ...

2007-08-28 Thread Grant Edwards
On 2007-08-28, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > Steve Holden <[EMAIL PROTECTED]> wrote: >> ... so I was wondering if it's just me who hasn't seen any postings today? > > I think so, through my usenet server I saw the usual lot of postings Posting that were made to mailing lists via gm

Re: Gmane's been quiet ...

2007-08-28 Thread Grant Edwards
On 2007-08-28, Steve Holden <[EMAIL PROTECTED]> wrote: > ... so I was wondering if it's just me who hasn't seen any postings today? AFAICT, it's been dead for a day or so. I posted something to the py2exe list via the gmane NNTP server early this after noon and it never showed up. I don't think

Re: Getting subprocesses to be hidden on Windows

2007-08-28 Thread Roger Upole
geoffbache wrote: > On 28 Aug, 18:18, Larry Bates <[EMAIL PROTECTED]> wrote: >> geoffbache wrote: >> > Hi, >> >> > As part of my efforts to write a test tool that copes with GUIs >> > nicely, I'm trying to establish how I can start a GUI process on >> > Windows that will not bring up the window. S

Re: tempfile.mkstemp and os.fdopen

2007-08-28 Thread billiejoex
Thanks all. Another question: I have to open file for writing ('wb') but I noticed that both tempfile.mkstemp() and os.fdopen() accept a "mode" argument. It's not clear *when* do I have to specify such mode. When using tempfile.mkstemp? >>> fileno, name = tempfile.mkstemp(text=False) >>> fd = os.f

Re: Is it reasonably easy easy to something like this with python?

2007-08-28 Thread Bruno Desthuilliers
Gerardo Herzig a écrit : > walterbyrd wrote: > >> This is made with a php5 framework called qcodo. >> >> http://examples.qcodo.com/examples/dynamic/inline_editing.php >> >> With qcodo it's easy to make grids that are sortable and inline >> editable. Qcodo grids work from the database - not an xml

Unable to read large files from zip

2007-08-28 Thread Kevin Ar18
I posted this on the forum, but nobody seems to know the solution: http://python-forum.org/py/viewtopic.php?t=5230 I have a zip file that is several GB in size, and one of the files inside of it is several GB in size. When it comes time to read the 5+GB file from inside the zip file, it fails

Re: Check for dict key existence, and modify it in one step.

2007-08-28 Thread Dustan
On Aug 28, 1:13 pm, rodrigo <[EMAIL PROTECTED]> wrote: > evan, > > yes, it does help. Works like it should: > > class CountingDictionary(dict): > def increment(self, key, delta=1): > self[key] = self.get(key, 0) + delta > > d = CountingDictionary() > d.increment('cat') > d.increment('do

status of Programming by Contract (PEP 316)?

2007-08-28 Thread Russ
I just stumbled onto PEP 316: Programming by Contract for Python (http://www.python.org/dev/peps/pep-0316/). This would be a great addition to Python, but I see that it was submitted way back in 2003, and its status is "deferred." I did a quick search on comp.lang.python, but I don't seem to see mu

Re: "Try:" which only encompasses head of compound statement

2007-08-28 Thread Ben Finney
[EMAIL PROTECTED] writes: > In real life, I want to set some return values to sensible defaults > if the file doesn't exist, but I want the errors from inside the > block to trickle up as normal. Sure. Just be careful only to catch the exceptions that you do want to handle at that level of the co

Re: Haskell like (c:cs) syntax

2007-08-28 Thread Matimus
> Is there a pattern matching construct in Python like (head : tail), meaning > 'head' matches the first element of a list and 'tail' matches the rest? I > could not find this in the Python documentation. Not really, but you could do something like this: [code] def foo(head, *tail): #do stuff

Re: Pythonic way of reading a textfile line by line without throwing an exception

2007-08-28 Thread Matimus
> fp=open(filename, 'r') > for line in fp: > # do something with line > > fp.close() Or, if you are using Python 2.5+, you can use the file context via the `with' statement. [code] from __future__ import with_statement # this line won't be needed in Python 2.6+ with open(filename, 'r') as fp

RE: How to free memory ( ie garbage collect) at run time with Python2.5.1(windows)

2007-08-28 Thread Delaney, Timothy (Tim)
Alex Martelli wrote: > rfv-370 <[EMAIL PROTECTED]> wrote: > >> have made the following small test: >> >> Before starting my test my UsedPhysicalMemory(PF): 555Mb >> > tf=range(0,1000)PF: 710Mb ( so 155Mb for my List) > tf=[0,1,2,3,4,5] PF: 672Mb (Why? Why the remaini

Re: Pythonic way of reading a textfile line by line without throwing an exception

2007-08-28 Thread Larry Bates
Deivys Ramirez wrote: > Hi everyone, > > I'm a Python newbie but have experience programming PHP and C so i'm > not really new to programming but new to Python. > > What's the "pythonic" way of reading a text file, line by line, > without throwing an exception when there's nothing to be read? >

Re: "Try:" which only encompasses head of compound statement

2007-08-28 Thread Jameson . Quinn
Those are some good responses, but I think they focused a little too much on the specifics of my example - especially the 'print' statement. In real life, I want to set some return values to sensible defaults if the file doesn't exist, but I want the errors from inside the block to trickle up as no

Pythonic way of reading a textfile line by line without throwing an exception

2007-08-28 Thread Deivys Ramirez
Hi everyone, I'm a Python newbie but have experience programming PHP and C so i'm not really new to programming but new to Python. What's the "pythonic" way of reading a text file, line by line, without throwing an exception when there's nothing to be read? I've been trying to map my while(!eof(

Re: Let's Unite Against Pinheaded midgets !

2007-08-28 Thread Thick as a Brick
Nenad Milicevic - The Aryan Serb wrote: > > Serbian Committee for Aryan Defence > Aren't the Serbian population the white trailer trash of every nationality in Europe ? You are going have to do some pretty deep house cleaning to even find a white spot. == Posted via Newsfeeds.Com - Unlim

Re: Gmane's been quiet ...

2007-08-28 Thread James Matthews
Maybe they are sick of the spam! On 8/28/07, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > > Steve Holden <[EMAIL PROTECTED]> wrote: > > ... so I was wondering if it's just me who hasn't seen any postings > today? > > I think so, through my usenet server I saw the usual lot of postings > > -- > La

Re: Gmane's been quiet ...

2007-08-28 Thread Lawrence Oluyede
Steve Holden <[EMAIL PROTECTED]> wrote: > ... so I was wondering if it's just me who hasn't seen any postings today? I think so, through my usenet server I saw the usual lot of postings -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his sala

Re: Check for dict key existence, and modify it in one step.

2007-08-28 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > foo.setdefault(whatever, {}) > foo[whatever].setdefault(someother, 0) > foo[whatever] += delta Should, of course, be: foo.setdefault(whatever, {}) foo[whatever].setdefault(someother, 0) foo[whatever][someother] += delta -- \

Re: Chaining programs with pipe

2007-08-28 Thread Gabriel Genellina
On 28 ago, 09:19, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-08-28, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > > On Windows, windowed applications (as opposed to console > > applications) start with no stdin/stdout/stderr by default. > > The application developer can modify that if de

Gmane's been quiet ...

2007-08-28 Thread Steve Holden
... so I was wondering if it's just me who hasn't seen any postings today? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.holden --- Asciimercial

Re: Check for dict key existence, and modify it in one step.

2007-08-28 Thread Ben Finney
rodrigo <[EMAIL PROTECTED]> writes: > Im using this construct a lot: > > if dict.has_key(whatever): > dict[whatever] += delta > else: > dict[whatever] = 1 I'd prefer: foo.setdefault(whatever, 0) foo[whatever] += delta > sometimes even nested: > > if dict.has_key(whatever): >

New style classes

2007-08-28 Thread Lamonte Harris
Whats the point of object? How do I actually use it. I'm not understanding correctly from the python site located: http://www.python.org/download/releases/2.2.3/descrintro/ class C(object): def __init__(self): self.__x = 0 def getx(self): return self.__x def setx(s

Re: Haskell like (c:cs) syntax

2007-08-28 Thread Erik Jones
On Aug 28, 2007, at 5:12 PM, Chris Mellon wrote: > On 8/28/07, Stefan Niemann <[EMAIL PROTECTED]> wrote: >> Hi, >> >> sorry that I'm relatively new to Python. But the syntax and >> semantics of >> Python already fascinate me, because I'm familiar with functional >> languages >> like Haskell.

Re: Haskell like (c:cs) syntax

2007-08-28 Thread Paul Rubin
"Stefan Niemann" <[EMAIL PROTECTED]> writes: > Is there a pattern matching construct in Python like (head : tail), meaning > 'head' matches the first element of a list and 'tail' matches the rest? I > could not find this in the Python documentation. Python's lists are actually linear arrays. Yo

Re: Haskell like (c:cs) syntax

2007-08-28 Thread Ricardo Aráoz
Stefan Niemann wrote: > Hi, > > sorry that I'm relatively new to Python. But the syntax and semantics of > Python already fascinate me, because I'm familiar with functional languages > like Haskell. > > Is there a pattern matching construct in Python like (head : tail), meaning > 'head' matche

Re: Is it reasonably easy easy to something like this with python?

2007-08-28 Thread Gerardo Herzig
walterbyrd wrote: >On Aug 28, 1:31 pm, Gerardo Herzig <[EMAIL PROTECTED]> wrote: > > >>walterbyrd wrote: >> >> > > > >>The one who make that table sorteable is AJAX. Not php. The php part is >>kind of trivial (so it would be `trivial' in python too). It just reads >>some data and format it

Re: Okay learning python is somewhat hard.

2007-08-28 Thread Lamonte Harris
Yep I'll keep hacking at it aye :D. Also I'll do some searching on the new styled classes. On 8/28/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > > A couple thoughts: > > First, your class looks like it describes the line, not just the > midpoint. Your method calculates the midpoint of that line

Re: Haskell like (c:cs) syntax

2007-08-28 Thread Chris Mellon
On 8/28/07, Stefan Niemann <[EMAIL PROTECTED]> wrote: > Hi, > > sorry that I'm relatively new to Python. But the syntax and semantics of > Python already fascinate me, because I'm familiar with functional languages > like Haskell. > > Is there a pattern matching construct in Python like (head : tai

Re: localhost, ?!

2007-08-28 Thread Bjoern Schliessmann
Boris Ozegovic wrote: > Bjoern Schliessmann wrote: >> Definitely a problem with the web server (503 means "service >> unavailable"). > > I did try on two servers, Apache and simple python server. There > was identically error on both servers. Also try to look at the logs, you're bound find som

Haskell like (c:cs) syntax

2007-08-28 Thread Stefan Niemann
Hi, sorry that I'm relatively new to Python. But the syntax and semantics of Python already fascinate me, because I'm familiar with functional languages like Haskell. Is there a pattern matching construct in Python like (head : tail), meaning 'head' matches the first element of a list and 'tai

Re: Is it reasonably easy easy to something like this with python?

2007-08-28 Thread walterbyrd
On Aug 28, 1:31 pm, Gerardo Herzig <[EMAIL PROTECTED]> wrote: > walterbyrd wrote: > The one who make that table sorteable is AJAX. Not php. The php part is > kind of trivial (so it would be `trivial' in python too). It just reads > some data and format it in an html table. Thank you, that is gre

Okay learning python is somewhat hard.

2007-08-28 Thread Lamonte Harris
Since I can't really focus on PROJECTS[since I don't know much python I can't do any projects because all my projects are BIG], So I decided to work on some problems I've gotten from school from started geometry, So I attempted to make a script to get the midpoint of a line segment using the formul

Re: tempfile.mkstemp and os.fdopen

2007-08-28 Thread Nick Craig-Wood
billiejoex <[EMAIL PROTECTED]> wrote: > I'm trying to generate a brand new file with a unique name by using > tempfile.mkstemp(). > > Moreover, I'd like to know if I'm doing fine. Does this approach avoid > race conditions This is a reasonably secure way of doing things. It can't race under

Re: Biased random?

2007-08-28 Thread Jeffrey Barish
Ivan Voras wrote: > Hi, > > I have a list of items, and need to choose several elements from it, > "almost random". The catch is that the elements from the beginning > should have more chance of being selected than those at the end (how > much more? I don't care how the "envelope" of probability

Tix HList missing at least one method

2007-08-28 Thread Ron Provost
According to the Tix documentation online, HList has an info_bbox() method which returns the bounding box of a given item in the HList. However, when I try to call this method, I get an attribute error. Looking at Tix.py I see that info_bbox() is not implemented. Hazarding a chance (mostly by

Re: localhost, ?!

2007-08-28 Thread Boris Ozegovic
Bjoern Schliessmann wrote: > Definitely a problem with the web server (503 means "service > unavailable"). I did try on two servers, Apache and simple python server. There was identically error on both servers. >> Anybody have slightest clue wthat is going on? :-/ > > Try using wireshark or

Re: Image manipulation

2007-08-28 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, Slava <[EMAIL PROTECTED]> wrote: > I need to add dynamic text to animated GIF images. > What is a best way to do it? > > Thanks. One possibility is the GD library, which supports animated GIF. There is a Python binding:

Re: tempfile.mkstemp and os.fdopen

2007-08-28 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, billiejoex <[EMAIL PROTECTED]> wrote: > Hi there. > I'm trying to generate a brand new file with a unique name by using > tempfile.mkstemp(). > In conjunction I used os.fdopen() to get a wrapper around file > properties (write & read methods, and so on...) but 'nam

Re: localhost, ?!

2007-08-28 Thread Bjoern Schliessmann
Boris Ozegovic wrote: > At job: > urllib2.urlopen("http://localhost";) > raise BadStatusLine(line), after half a minute. Looks like name resolving problems. > urllib2.urlopen("http://127.0.0.1";) > HTTP Error 503: Service Unavailable, immediately. Definitely a problem with the web server (503

Re: extending of adding method?

2007-08-28 Thread Bjoern Schliessmann
Gerardo Herzig wrote: > Hi all. I have a question about design. The general question would > be: Where is the line beteween extending a class and adding new > methods to that class? What do you mean by "extending"? The Java "extends", which is really inheritance? > And the particular case im in

Image manipulation

2007-08-28 Thread Slava
I need to add dynamic text to animated GIF images. What is a best way to do it? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it reasonably easy easy to something like this with python?

2007-08-28 Thread Gerardo Herzig
walterbyrd wrote: >This is made with a php5 framework called qcodo. > >http://examples.qcodo.com/examples/dynamic/inline_editing.php > >With qcodo it's easy to make grids that are sortable and inline >editable. Qcodo grids work from the database - not an xml table or >array. Qcodo handles complex

extending of adding method?

2007-08-28 Thread Gerardo Herzig
Hi all. I have a question about design. The general question would be: Where is the line beteween extending a class and adding new methods to that class? And the particular case im involved is: I have a class (say USERCLASS) who implements a user interface. One of his methods is called `login'

Is it reasonably easy easy to something like this with python?

2007-08-28 Thread walterbyrd
This is made with a php5 framework called qcodo. http://examples.qcodo.com/examples/dynamic/inline_editing.php With qcodo it's easy to make grids that are sortable and inline editable. Qcodo grids work from the database - not an xml table or array. Qcodo handles complex data relations, and fairly

Re: localhost, ?!

2007-08-28 Thread Boris Ozegovic
Fabio Z Tessitore wrote: > I think to have http://localhost working you need a web server (like > apache). maybe you have it at your home. I do have Apache. You can see that urllib, older module, works correctly. -- http://mail.python.org/mailman/listinfo/python-list

Re: localhost, ?!

2007-08-28 Thread Fabio Z Tessitore
Il Tue, 28 Aug 2007 18:27:31 +0200, Boris Ozegovic ha scritto: > Three machines, one at my home, other two at my job, in every machine > there is Win XP SP2 and Python 2.5 > > At home: > urllib2.urlopen("http://localhost";), everything is ok > > At job: > urllib2.urlopen("http://localhost";) > r

Re: tempfile.mkstemp and os.fdopen

2007-08-28 Thread [EMAIL PROTECTED]
On Aug 28, 1:55 pm, billiejoex <[EMAIL PROTECTED]> wrote: > In conjunction I used os.fdopen() to get a wrapper around file > properties (write & read methods, and so on...) but 'name' attribute > does not contain the correct file name. Why? > > >>> import os > >>> import tempfile > >>> fileno, nam

RE: Filemaker interactions

2007-08-28 Thread Sells, Fred
filemaker 8.0 (Pro I think) has a web page generator. That's all I know, since I didn't really need it. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Behalf Of M.-A. Lemburg > Sent: Saturday, August 25, 2007 4:36 PM > To: Ian Witham > Cc: python-list@python.

Re: Check for dict key existence, and modify it in one step.

2007-08-28 Thread rodrigo
You're right of course, I was unclear. I wasn't using 'dict' to override the dict clas, but just as a standin for the example (the actual dictionary names are varied). Thanks, Rodriog -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting subprocesses to be hidden on Windows

2007-08-28 Thread geoffbache
On 28 Aug, 18:18, Larry Bates <[EMAIL PROTECTED]> wrote: > geoffbache wrote: > > Hi, > > > As part of my efforts to write a test tool that copes with GUIs > > nicely, I'm trying to establish how I can start a GUI process on > > Windows that will not bring up the window. So I try to hide the window

Re: Check for dict key existence, and modify it in one step.

2007-08-28 Thread rodrigo
evan, yes, it does help. Works like it should: class CountingDictionary(dict): def increment(self, key, delta=1): self[key] = self.get(key, 0) + delta d = CountingDictionary() d.increment('cat') d.increment('dog',72) print d >>> {'dog': 72, 'cat': 1} Thanks! -- http://mail.python

Re: Jython 2.2 on Ubuntu

2007-08-28 Thread Tim Couper
you need to ensure that the correct jython executable is in a directory which is on your on your path. I've just successfully test-subscribed to https://lists.sourceforge.net/lists/listinfo/jython-users. Maybe you could try again. Tim Dr Tim Couper CTO, SciVisum Ltd www.scivisum.com Neil

Compiling Source with alternate Openssl lib

2007-08-28 Thread Kevin T. Ryan
Hi All - I'm trying to compile Python on a Centos machine (RHEL) 3.8 for a hosting account that I just set up and I'm having 2 issues: 1. I ran into an issue with the "hashlib" module [I think] because it bumps it up against an *OLD* openssl lib (like, Feb. 2003). So I installed a newer openssl

Re: Getting subprocesses to be hidden on Windows

2007-08-28 Thread geoffbache
OK, more background needed. I develop the TextTest tool which is a generic test tool that starts tested applications from the command line. The idea is that it can handle any system under test at all, whatever language it's written in. Preferably without requiring a bunch of changes to the tested

tempfile.mkstemp and os.fdopen

2007-08-28 Thread billiejoex
Hi there. I'm trying to generate a brand new file with a unique name by using tempfile.mkstemp(). In conjunction I used os.fdopen() to get a wrapper around file properties (write & read methods, and so on...) but 'name' attribute does not contain the correct file name. Why? >>> import os >>> impor

Re: National grid to lat long conversion

2007-08-28 Thread Carl Drinkwater | 29degrees
> I have a load of British National Grid references that I want to > convert to decimal degrees so I can create a google KML file. Does > anyone know of a module to do this? If there isn't a module available, you could roll your own. The equations are to be found at : http://www.ordnancesur

Re: National grid to lat long conversion

2007-08-28 Thread Carl Drinkwater | 29degrees
> I have a load of British National Grid references that I want to > convert to decimal degrees so I can create a google KML file. Does > anyone know of a module to do this? I should probably have added that you can get a number of the variables you start off with from : http://www.ordnances

Re: sys.setdefaultencoding

2007-08-28 Thread Martin v. Löwis
> Is there a way to allow the process to specify that unicode-->str should > use 'utf8' rather than 'ascii' in all non-specific cases? No. Things might break if you change the default encoding to anything but ASCII, and more so if you do that "at runtime". For example, dictionaries with Unicode ke

Jython 2.2 on Ubuntu

2007-08-28 Thread Neil Wallace
Hi all, I am a novice Python/Jython programmer, and Ubuntu user. Ubuntu still only supports only version 2.1 of Jython. I have used the GUI installer of Jython 2.2, and installed it to the default /root/jython2.2 directory. The install went without issues. However, typing jython --

sys.setdefaultencoding

2007-08-28 Thread Robin Becker
Can someone explain the rationale of making the default encoding a sitewide setting? I could live with the the default being set on a per process basis, but it baffles me why even that possibility is taken away as site.py removes sys.setdefaultencoding. Is there a way to allow the process to s

Re: int/long bug in locale?

2007-08-28 Thread Mark Dickinson
On Aug 28, 10:03 am, [EMAIL PROTECTED] wrote: > Is there an int/long related bug lurking in locale? Looks like this has already been reported: See http://bugs.python.org/issue1742669 Mark -- http://mail.python.org/mailman/listinfo/python-list

help needed on PyLink

2007-08-28 Thread He Jibo
Hi, Everyone, Is there anybody who know how to programming for eye-tracker with PyLink? I just started learning it and need some help. Your help will be appreciated from the bottom of my heart. My email is : [EMAIL PROTECTED], and my MSN is [EMAIL PROTECTED] -- http://mail.python.org/mailman/l

localhost, ?!

2007-08-28 Thread Boris Ozegovic
Three machines, one at my home, other two at my job, in every machine there is Win XP SP2 and Python 2.5 At home: urllib2.urlopen("http://localhost";), everything is ok At job: urllib2.urlopen("http://localhost";) raise BadStatusLine(line), after half a minute. urllib2.urlopen("http://127.0.0.1"

Re: Asking all python programmers.

2007-08-28 Thread J Sisson
On 8/28/07, Lamonte Harris <[EMAIL PROTECTED]> wrote: > > From a python starter, I don't like the word noob because it sounds very > unprofessional. > Touche`...haha I second the motion for "Dive Into Python." It's an excellent book, and you really can't beat the price (free online as Shawn has

Re: Getting subprocesses to be hidden on Windows

2007-08-28 Thread Larry Bates
geoffbache wrote: > Hi, > > As part of my efforts to write a test tool that copes with GUIs > nicely, I'm trying to establish how I can start a GUI process on > Windows that will not bring up the window. So I try to hide the window > as follows: > > info = subprocess.STARTUPINFO() > info.dwFlags

Re: int/long bug in locale?

2007-08-28 Thread Neil Cerutti
On 2007-08-28, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: import locale > locale.setlocale(locale.LC_ALL, 'English_United States.1252') > 'English_United States.1252' > locale.format('%d', float('2244012500.'), grouping = True) > > Traceback (most recent call last): > File "",

Re: Asking all python programmers.

2007-08-28 Thread Lamonte Harris
I completely understand, I've sent this email when I was tired sorry for the misunderstanding, yes I completely understand what you mean how professionals won't take me serious in situations like this. How about I readdress my question for you? Hello everyone on python mailing list. I would like

Re: Check for dict key existence, and modify it in one step.

2007-08-28 Thread Evan Klitzke
On Tue, 2007-08-28 at 14:36 +, rodrigo wrote: > Im using this construct a lot: > > if dict.has_key(whatever): > dict[whatever] += delta > else: > dict[whatever] = 1 In Python 2.5 there's a defaultdict class, otherwise you can subclass dict like this: class CountingDictionary(dict):

in design time activeX properties

2007-08-28 Thread vml
Hello, Does anybody know how to modify the property of a design-time activeX property ? using win32com thank you for your help, regards, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Check for dict key existence, and modify it in one step.

2007-08-28 Thread Jason
On Aug 28, 8:36 am, rodrigo <[EMAIL PROTECTED]> wrote: > Im using this construct a lot: > > if dict.has_key(whatever): > dict[whatever] += delta > else: > dict[whatever] = 1 > > sometimes even nested: > > if dict.has_key(whatever): > if dict[whatever].has_key(someother): > dict[

Re: Asking all python programmers.

2007-08-28 Thread Shawn Milochik
On 8/27/07, Lamonte Harris <[EMAIL PROTECTED]> wrote: > Okay, I know you've guys told me millions of times to read the manual I've > read a lot of it. What do you recommend studying the most? Python is my > goal for the next year in the half. :) > > -- > http://mail.python.org/mailman/listinfo/py

Re: Python Classes

2007-08-28 Thread Lamonte Harris
Ok thanks I'll try remembering it. On 8/28/07, Erik Jones <[EMAIL PROTECTED]> wrote: > > On Aug 28, 2007, at 12:04 AM, Lamonte Harris wrote: > > > How come you have to set the initialized created variables to equal > > the parameters, shouldn't that be default? > > > > class testing: > >

Re: wxpython:how to minimize to taskbar

2007-08-28 Thread kyosohma
On Aug 28, 9:50 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Aug 28, 9:10 am, Jimmy <[EMAIL PROTECTED]> wrote: > > > I'm kinda newbie to python and wxPython. Now I'm confronting a thorny > > problem: how can I make my program minimize to the taskbar > > represented as an ico, and when t

Re: Python Classes

2007-08-28 Thread Erik Jones
On Aug 28, 2007, at 12:04 AM, Lamonte Harris wrote: > How come you have to set the initialized created variables to equal > the parameters, shouldn't that be default? > > class testing: > def __init__(self,testing): >self.testing = testing > x = testing("testing") >

Re: Check for dict key existence, and modify it in one step.

2007-08-28 Thread Bruno Desthuilliers
rodrigo a écrit : > Im using this construct a lot: > > if dict.has_key(whatever): Avoid using builtin names as identifiers (it shadows the builtin name). Unless you're using an old Python version, you'd be better using if whatever in my_dict: # do something here > dict[whatever] +

Re: wxpython:how to minimize to taskbar

2007-08-28 Thread [EMAIL PROTECTED]
On Aug 28, 9:10 am, Jimmy <[EMAIL PROTECTED]> wrote: > I'm kinda newbie to python and wxPython. Now I'm confronting a thorny > problem: how can I make my program minimize to the taskbar > represented as an ico, and when there is some message from network > coming, it will pop out? Warning. I hav

Check for dict key existence, and modify it in one step.

2007-08-28 Thread rodrigo
Im using this construct a lot: if dict.has_key(whatever): dict[whatever] += delta else: dict[whatever] = 1 sometimes even nested: if dict.has_key(whatever): if dict[whatever].has_key(someother): dict[whatever][someother] += delta else: dict[whatever][someother] =

Re: wxpython:how to minimize to taskbar

2007-08-28 Thread kyosohma
On Aug 28, 9:10 am, Jimmy <[EMAIL PROTECTED]> wrote: > I'm kinda newbie to python and wxPython. Now I'm confronting a thorny > problem: how can I make my program minimize to the taskbar > represented as an ico, and when there is some message from network > coming, it will pop out? Look at the wxP

Re: Getting subprocesses to be hidden on Windows

2007-08-28 Thread kyosohma
On Aug 28, 8:59 am, geoffbache <[EMAIL PROTECTED]> wrote: > > Which GUI toolkit are you using? Tkinter, wxPython, pyQt? > > Primarily PyGTK, but I was hoping it wouldn't matter. I hope to be > able > to start the process as indicated in the original post from within my > test > tool and instruct th

wxpython:how to minimize to taskbar

2007-08-28 Thread Jimmy
I'm kinda newbie to python and wxPython. Now I'm confronting a thorny problem: how can I make my program minimize to the taskbar represented as an ico, and when there is some message from network coming, it will pop out? -- http://mail.python.org/mailman/listinfo/python-list

int/long bug in locale?

2007-08-28 Thread tkpmep
To pretty up some numbers stored as strings, I used locale to format them with commas. I then found the following error: >>> import locale >>>locale.setlocale(locale.LC_ALL, 'English_United States.1252') 'English_United States.1252' >>> locale.format('%d', float('2244012500.'), grouping = Tr

Re: Getting subprocesses to be hidden on Windows

2007-08-28 Thread geoffbache
> Which GUI toolkit are you using? Tkinter, wxPython, pyQt? Primarily PyGTK, but I was hoping it wouldn't matter. I hope to be able to start the process as indicated in the original post from within my test tool and instruct the subprocess to be hidden (or minimized? would that be easier?), irres

HP-UX IA: Python 2.4 (64bits & gcc)

2007-08-28 Thread Julio Garvía
Hello, Please, Could you kindly tell me how to build Python 2.4 in HP-UX 11i v2 (Itanium) in 64 bits using gcc/g++? Thanks in advance for your attention. With best regards, Julio Garvía Honrado Sé u

Re: Getting subprocesses to be hidden on Windows

2007-08-28 Thread kyosohma
On Aug 28, 4:08 am, geoffbache <[EMAIL PROTECTED]> wrote: > On Aug 27, 11:28 pm, [EMAIL PROTECTED] wrote: > > > > > On Aug 27, 3:21 pm, geoffbache <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > As part of my efforts to write a test tool that copes with GUIs > > > nicely, I'm trying to establish how

Re: Table update

2007-08-28 Thread [EMAIL PROTECTED]
On Aug 28, 2:57 pm, "Ahmed, Shakir" <[EMAIL PROTECTED]> wrote: > I am trying to use python script to update a table by incremental value > based on struc_No but having problem to get right result on the value > field for the 3rd and 4th same number of struc_no. > > I need to update the Value field

  1   2   >