Re: Awkward format string

2007-08-02 Thread Gerard Flanagan
On Aug 1, 11:52 pm, Ian Clark <[EMAIL PROTECTED]> wrote: > Gerard Flanagan wrote: > > (snip) > > > def tostring(data): > > return tuple(strftime(x) for x in data[:2]) + data[2:] > > Hrmm, not sure that having a function named tostring() that returns a > tuple is the best idea. ;) > oops! SAD (

Re: a dict trick

2007-08-02 Thread Stargaming
On Thu, 02 Aug 2007 06:32:11 +, james_027 wrote: > hi > > for example I have this dictionary > > dict = {'name':'james', 'language':'english'} First of all, this is a bad name because it shadows (overwrites) the reference to the builtin constructor, `dict`. > value = 'sex' in dict and dic

backup/restore postgresql database

2007-08-02 Thread Acm
I am working with Python 2.5 and Postgresql 8.2.4. I would like to know how to perform the backup and restore operations on postgresql through a python API (e.g. psycopg2). Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Time object?

2007-08-02 Thread Nikola Stjelja
On 8/1/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm well aware of the datetime module, however it is really inconsistent > and useless to me. In order to do any arithmetic on time objects, I have to > use the 'timedelta' class, which doesn't even allow me to do all the math I > want

Re: Equivalent to gzinflate() function in PHP.

2007-08-02 Thread Laurent Pointal
Adam Kubica a écrit : > After some king of brain fucked tries, I found: > > zlib.decompress( data ) #equivalent gzdecompress() > zlib.decompress( data, -zlib.MAX_WBITS ) #equivalent gzdeflate() Note: you can also use encode() and decode() methods on the string containing your data, specifying 'z

Re: a dict trick

2007-08-02 Thread Gary Herron
james_027 wrote: > hi > > for example I have this dictionary > > dict = {'name':'james', 'language':'english'} > > value = 'sex' in dict and dict['sex'] or 'unknown' > > is a right pythonic of doing this one? I am trying to get a value from > the dict, but if the key doesn't exist I will provide on

Re: Python IMAP web-access

2007-08-02 Thread Laurent Pointal
Damjan a écrit : > Is there some project that implements web access to an IMAP store? > > Maybe something AJAXy like http://roundcube.net/?? I dont know if this fill your need, but in my Python bookmarks, for webmail I have a reference to NiMail (http://www.nimail.org/). A+ Laurent. -- http:/

Re: a dict trick

2007-08-02 Thread [EMAIL PROTECTED]
james_027 wrote: > hi > > for example I have this dictionary > > dict = {'name':'james', 'language':'english'} > > value = 'sex' in dict and dict['sex'] or 'unknown' > > is a right pythonic of doing this one? I am trying to get a value from > the dict, but if the key doesn't exist I will provid

Re: a dict trick

2007-08-02 Thread Alex Popescu
james_027 <[EMAIL PROTECTED]> wrote in news:1186036331.304916.304020 @e9g2000prf.googlegroups.com: > hi > > for example I have this dictionary > > dict = {'name':'james', 'language':'english'} > > value = 'sex' in dict and dict['sex'] or 'unknown' > > is a right pythonic of doing this one? I a

Re: Where do they tech Python officialy ?

2007-08-02 Thread Alex Popescu
[EMAIL PROTECTED] (Alex Martelli) wrote in news:1i26u6o.pthuan2j7nufN% [EMAIL PROTECTED]: > Alex Popescu <[EMAIL PROTECTED]> wrote: >... >> Have you seen/heard of Jim lately? Cause I haven't. By the time he was >> the lead of the AspectJ team his charismatic presence was everywhere (at >> le

Re: Emacs + python

2007-08-02 Thread Bruno Desthuilliers
Edward O'Connor a écrit : >> Could anyone put me on the right track to developing Python with emacs >> please : modes to consider, debugging etc hopefully all within emacs. > > Personally, I prefer the python.el that ships with Emacs 22 to the > python-mode.el from python.org. It seems more like o

Re: beginner in python

2007-08-02 Thread km
Hi Welcome to python ! there a a few suggestions in ur code which is a good practice to follow. In the snippet: > > for x in range(len(x_value)): > > x_co = float(x_value[x])-float(x_value[x+1]) > > y_co = float(y_value[x])-float(y_value[x+1]) > > z_co = floa

Re: Emacs + python

2007-08-02 Thread Bruno Desthuilliers
hg a écrit : (snip) > Are there any cscope & ECB equivalent for Python ? ECB (assuming we're talking about the same thing, ie Emacs Code Browser) works just fine with Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Floats as keys in dict

2007-08-02 Thread Brian Elmegaard
greg <[EMAIL PROTECTED]> writes: > Be careful with this. If you have two values that are > very close together, but on different sides of a rounding > boundary, they will end up as distinct keys even though > they "should" be regarded as equal. I don't think this is a big problem. It will only gi

Re: a dict trick

2007-08-02 Thread Bruno Desthuilliers
james_027 a écrit : > hi > > for example I have this dictionary > > dict = {'name':'james', 'language':'english'} > > value = 'sex' in dict and dict['sex'] or 'unknown' > > is a right pythonic of doing this one? No. The first problem is that using 'dict' as an identifier, you're shadowing the

Re: Pythonic way for missing dict keys

2007-08-02 Thread Alex Popescu
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Steven D'Aprano a écrit : > (snip) > >> Instead of doing: > >> if callable(function): function() >> >> you should do: >> >> try: >> function() >> except TypeError: >> pass > > There are time where you may want

Re: a dict trick

2007-08-02 Thread james_027
Hi, what if we're not dealing with dict? is there a pythonic way of doing ternary? the bool ? x:y Thanks james -- http://mail.python.org/mailman/listinfo/python-list

Re: Awkward format string

2007-08-02 Thread Bruno Desthuilliers
beginner a écrit : > Hi, > > In order to print out the contents of a list, sometimes I have to use > very awkward constructions. For example, I have to convert the > datetime.datetime type to string first, construct a new list, s/list/tuple/ > and then > send it to print. The following is an exa

Re: Error with Tkinter and tkMessageBox

2007-08-02 Thread Fabio Z Tessitore
Il Thu, 02 Aug 2007 13:54:46 +1000, John McMonagle ha scritto: > What window manager are you using ? Hi John, I'm using gnome, with gdm. Do you think the problem is this? I'm going to try with another one ... bye -- http://mail.python.org/mailman/listinfo/python-list

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-02 Thread John K Masters
On 18:23 Wed 01 Aug , Steve Holden wrote: > Joshua J. Kugler wrote: > > On Wednesday 01 August 2007 13:53, Robert Dailey wrote: > >> He's secretly an employee of Wing IDE in disguise!!! > > > > Sorry to destroy your conspiracy theories, but no, I've never been employed > > by Wing IDE in any f

Re: Error with Tkinter and tkMessageBox

2007-08-02 Thread Fabio Z Tessitore
I've tried to use Twm and SURPRISE! it works!!! Can you say why? How can I fix the prob with Gnome? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: a dict trick

2007-08-02 Thread Bruno Desthuilliers
james_027 a écrit : > Hi, > > what if we're not dealing with dict? is there a pythonic way of doing > ternary? the bool ? x:y Python 2.5 introduced the following syntax: expr1 if condition else expr2 In older Python versions, one has to use and/or (like you wrongly did) or tuple/dict dispatch

Re: No module named DBUtils.PooledDB

2007-08-02 Thread cpmishra
-- Forwarded message -- From: cpmishra <[EMAIL PROTECTED]> Date: Aug 2, 11:37 am Subject: No module named DBUtils.PooledDB To: comp.lang.python Hi all I have used DBUtil with python2.4. when we run to program in dos command ,successfully run but when we run in apache ser

i am new to python-Please somebody help

2007-08-02 Thread cool . vimalsmail
i dont know how to convert a txt file into a zip file (i.e.,)i have a file named packages and i want the packages file with a ".gz" extension by implementing a python program -- http://mail.python.org/mailman/listinfo/python-list

Re: Python end of file marker similar to perl's __END__

2007-08-02 Thread Magnus Lycka
Neil Cerutti wrote: > On 2007-08-01, Cameron Laird <[EMAIL PROTECTED]> wrote: . >> I want to re-emphasize the "triple-quote it" tip mentioned >> earlier in this thread. I think the original questioner >> will find this quite satisfying, if I understand his situ- >> ation at all. >> >> *I* ce

Re: Pythonic way for missing dict keys

2007-08-02 Thread Bruno Desthuilliers
Alex Popescu a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: (snip) >> if hasattr(obj, '__call__'): >># it's a callable >> >> but I don't find it so Pythonic to have to check for a __magic__ >> method. > > It looks like Python devs have decided it is Py

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-02 Thread Steve Holden
John K Masters wrote: > On 18:23 Wed 01 Aug , Steve Holden wrote: >> Joshua J. Kugler wrote: >>> On Wednesday 01 August 2007 13:53, Robert Dailey wrote: He's secretly an employee of Wing IDE in disguise!!! >>> Sorry to destroy your conspiracy theories, but no, I've never been employed >>>

Re: Emacs + python

2007-08-02 Thread Hadron
Edward O'Connor <[EMAIL PROTECTED]> writes: >> Could anyone put me on the right track to developing Python with emacs >> please : modes to consider, debugging etc hopefully all within emacs. > > Personally, I prefer the python.el that ships with Emacs 22 to the > python-mode.el from python.org. It

Use variable in regular expression

2007-08-02 Thread CarpeSkium
I know I can use a variable in regular expressions. I want to use a regex to find something based on the beginning of the string. I am using yesterday's date to find all of my data from yesterday. Yesterday's date is 20070731, and assigned to the variable "yesterday_date". I want to loop thru a dir

Re: DBUtil with modepython

2007-08-02 Thread Steve Holden
cpmishra wrote: > Hi all >I have used DBUtil in mysql databse. when we run to program in > dos command ,successfully run but when we run in apache server > (locally)with modepython then given error.Pls give me suggation > > error: > No module named DBUtils.PooledDB > It seems likely that

Re: Use variable in regular expression

2007-08-02 Thread Antti Rasinen
On 2007-08-02, at 13:43, [EMAIL PROTECTED] wrote: > I know I can use a variable in regular expressions. I want to use a > regex to find something based on the beginning of the string. I am > using yesterday's date to find all of my data from yesterday. > Yesterday's date is 20070731, and assigned

beginner in python

2007-08-02 Thread Beema shafreen
Hi everybody , I am a beginner in python, I have to fetch the redundant entries from a file, code: import re L = [] fh = open('ARCHITECTURE_MAIN.txt','r') for line in fh.readlines(): data =line.strip() # splitted = data.split('#') L.append(data) fh.close() M

Re: i am new to python-Please somebody help

2007-08-02 Thread BartlebyScrivener
On Aug 2, 4:31 am, [EMAIL PROTECTED] wrote: > > i want the packages file with > a ".gz" extension by implementing a python program http://docs.python.org/lib/module-gzip.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Use variable in regular expression

2007-08-02 Thread vbr
... > Yesterday's date is 20070731, and assigned to the variable > "yesterday_date". I want to loop thru a directory and find all of the > yesterday's data ONLY IF the feature class has the date at the > BEGINNING of the filename. ... > I can't figure out the > syntax of inserting the "^" into the

Re: Representation of new-style instance

2007-08-02 Thread Gabriel Genellina
En Wed, 01 Aug 2007 20:14:06 -0300, Raj B <[EMAIL PROTECTED]> escribió: > Consider a new-style class > > class rabbit(object): >def __init__(self,c): > self.color = c > > r1=rabbit("blue") > r2=rabbit("purple") > > Which C struct in the Python implementation is used to represen

Re: beginner in python

2007-08-02 Thread km
Hi pls redefine ur problem. I donot understand what u wanted to accomplish . is it that u wanted to check and represent the redundant entry numbers as one entry or is it with the isoform id as a single entry and without considering other data like start and stop ? also observe that when u consi

Catching SystemExit in C API code when embedding Python?

2007-08-02 Thread Stefan Bellon
Hi all! I am embedding Python into a GUI application in a way that the GUI is scriptable using Python. Now I have come to a problem that when the user puts a "sys.exit(0)" into his script to end the script, not only the script is terminated, but also the GUI application itself. This is not the in

Re: Use variable in regular expression

2007-08-02 Thread Sion Arrowsmith
<[EMAIL PROTECTED]> wrote: >I know I can use a variable in regular expressions. I want to use a >regex to find something based on the beginning of the string. You're coming from a Perl background, right? No-one else would think of using a regexp for such a simple thing. There are two things you n

Re: Python end of file marker similar to perl's __END__

2007-08-02 Thread Steven D'Aprano
On Thu, 02 Aug 2007 10:00:04 +1000, Ben Finney wrote: > beginner <[EMAIL PROTECTED]> writes: > >> Thanks everyone for responding. It doesn't look like python has >> it. I would definitely miss it. As Steve said, the nice thing about >> __END__ is that things below __END__ do not have to have legi

Re: standalone process to interact with the web

2007-08-02 Thread beginner
On Aug 1, 3:50 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > beginner wrote: > > Hi Everyone, > > > I am looking for a way to allow a standalone python process to easily > > interactive with a few web pages. It has to be able to easily receive > > requests from the web and post data to the we

Re: Use variable in regular expression

2007-08-02 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I know I can use a variable in regular expressions. I want to use a > regex to find something based on the beginning of the string. I am > using yesterday's date to find all of my data from yesterday. > Yesterday's date is 20070731, and assigned to the variable > "yesterd

Re: frequency analysis of a DB column

2007-08-02 Thread Carsten Haese
On Thu, 2007-08-02 at 00:38 -0300, Gabriel Genellina wrote: > I'd start with: > > select column, count(column), min(column), max(column) > from table > group by column > order by count(column) desc What's the point of including min(column) and max(column)? They're always going to be equal to col

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-02 Thread Jamie
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] mentions: >Python is a better language, with php support, anyway, but I am fed up >with attitudes of comp.lang.perl.misc. Assholes in this newsgroup ruin >Perl experience for everyone. Instead of being helpful, snide remarks, >back-biting, scare tactings, a

Re: Use variable in regular expression

2007-08-02 Thread Steve Holden
[when replying to a mailing list or newsgroup response please make sure you include the list as a recipient, so the whole conversation is available] André Martins wrote: > >> I know I can use a variable in regular expressions. I want to use a >> regex to find something based on the beginning o

IWCIA 08 - USA, 7-9 April 2008: Invitation

2007-08-02 Thread [EMAIL PROTECTED]
Dear Colleague, I would like to bring to your attention information about a forthcoming conference and to strongly encourage you to submit a paper or papers to it. This is the 12th International Workshop on Combinatorial Image Analysis (IWCIA 08) which will take place in Buffalo, USA, 7-9 April 2

Re: i am new to python-Please somebody help

2007-08-02 Thread Steven D'Aprano
On Thu, 02 Aug 2007 09:31:43 +, cool.vimalsmail wrote: [snip] You would be better off actually writing a sensible subject line instead of grovelling. Subject: How to use gzip in Python? [beginner] Then, having written a good subject line, it might have suggested a good search string for Goo

Re: standalone process to interact with the web

2007-08-02 Thread beginner
On Aug 1, 5:04 am, Bruno Desthuilliers wrote: > beginner a écrit : > (snip) > > > Yes exactly. I just don't want to reinvent the wheel as I imagine > > there are already tons of libraries and frameworks that support RPC or > > the like functions. > > Why go thru the pain of RPC, SOAP or such bloat

Re: Python end of file marker similar to perl's __END__

2007-08-02 Thread Neil Cerutti
On 2007-08-02, Magnus Lycka <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> On 2007-08-01, Cameron Laird <[EMAIL PROTECTED]> wrote: . >>> I want to re-emphasize the "triple-quote it" tip mentioned >>> earlier in this thread. I think the original questioner >>> will find this quite satisfy

Re: Use variable in regular expression

2007-08-02 Thread André Martins
> I know I can use a variable in regular expressions. I want to use a > regex to find something based on the beginning of the string. I am > using yesterday's date to find all of my data from yesterday. > Yesterday's date is 20070731, and assigned to the variable > "yesterday_date". I want to loop

Re: Python end of file marker similar to perl's __END__

2007-08-02 Thread kyosohma
On Aug 2, 8:08 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-08-02, Magnus Lycka <[EMAIL PROTECTED]> wrote: > > > > > Neil Cerutti wrote: > >> On 2007-08-01, Cameron Laird <[EMAIL PROTECTED]> wrote: . > >>> I want to re-emphasize the "triple-quote it" tip mentioned > >>> earlier in this

Case study: library class inheritance with property declarations

2007-08-02 Thread cdleary
Hi all, It's possible that I'm missing the obvious -- I've been up for over 24 hours and I'm most likely dehydrated from mass coffee intake, but I figure many people in similar circumstances will be searching comp.lang.python one day, so here goes! class LibraryClass(object): """ A clas

Re: Determining if file is valid image file

2007-08-02 Thread André
On Aug 2, 11:14 am, André <[EMAIL PROTECTED]> wrote: > Other than installing PIL, is there a "simple" way using Python only > to determine if a file is a valid image file? > > I'd be happy if I could at least identify valid images files for gif, > jpeg and png. Pointers to existing modules or exa

Re: i am new to python-Please somebody help

2007-08-02 Thread gregarican
On Aug 2, 8:51 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 02 Aug 2007 09:31:43 +, cool.vimalsmail wrote: > > [snip] > > You would be better off actually writing a sensible subject line instead > of grovelling. > > Subject: How to use gzip in Python? [beginner] > > Then, having wri

Re: Case study: library class inheritance with property declarations

2007-08-02 Thread cdleary
On Aug 2, 6:49 am, [EMAIL PROTECTED] wrote: > Hi all, > > It's possible that I'm missing the obvious -- I've been up for over 24 > hours and I'm most likely dehydrated from mass coffee intake, but I > figure many people in similar circumstances will be searching > comp.lang.python one day, so here

Re: Directory

2007-08-02 Thread Larry Bates
Rohan wrote: > I would like to get a list of sub directories in a directory. > If I use os.listdir i get a list of directories and files in that . > i only want the list of directories in a directory and not the files > in it. > anyone has an idea regarding this. > import os listofdirs=[d for d i

Re: Determining if file is valid image file

2007-08-02 Thread Thomas Jollans
On Thursday 02 August 2007, André wrote: > On Aug 2, 11:14 am, André <[EMAIL PROTECTED]> wrote: > > Other than installing PIL, is there a "simple" way using Python only > > to determine if a file is a valid image file? > > > > I'd be happy if I could at least identify valid images files for gif, >

Re: Determining if file is valid image file

2007-08-02 Thread Larry Bates
André wrote: > On Aug 2, 11:14 am, André <[EMAIL PROTECTED]> wrote: >> Other than installing PIL, is there a "simple" way using Python only >> to determine if a file is a valid image file? >> >> I'd be happy if I could at least identify valid images files for gif, >> jpeg and png. Pointers to exi

Re: Case study: library class inheritance with property declarations

2007-08-02 Thread cdleary
On Aug 2, 7:08 am, [EMAIL PROTECTED] wrote: > On Aug 2, 6:49 am, [EMAIL PROTECTED] wrote: > > > > > Hi all, > > > It's possible that I'm missing the obvious -- I've been up for over 24 > > hours and I'm most likely dehydrated from mass coffee intake, but I > > figure many people in similar circumst

Re: Determining if file is valid image file

2007-08-02 Thread kyosohma
On Aug 2, 9:35 am, Thomas Jollans <[EMAIL PROTECTED]> wrote: > On Thursday 02 August 2007, André wrote: > > > On Aug 2, 11:14 am, André <[EMAIL PROTECTED]> wrote: > > > Other than installing PIL, is there a "simple" way using Python only > > > to determine if a file is a valid image file? > > > > I

Re: Determining if file is valid image file

2007-08-02 Thread Jarek Zgoda
André napisał(a): >> Other than installing PIL, is there a "simple" way using Python only >> to determine if a file is a valid image file? >> >> I'd be happy if I could at least identify valid images files for gif, >> jpeg and png. Pointers to existing modules or examples would be >> appreciated

Re: Determining if file is valid image file

2007-08-02 Thread André
On Aug 2, 11:34 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > André napisa³(a): > > >> Other than installing PIL, is there a "simple" way using Python only > >> to determine if a file is a valid image file? > > >> I'd be happy if I could at least identify valid images files for gif, > >> jpeg and pn

Determining if file is valid image file

2007-08-02 Thread André
Other than installing PIL, is there a "simple" way using Python only to determine if a file is a valid image file? I'd be happy if I could at least identify valid images files for gif, jpeg and png. Pointers to existing modules or examples would be appreciated. The reason why I'd prefer not usi

Re: backup/restore postgresql database

2007-08-02 Thread kyosohma
On Aug 2, 1:55 am, Acm <[EMAIL PROTECTED]> wrote: > I am working with Python 2.5 and Postgresql 8.2.4. > > I would like to know how to perform the backup and restore operations > on postgresql through a python API (e.g. psycopg2). > > Thank you. I don't know much about postgres, but here's what m

Re: Determining if file is valid image file

2007-08-02 Thread André
On Aug 2, 11:38 am, [EMAIL PROTECTED] wrote: > On Aug 2, 9:35 am, Thomas Jollans <[EMAIL PROTECTED]> wrote: > > > > > On Thursday 02 August 2007, André wrote: > > > > On Aug 2, 11:14 am, André <[EMAIL PROTECTED]> wrote: > > > > Other than installing PIL, is there a "simple" way using Python only >

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-02 Thread sdeibel
On Aug 1, 5:45 pm, "Joshua J. Kugler" <[EMAIL PROTECTED]> wrote: > I tend to let questions slide when they are answered in the documentation or > on the web site. Maybe theWingdevelopers/support personnel are the same > way. Just to clarify: We never do that. If you don't hear from us in respon

Re: Determining if file is valid image file

2007-08-02 Thread Dave Hughes
André wrote: > Other than installing PIL, is there a "simple" way using Python only > to determine if a file is a valid image file? > > I'd be happy if I could at least identify valid images files for gif, > jpeg and png. Pointers to existing modules or examples would be > appreciated. > > The

Re: Awkward format string

2007-08-02 Thread beginner
On Aug 2, 3:32 am, Bruno Desthuilliers wrote: > beginner a écrit : > > > Hi, > > > In order to print out the contents of a list, sometimes I have to use > > very awkward constructions. For example, I have to convert the > > datetime.datetime type to string first, construct a new list, > > s/list/t

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-02 Thread sdeibel
On Aug 1, 6:42 pm, John K Masters <[EMAIL PROTECTED]> wrote: > To suggest that, because the autocompletion worked on one method of a > module and not on another was because I had not configured the > PYTHONPATH properly is at least insulting. We certainly didn't intend to be insulting. This it th

RE: Bug in Time module, or in my understanding?

2007-08-02 Thread Hamilton, William
> From: Joshua J. Kugler > > I am getting results like these with the time module: > > >>> import time > >>> int(time.mktime(time.strptime('2007-03-11 02:00:00', '%Y-%m-%d %H:%M > %S'))) > 1173610800 > >>> int(time.mktime(time.strptime('2007-03-11 03:00:00', '%Y-%m-%d %H:%M > %S'))) > 1173610800

Re: sending very large packets over the network

2007-08-02 Thread Azazello
On Aug 1, 8:50 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > Walker Lindley wrote: > > OK, I'm back with another networking question. I'm trying to seend > > large amounts of information over TCP (the length of data being given > > to send() is on the order of 16000 characters in length). > > Unfort

Memory Leak with Tkinter Canvas (Python 2.5 Win32)

2007-08-02 Thread frikk
Hey everyone. I have been working with python for a couple years now, but just recently built my first program with a GUI. I decided to start with Tkinter since it is included with the base package, although wxWindows will likely be my next choice. Tkinter seems to be pretty slow for my needs.

Re: beginner in python

2007-08-02 Thread Tim Williams
On 02/08/07, Beema shafreen <[EMAIL PROTECTED]> wrote: > Hi everybody , > I am a beginner in python, > I have to fetch the redundant entries from a file, > > code: > > import re > L = [] > fh = open('ARCHITECTURE_MAIN.txt', > 'r') > for line in fh.readlines(): > data =line.st

Re: Pythonic way for missing dict keys

2007-08-02 Thread Alex Martelli
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Alex Popescu a écrit : > > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in > > news:[EMAIL PROTECTED]: > (snip) > >> if hasattr(obj, '__call__'): > >># it's a callable > >> > >> but I don't find it so Pythonic to have to check for a __magic__

Re: Case study: library class inheritance with property declarations

2007-08-02 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Aug 2, 7:08 am, [EMAIL PROTECTED] wrote: >> On Aug 2, 6:49 am, [EMAIL PROTECTED] wrote: >> >> >> >>> Hi all, >>> It's possible that I'm missing the obvious -- I've been up for over 24 >>> hours and I'm most likely dehydrated from mass coffee intake, but I >>> figure ma

python 3.0, pywin32 and scipy

2007-08-02 Thread vml
Hello, I am trying to promote python in my job, my collegue only see matlab and microsoft scripting language. I understood that there willl be no backward compatibility between python 2.x and 3.0, does it means that: - my script using pywin32 for the COM layer and scipy for the maths won't work

Re: standalone process to interact with the web

2007-08-02 Thread Bruno Desthuilliers
beginner a écrit : > On Aug 1, 5:04 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> beginner a écrit : >> (snip) >> >>> Yes exactly. I just don't want to reinvent the wheel as I imagine >>> there are already tons of libraries and frameworks that support RPC or >>> the like functions. >> Why g

Error subclassing datetime.date and pickling

2007-08-02 Thread Mike Rooney
Hi everyone, this is my first post to this list. I am trying to create a subclass of datetime.date and pickle it, but I get errors on loading it back. I have created a VERY simple demo of this: import datetime class MyDate(datetime.date): """ This should be pickleable. >>> md =

Re: Pythonic way for missing dict keys

2007-08-02 Thread Bruno Desthuilliers
Alex Martelli a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> > wrote: > >> Alex Popescu a écrit : >>> Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in >>> news:[EMAIL PROTECTED]: >> (snip) if hasattr(obj, '__call__'): # it's a callable but I don't find it so Pythonic t

Cross compiling 2.5.1

2007-08-02 Thread winkatl1213
I was wondering if anyone could help me with cross-compiling Python 2.5.1 to a MIPS target. The approach I'm using is based off the suggestion in the README file that comes with the python source distribution. I managed to get the configure script to run using the following command line: $ ../Py

wxpython with python 2.5

2007-08-02 Thread G
Hello, I am trying to get wxpython to run with python 2.5 without any success. wx works prefectly in python 2.4. below is the error code i get when i try to run the code. File "demo.py", line 3, in import Main File "/tmp/wxPython/Main.py", line 32, in import wx #

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread Steve Holden
vml wrote: > Hello, > > > I am trying to promote python in my job, my collegue only see matlab > and microsoft scripting language. > I understood that there willl be no backward compatibility between > python 2.x and 3.0, does it means that: > > - my script using pywin32 for the COM layer and sc

Re: i am new to python-Please somebody help

2007-08-02 Thread Hyuga
On Aug 2, 8:51 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 02 Aug 2007 09:31:43 +, cool.vimalsmail wrote: > > [snip] > > You would be better off actually writing a sensible subject line instead > of grovelling. > > Subject: How to use gzip in Python? [beginner] > > Then, having wri

Re: wxpython with python 2.5

2007-08-02 Thread Chris Mellon
On 8/2/07, G <[EMAIL PROTECTED]> wrote: > Hello, > > > I am trying to get wxpython to run with python 2.5 without any success. > wx works prefectly in python 2.4. below is the error code i get when i try > to run the code. > File "demo.py", line 3, in > import Main > File "/tmp/wxPython

Re: wxpython with python 2.5

2007-08-02 Thread Steve Holden
G wrote: > Hello, > > > I am trying to get wxpython to run with python 2.5 without any > success. wx works prefectly in python 2.4. below is the error code i get > when i try to run the code. > File "demo.py", line 3, in > import Main > File "/tmp/wxPython/Main.py", line 32, in >

Re: beginner in python

2007-08-02 Thread Andy Cheesman
It looks like you are doing some sort of molecular science thing. Have you come across openbabel and the python bindings pybel (http://openbabel.sourceforge.net/wiki/Python#Pybel). I don't know how well they work but they might save you some effort. Also, check out pymol,(http://pymol.sourceforge.n

File access

2007-08-02 Thread JD
Hi, What I am trying to do is to run a subprocess on another machine using subprocess.Popen, this subprocess contuinue writing something into a file when it is runing. After submit this subprocess, I tried to open the file and readlines() in the loop (with a delay) in the loop) when the subproces

Re: a dict trick

2007-08-02 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, james_027 <[EMAIL PROTECTED]> wrote: > hi > > for example I have this dictionary > > dict = {'name':'james', 'language':'english'} > > value = 'sex' in dict and dict['sex'] or 'unknown' > > is a right pythonic of doing this one? I am trying to get a value from

Re: standalone process to interact with the web

2007-08-02 Thread Diez B. Roggisch
Bruno Desthuilliers schrieb: > beginner a écrit : >> On Aug 1, 5:04 am, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: >>> beginner a écrit : >>> (snip) >>> Yes exactly. I just don't want to reinvent the wheel as I imagine there are already tons of libraries and frameworks that support R

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-02 Thread John K Masters
On 08:00 Thu 02 Aug , [EMAIL PROTECTED] wrote: > On Aug 1, 6:42 pm, John K Masters <[EMAIL PROTECTED]> wrote: > > To suggest that, because the autocompletion worked on one method of a > > module and not on another was because I had not configured the > > PYTHONPATH properly is at least insultin

Re: i am new to python-Please somebody help

2007-08-02 Thread Terry Reedy
"gregarican" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | friendly than Python's. Your points are well-taken in how to properly | post and how to do your own homework. Message correct. Delivery | lacking... Sorry, I saw nothing rude in Steven's straightforward and indeed polite

Re: File access

2007-08-02 Thread Adrian Petrescu
On Aug 2, 12:41 pm, JD <[EMAIL PROTECTED]> wrote: > Hi, > > What I am trying to do is to run a subprocess on another machine using > subprocess.Popen, this subprocess contuinue writing something into a > file when it is runing. > > After submit this subprocess, I tried to open the file and readline

Re: File access

2007-08-02 Thread JD
Thanks for answering, No, the data was writing into the file when the subprocess was runing. For example, every second it will write something into the file. I tried to run another python program aside and it sucessfully read the file when the subprocess was runing. JD On Aug 2, 11:00 am, Adri

problems playing with dates from any month.

2007-08-02 Thread krishnakant Mane
hello, I have a very strange problem and I can't find any solution for that. I am working on an accounting package which I wish to develop in python. the simple problem is that I want to knoe how I can know if the given date is the nth day of a month. for example if a customer is supposed to pay hi

Re: Emacs + python

2007-08-02 Thread Greg Donald
On 8/1/07, hg <[EMAIL PROTECTED]> wrote: > Are there any cscope & ECB equivalent for Python ? ECB is not language specific. It works the same for browsing Python code as any other language. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: problems playing with dates from any month.

2007-08-02 Thread Ian Clark
krishnakant Mane wrote: > hello, > I have a very strange problem and I can't find any solution for that. > I am working on an accounting package which I wish to develop in python. > the simple problem is that I want to knoe how I can know if the given > date is the nth day of a month. > for example

Email

2007-08-02 Thread Rohan
I was wondering if there could be an arrangement where a file could be attached and send as an email. For ex f = open(add.txt,w) f.write('python') f.close() Now I would like to send an email with add.txt as an attachment, is it possible ? some one give me a pointer towards this. -- http://mail.p

Re: problems playing with dates from any month.

2007-08-02 Thread kyosohma
On Aug 2, 12:31 pm, "krishnakant Mane" <[EMAIL PROTECTED]> wrote: > hello, > I have a very strange problem and I can't find any solution for that. > I am working on an accounting package which I wish to develop in python. > the simple problem is that I want to knoe how I can know if the given > dat

Re: problems playing with dates from any month.

2007-08-02 Thread krishnakant Mane
On 02/08/07, Ian Clark <[EMAIL PROTECTED]> wrote: > > http://docs.python.org/lib/node85.html > I looked there even before. but could not figure out what the code did. I know in that variable called s there was a string in a valid date format. but when datetime.strptime was used, I did not understa

Re: File access

2007-08-02 Thread Larry Bates
JD wrote: > Hi, > > What I am trying to do is to run a subprocess on another machine using > subprocess.Popen, this subprocess contuinue writing something into a > file when it is runing. > > After submit this subprocess, I tried to open the file and readlines() > in the loop (with a delay) in th

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread Terry Reedy
"vml" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I am trying to promote python in my job, my collegue only see matlab | and microsoft scripting language. | I understood that there willl be no backward compatibility between | python 2.x and 3.0, does it means that: Most of the

  1   2   >