Re: How can I time how much each thread takes?

2007-04-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I have the following code which spawn a number of thread and do > something (in the run method of MyThread). > how can I record how much time does EACH thread takes to complete the > 'run'? > > for j in range(threadCount): > t =

only loading a language installed on system

2007-04-03 Thread ianaré
i'm doing this: mylocale = wx.Locale(wx.LANGUAGE_POLISH, wx.LOCALE_LOAD_DEFAULT) if not wx.Locale.IsOk(mylocale): mylocale = wx.Locale(wx.LANGUAGE_DEFAULT, wx.LOCALE_LOAD_DEFAULT) and getting this: Segmentation fault (core dumped) I'm trying to see if I can properly load a language. If the

Re: Question about text in Python

2007-04-03 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote: 8< > This is not a call to turn a blind eye for plagiarism, or to do students > homework for them. It's a plea for common-sense. We're not bound by > university guidelines, or universities' over-broad definition of > plagiarism, and we don't

How can I time how much each thread takes?

2007-04-03 Thread [EMAIL PROTECTED]
Hi, I have the following code which spawn a number of thread and do something (in the run method of MyThread). how can I record how much time does EACH thread takes to complete the 'run'? for j in range(threadCount): t = MyThread(testNo) threads.append(t)

Re: Need help on reading line from file into list

2007-04-03 Thread Mel Wilson
bahoo wrote: [ ... ] > Thanks, this helped a lot. > I am now using the suggested > map(str.strip, open('source.txt').readlines()) > > However, I am a C programmer, and I have a bit difficulty > understanding the syntax. > I don't see where the "str" came from, so perhaps the output of > "open('sou

Re: Refactoring question

2007-04-03 Thread ginstrom
> On Behalf Of Kevin Walzer > What's the best way to do this? Can anyone point me in the > right direction? How could, for instance, the top snippet be > rewritten to separate the Tkinter parts from the generic stuff? I like to use the broadcaster/broker recipe at http://aspn.activestate.com/ASPN/

Re: Where to find pywin32/win32all for Python 1.5.2?

2007-04-03 Thread Jack
Thanks Jay. When I searched the net, I also found mentioning of win32all-125.exe but I couldn't find a download link. Does anyone still have it in the HD? "jay graves" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Apr 3, 7:52 pm, "Jack" <[EMAIL PROTECTED]> wrote: >> I searched

Re: passing options to __import__

2007-04-03 Thread Alex Martelli
Harold Fellermann <[EMAIL PROTECTED]> wrote: ... > Within my program, I am importing a module via > __import__(module_name,globals(),locals()) The globals() you're passing are those of the *importing* module, and have no effect on those of the *imported* module. > and I want to pass comand lin

Re: NumPy 1.0.2

2007-04-03 Thread Terry Reedy
"Travis E. Oliphant" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | | We are pleased to announce the release of NumPy 1.0.2 For those curious like me, the summary news at SourceForge is " The latest release is a mostly bug-fix release with a few optimizations and enhancements."

Re: heap doesn't appear to work as described

2007-04-03 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | |>> My book says that in a heap, a value at position i will be smaller |>> than the values at positions 2*i and 2*i + 1. I am sure your book either uses 1-based arrays or a 0-based arrays with the first not used. The need to

SimpleXMLRPCServer - revisited

2007-04-03 Thread Jan Danielsson
Hello all, I want to be able to determine the IP address of the client making an XMPRPC call. I got the tip to use this: --- class RPCServer(SimpleXMLRPCServer): def _dispatch(self, method, params): """Extend dispatch, adding client info to some para

Re: Where to find pywin32/win32all for Python 1.5.2?

2007-04-03 Thread jay graves
On Apr 3, 7:52 pm, "Jack" <[EMAIL PROTECTED]> wrote: > I searched around but could not find win32all source or binaries for earlier > versions of Python. Don't ask me why but I have to use Python 1.5.2 in this > project :) The sourceforget page only has latest versions. ActiveState does > not even

Re: Requirements For A Visualization Software System For 2010

2007-04-03 Thread SamFeltus
It would be interesting to see a computer language include such functionality from the ground up. If these were core features of a language, you'd have something wicked cool, and not just a new language retreading the same features and functionality. -- http://mail.python.org/mailman/listinfo/py

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread Steven D'Aprano
On Tue, 03 Apr 2007 11:20:33 -0700, bahoo wrote: > Hi, > > I have a list like ['0024', 'haha', '0024'] > and as output I want ['haha'] > > If I > myList.remove('0024') > > then only the first instance of '0024' is removed. There are a whole heap of ways of doing this. They all have in common t

Re: Tkinter, how to get a button's bg color

2007-04-03 Thread John McMonagle
[EMAIL PROTECTED] wrote: > I am new to Tkinter. Following an example, I executed the following: > > window = Tk() > b = Button(window) > b.configure(bg = '#FF00FF') > b.grid(row = 0, column = 0) > > how can I later get the value of this button's background color? > > Thanks. > b.cget('bg')

Re: Where to find pywin32/win32all for Python 1.5.2?

2007-04-03 Thread Trent Mick
Jack wrote: > I searched around but could not find win32all source or binaries for earlier > versions of Python. Don't ask me why but I have to use Python 1.5.2 in this > project :) The sourceforget page only has latest versions. ActiveState does > not even have 1.5.2 for download. Is it still a

Re: heap doesn't appear to work as described

2007-04-03 Thread 7stud
On Apr 3, 5:27 pm, [EMAIL PROTECTED] wrote: > >> My book says that in a heap, a value at position i will be smaller > >> than the values at positions 2*i and 2*i + 1. > > Check the heapq docs for the constraints the Python heapq module maintains: > >http://docs.python.org/dev/lib/modu

Tkinter, how to get a button's bg color

2007-04-03 Thread [EMAIL PROTECTED]
I am new to Tkinter. Following an example, I executed the following: window = Tk() b = Button(window) b.configure(bg = '#FF00FF') b.grid(row = 0, column = 0) how can I later get the value of this button's background color? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Where to find pywin32/win32all for Python 1.5.2?

2007-04-03 Thread Jack
I searched around but could not find win32all source or binaries for earlier versions of Python. Don't ask me why but I have to use Python 1.5.2 in this project :) The sourceforget page only has latest versions. ActiveState does not even have 1.5.2 for download. Is it still available somewhere?

Refactoring question

2007-04-03 Thread Kevin Walzer
I currently have a GUI application (using Tkinter) in which all the code is placed in a single script. This means that the GUI bits are a bit too tightly bound to the "under-the-hood" logic of the app. Here's an example snippet: def installPackage(self): self.package = self.infotable.

Re: Parsing a setup file

2007-04-03 Thread James Stroud
Tommy Grav wrote: > Hi, > > I have a setup file for some numerical simulation code written in C > that looks like this: > > dt 0.1 > time 0.0 > nupdate 10 > noutput 100 > ntotal 1 > G 39.476926421373015 > Sun 1.0597682 > mplanet 9.547861040430418e-4 > 3.409530427945 3.635870038323 .03

Re: heap doesn't appear to work as described

2007-04-03 Thread skip
>> My book says that in a heap, a value at position i will be smaller >> than the values at positions 2*i and 2*i + 1. Check the heapq docs for the constraints the Python heapq module maintains: http://docs.python.org/dev/lib/module-heapq.html They are different than what you stat

Re: Calling Fortran from Python

2007-04-03 Thread Robert Kern
Mangabasi wrote: > Has anyone provide a similar example with Pyfort, F2Py or calldll? With the latest f2py in numpy: $ cat sample.pyf !-*- f90 -*- ! Note: the context of this file is case sensitive. python module sample ! in interface ! in :sample subroutine sample(ierr1,ierr2,

ANN: NumPy 1.0.2

2007-04-03 Thread Travis E. Oliphant
We are pleased to announce the release of NumPy 1.0.2 NumPy is a Python extension that provides a general-purpose multi-dimensional array that can act as a container of arbitrary raw-data formats (including bools, integers, floats, complex, Python objects, string, unicode, and general C-struct

heap doesn't appear to work as described

2007-04-03 Thread 7stud
My book says that in a heap, a value at position i will be smaller than the values at positions 2*i and 2*i + 1. To test that, I ran this program: -- from heapq import * from random import shuffle data = range(10) shuffle(data) heap = [] for n in data: heappush(heap, n) print heap

Re: low level networking in python

2007-04-03 Thread Maxim Veksler
On 3 Apr 2007 08:43:57 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Apr 3, 10:29 am, "Maxim Veksler" <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I wish to do some low level network stuff using python. > > > > -- > > Cheers, > > Maxim Veksler > > > > "Free as in Freedom" - Do u GNU ? >

Re: File Object behavior

2007-04-03 Thread Michael Castleton
Bruno Desthuilliers wrote: > > Michael Castleton a écrit : >> When I open a csv or txt file with: >> >> infile = open(sys.argv[1],'rb').readlines() >> or >> infile = open(sys.argv[1],'rb').read() >> >> and then look at the first few lines of the file there is a carriage >> return >> + >> li

Calling Fortran from Python

2007-04-03 Thread Mangabasi
Howdy, I have been trying to call the following Fortran function from Python (using Windows XP, Compaq Fortran and Python 2.4). I tried F2Py, Pyfort and calldll with no success. I think I came very close with calldll. Here is a short summary Fortran code: SUBROUTINE SAMPLE(IERR1,IERR2,A

passing options to __import__

2007-04-03 Thread Harold Fellermann
Dear list, I looked through the list but could not find any solutions for my current problem. Within my program, I am importing a module via __import__(module_name,globals(),locals()) and I want to pass comand line options to this module. I would prefer not to save them in a config module or a Con

Re: way to extract only the message from pop3

2007-04-03 Thread hlubenow
[EMAIL PROTECTED] wrote: > I found a tutorial on parsing email that should help you: > > http://www.devshed.com/c/a/Python/Python-Email-Libraries-SMTP-and-Email-Parsing/ > > Also see the email module: > > http://www.python.org/doc/2.3.5/lib/module-email.html > > Mike Well, I couldn't work wit

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread bahoo
On Apr 3, 6:05 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > bahoo wrote: > > The larger problem is, I have a list of strings that I want to remove > > from another list of strings. > > If you don't care about the resulting order:: > > >>> items = ['foo', 'bar', 'baz', 'bar', 'foo', 'frobble

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread Steven Bethard
bahoo wrote: > The larger problem is, I have a list of strings that I want to remove > from another list of strings. If you don't care about the resulting order:: >>> items = ['foo', 'bar', 'baz', 'bar', 'foo', 'frobble'] >>> to_remove = ['foo', 'bar'] >>> set(items) - set(to_remov

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread bahoo
On Apr 3, 3:01 pm, "7stud" <[EMAIL PROTECTED]> wrote: > On Apr 3, 12:20 pm, "bahoo" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I have a list like ['0024', 'haha', '0024'] > > and as output I want ['haha'] > > > If I > > myList.remove('0024') > > > then only the first instance of '0024' is removed.

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread bahoo
On Apr 3, 4:21 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > bahoo wrote: > > On Apr 3, 2:31 pm, "Matimus" <[EMAIL PROTECTED]> wrote: > >> It depends on your application, but a 'set' might really be what you > >> want, as opposed to a list. > > > s = set(["0024","haha","0024"]) > > s > >> s

Re: Numeric compiling problem under QNX 4.25

2007-04-03 Thread Robert Kern
ZMY wrote: > On Apr 3, 10:51 am, Robert Kern <[EMAIL PROTECTED]> wrote: >> ZMY wrote: >>> Is "ld" part of make command? I am not familiar with compiling with >>> make in general. >> No, it's the linker. I takes the object files (.o) which are generated by the >> compiler (cc, I imagine) and links t

Re: Problem with filter()

2007-04-03 Thread Michael Spencer
Boudreau, Emile wrote: > Hey all, > So I'm trying to filter a list with the built-in function > filter(). My list looks something like this: > ['logs', 'rqp-8.2.104.0.dep', 'rqp-8.2.93.0.dep', > 'rqp-win32-app-8.2.96.0-inst.tar.gz', 'rqp-win32-app-8.2.96.0-inst.tar.gz'] > > Calling filte

Re: troubles building python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK

2007-04-03 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > This doc has not been updated since the 64 bit compilers came out > officially. It doesn't make a whole lot of sense of what steps you > should follow to build python. I saw a link on the comp.lang.python > that had the steps, but that link doesn't go anywhere now. I had

Re: Newbie - needs help

2007-04-03 Thread 7stud
On Apr 3, 2:42 pm, "Anbeyon" <[EMAIL PROTECTED]> wrote: > Hi > > I have not yet programmed in Python but am experienced in a number o > other languages. > > I'd like to start to use Python to develop cross platform applications > but havin kust started to investigate tols, libraries etc I feel a >

*** Free and FAST Internet TV to the WHOLE WORLD ***

2007-04-03 Thread thermate2
"http://www.linktv.org/mosaic/streamsArchive/index.php4? episode_date=20070330&vidsize=lg" Enjoy -- http://mail.python.org/mailman/listinfo/python-list

Re: How to check if OS is unix or pc

2007-04-03 Thread kyosohma
On Apr 3, 4:12 pm, "bahoo" <[EMAIL PROTECTED]> wrote: > In Matlab, there is a "isunix" command. > Is there something similar in python? > > Thanks! > bahoo Check out the platform module. It should do what you need. The "release()" method is especially useful. Mike -- http://mail.python.org/mail

Re: How to check if OS is unix or pc

2007-04-03 Thread Bruno Desthuilliers
bahoo a écrit : > In Matlab, there is a "isunix" command. > Is there something similar in python? >>> import os >>> os.uname() ('Linux', 'bibi', '2.6.9', '#1 Sun Dec 5 14:54:12 CET 2004', 'i686') >>> os.name 'posix' >>> isunix = lambda: os.name == 'posix' >>> isunix() True Note that if you wo

Re: Need help on reading line from file into list

2007-04-03 Thread Grant Edwards
On 2007-04-03, bahoo <[EMAIL PROTECTED]> wrote: > Thanks, this helped a lot. > I am now using the suggested > map(str.strip, open('source.txt').readlines()) > > However, I am a C programmer, and I have a bit difficulty > understanding the syntax. That bit of syntax is completely, utterly, 100%,

Re: Newbie - needs help

2007-04-03 Thread kyosohma
On Apr 3, 3:42 pm, "Anbeyon" <[EMAIL PROTECTED]> wrote: > Hi > > I have not yet programmed in Python but am experienced in a number o > other languages. > > I'd like to start to use Python to develop cross platform applications > but havin kust started to investigate tols, libraries etc I feel a >

Re: Need help on reading line from file into list

2007-04-03 Thread Bruno Desthuilliers
bahoo a écrit : > On Apr 3, 5:06 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > (snip) >> >>> open('source.txt').readlines() >>['0024\n'] >> >>> map(str.strip, open('source.txt').readlines()) >>['0024'] >> >>> open('source.txt').read() >>'0024\n' >> >>> list(open('source.txt').read().strip

How to check if OS is unix or pc

2007-04-03 Thread bahoo
In Matlab, there is a "isunix" command. Is there something similar in python? Thanks! bahoo -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric compiling problem under QNX 4.25

2007-04-03 Thread ZMY
On Apr 3, 1:33 pm, "ZMY" <[EMAIL PROTECTED]> wrote: > On Apr 3, 10:51 am, Robert Kern <[EMAIL PROTECTED]> wrote: > > > > >ZMYwrote: > > > Is "ld" part of make command? I am not familiar with compiling with > > > make in general. > > > No, it's the linker. I takes the object files (.o) which are gen

Parsing a setup file

2007-04-03 Thread Tommy Grav
Hi, I have a setup file for some numerical simulation code written in C that looks like this: dt 0.1 time 0.0 nupdate 10 noutput 100 ntotal 1 G 39.476926421373015 Sun 1.0597682 mplanet 9.547861040430418e-4 3.409530427945 3.635870038323 .03424028779975 -2.0471057839802485 2.0178211484

Re: File Object behavior

2007-04-03 Thread Bruno Desthuilliers
Michael Castleton a écrit : > When I open a csv or txt file with: > > infile = open(sys.argv[1],'rb').readlines() > or > infile = open(sys.argv[1],'rb').read() > > and then look at the first few lines of the file there is a carriage return > + > line feed at the end of each line - \r\n Is ther

Re: doing standart window icons unvisible in python

2007-04-03 Thread gslm
On 3 Nisan, 21:41, "gslm" <[EMAIL PROTECTED]> wrote: > Only I want to print my application's view without these icons,ok. > Thanks. And is it possible to provide .exe file for any program in python or only we can change the file as .pyw? Can you answer this question, too? Regards... -- http://m

Re: print the screen shot in python

2007-04-03 Thread gslm
On 3 Nisan, 21:38, [EMAIL PROTECTED] wrote: > On Apr 3, 1:16 pm, "gslm" <[EMAIL PROTECTED]> wrote: > > > Thanks, > > I use TKinter,os:Xp home,python25. > > I want to print all my application's view, except the close-minimize > > icons. > > I don't know enough about Tkinter, but you can use the grap

Re: Need help on reading line from file into list

2007-04-03 Thread bahoo
On Apr 3, 5:06 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > bahoo a écrit : > > > Hi, > > > I have a text file containing a single line of text, such as > > 0024 > > > How should I read it into a "list"? > > You mean ['0024'], or ['0', '0', '2', '4'] ? > > > I tried this, but the "join" did

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread irstas
On Apr 3, 10:13 pm, "bahoo" <[EMAIL PROTECTED]> wrote: > On Apr 3, 2:31 pm, "Matimus" <[EMAIL PROTECTED]> wrote: > > > It depends on your application, but a 'set' might really be what you > > want, as opposed to a list. > > > >>> s = set(["0024","haha","0024"]) > > >>> s > > > set(["0024","haha"])>

ImageGrab

2007-04-03 Thread gslm
root = tk.Tk() def click(): x=button1.winfo_rootx() y=button1.winfo_rooty() image=PIL.ImageGrab.grab((x,y,x+260,y+250)) image.save( 'tmp.jpeg') button1 = tk.Button(root, compound=tk.TOP, width=60, height=50,bg='black', command=click) button1.pack() root.mainloop() Hi! How c

Newbie - needs help

2007-04-03 Thread Anbeyon
Hi I have not yet programmed in Python but am experienced in a number o other languages. I'd like to start to use Python to develop cross platform applications but havin kust started to investigate tols, libraries etc I feel a little overwhelmed. I'm hoping someone might be able to point me in

Re: File Object behavior

2007-04-03 Thread Michael Castleton
Thank you to both Steve and 7stud. You were right on with binary flag! I thought I had tried everything... Mike -- View this message in context: http://www.nabble.com/File-Object-behavior-tf3520070.html#a9825806 Sent from the Python - python-list mailing list archive at Nabble.com. -- http://

Re: Numeric compiling problem under QNX 4.25

2007-04-03 Thread ZMY
On Apr 3, 10:51 am, Robert Kern <[EMAIL PROTECTED]> wrote: > ZMY wrote: > > Is "ld" part of make command? I am not familiar with compiling with > > make in general. > > No, it's the linker. I takes the object files (.o) which are generated by the > compiler (cc, I imagine) and links them together i

Re: Need help on reading line from file into list

2007-04-03 Thread Bruno Desthuilliers
bahoo a écrit : > Hi, > > I have a text file containing a single line of text, such as > 0024 > > How should I read it into a "list"? You mean ['0024'], or ['0', '0', '2', '4'] ? > I tried this, but the "join" did not work as expected. What did you expect ? help(str.join) join(...) S.joi

Antigen Notification: Antigen found a message matching a filter

2007-04-03 Thread Antigen_VITORIA
Microsoft Antigen for Exchange found a message matching a filter. The message is currently Purged. Message: "Python_list Digest_ Vol 43_ Issue 48" Filter name: "KEYWORD= spam: xxx " Sent from: "[EMAIL PROTECTED]" Folder: "SMTP Messages\Inbound And Outbound" Location: "ITURAN/First Administrative G

Re: troubles building python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK

2007-04-03 Thread bhochstetler
On Apr 3, 4:16 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Apr 3, 2:04 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] wrote: > >>> I am needing to build python 2.5 on Windows XP x64 Windows Server 2003 > >>> sp1 Platform SDK and am not findi

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread Steve Holden
bahoo wrote: > On Apr 3, 2:31 pm, "Matimus" <[EMAIL PROTECTED]> wrote: >> It depends on your application, but a 'set' might really be what you >> want, as opposed to a list. >> > s = set(["0024","haha","0024"]) > s >> set(["0024","haha"])>>> s.remove("0024") > s >> set(["haha"]) > > Th

Re: troubles building python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK

2007-04-03 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > On Apr 3, 2:04 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> I am needing to build python 2.5 on Windows XP x64 Windows Server 2003 >>> sp1 Platform SDK and am not finding anything documented on the process >>> to use. Has anyone had any su

Re: how can I clear a dictionary in python

2007-04-03 Thread Aahz
In article <[EMAIL PROTECTED]>, Larry Bates <[EMAIL PROTECTED]> wrote: >Aahz wrote: >> In article <[EMAIL PROTECTED]>, >> Larry Bates <[EMAIL PROTECTED]> wrote: >>> [EMAIL PROTECTED] wrote: I create a dictionary like this myDict = {} and I add entry like this: myDict

Need help on reading line from file into list

2007-04-03 Thread bahoo
Hi, I have a text file containing a single line of text, such as 0024 How should I read it into a "list"? I tried this, but the "join" did not work as expected. Any suggestions? infile = open('my_file.txt','r') for line in infile: line.join(line) my_list.extend( line ) -- http

Re: way to extract only the message from pop3

2007-04-03 Thread kyosohma
On Apr 3, 2:36 pm, "flit" <[EMAIL PROTECTED]> wrote: > Hello All, > > Using poplib in python I can extract only the headers using the .top, > there is a way to extract only the message text without the headers? > > like remove the fields below: > " > Return-Path: > X-Original-To: > Received: from [

Re: Finding a module's sub modules at runtime

2007-04-03 Thread Joshua J. Kugler
On Monday 02 April 2007 16:33, Robert Kern wrote: >> help(pkgutil.iter_modules) >>> Help on function iter_modules in module pkgutil: >>> >>> iter_modules(path=None, prefix='') >>> Yields (module_loader, name, ispkg) for all submodules on path, >>> or, if path is None, all top-level modu

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread Matimus
On Apr 3, 12:13 pm, "bahoo" <[EMAIL PROTECTED]> wrote: > On Apr 3, 2:31 pm, "Matimus" <[EMAIL PROTECTED]> wrote: > > > It depends on your application, but a 'set' might really be what you > > want, as opposed to a list. > > > >>> s = set(["0024","haha","0024"]) > > >>> s > > > set(["0024","haha"])>

way to extract only the message from pop3

2007-04-03 Thread flit
Hello All, Using poplib in python I can extract only the headers using the .top, there is a way to extract only the message text without the headers? like remove the fields below: " Return-Path: X-Original-To: Received: from [ by (Postfix) with ESMTP id B32382613C for Tue, 3 Apr

Re: getattr/setattr q.

2007-04-03 Thread Paulo da Silva
> Yes, but you shouldn't unless you really need to. You're better off > rethinking your algorithm. I need it but inside a class. The idea is to pass an instance of a class (think of something like a record but with some methods inside) with "fields", whose names are not known in advance, to ano

Requirements For A Visualization Software System For 2010

2007-04-03 Thread Xah Lee
REQUIREMENTS FOR A VISUALIZATION SOFTWARE SYSTEM FOR 2010 Xah Lee, 2007-03-16 In this essay, i give a list of requirements that i think is necessary for a software system for creating scientific visualization for the next decade (2007-2017). (for a HTML version with images, please see http://xah

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread bahoo
On Apr 3, 2:31 pm, "Matimus" <[EMAIL PROTECTED]> wrote: > It depends on your application, but a 'set' might really be what you > want, as opposed to a list. > > >>> s = set(["0024","haha","0024"]) > >>> s > > set(["0024","haha"])>>> s.remove("0024") > >>> s > > set(["haha"]) This sounds cool. But

Re: How can i compare a string which is non null and empty

2007-04-03 Thread Bruno Desthuilliers
Steven Howe a écrit : (nb : original post reinserted) > [EMAIL PROTECTED] a écrit : >> how can i compare a string which is non null and empty? >> (snip) >> In java,I do this: >> if (str != null) && (!str.equals("")) >> >> how can i do that in python? > > how about just testing it's length?

RE: Extracting a file from a tarball

2007-04-03 Thread Boudreau, Emile
Your hint of checking "tar.getnames()" was exatly what I needed. It returns the path to where the file will be extracted (ie. Src/ver/qfw/symbols.xml). After knowing this fact it was quite simple to extract the file. Thanks, problem solved!!! Emile Boudreau x5754 -Original Message- From:

Re: os.popen--which one to use?

2007-04-03 Thread kyosohma
On Apr 3, 1:53 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote: > I'm confused by the number of variations on "popen" that Python offers. > > I'm using os.popen in my programs without difficulty. Is this wrong? > Should I be using popen 2, popen3, etc.? I'm not clear on what the > advantages of popen2,

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread 7stud
On Apr 3, 12:20 pm, "bahoo" <[EMAIL PROTECTED]> wrote: > Hi, > > I have a list like ['0024', 'haha', '0024'] > and as output I want ['haha'] > > If I > myList.remove('0024') > > then only the first instance of '0024' is removed. > > It seems like regular expressions is the rescue, but I couldn't fi

Re: os.popen--which one to use?

2007-04-03 Thread [EMAIL PROTECTED]
On Apr 3, 12:53 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote: > I'm confused by the number of variations on "popen" that Python offers. > > I'm using os.popen in my programs without difficulty. Is this wrong? > Should I be using popen 2, popen3, etc.? I'm not clear on what the > advantages of popen2,

Re: os.popen--which one to use?

2007-04-03 Thread Robert Kern
Kevin Walzer wrote: > I'm confused by the number of variations on "popen" that Python offers. > > I'm using os.popen in my programs without difficulty. Is this wrong? > Should I be using popen 2, popen3, etc.? I'm not clear on what the > advantages of popen2, 3 etc. are: they seem a lot more com

Re: How to have a list of lists (or array of lists)

2007-04-03 Thread Bruno Desthuilliers
bahoo a écrit : > Hi, > > I want to have many lists, such as list0, list1, list2, ..., each one > holding different number of items. > Is there something like > list[0] > list[1] > list[2] > > so that I can iterate through this list of lists? listoflists = [ [1, 2, 3], ["foo", "bar", "baaz

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread kyosohma
On Apr 3, 1:49 pm, [EMAIL PROTECTED] wrote: > On Apr 3, 1:31 pm, "Matimus" <[EMAIL PROTECTED]> wrote: > > > It depends on your application, but a 'set' might really be what you > > want, as opposed to a list. > > > >>> s = set(["0024","haha","0024"]) > > >>> s > > > set(["0024","haha"])>>> s.remove

Re: Retrieve an item from a dictionary using an arbitrary object as the key

2007-04-03 Thread Bruno Desthuilliers
abcd a écrit : >>You'll need __eq__ for testing if two objects are equivalent, and >>__hash__ for calculating object's hash value. >> >>class Type: While we're at it, and unless you're stuck with an aging Python version, make Type and Person new-style classes: class Type(object): >>def __in

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread Thomas Nelson
On Apr 3, 1:49 pm, [EMAIL PROTECTED] wrote: > On Apr 3, 1:31 pm, "Matimus" <[EMAIL PROTECTED]> wrote: > > > It depends on your application, but a 'set' might really be what you > > want, as opposed to a list. > > > >>> s = set(["0024","haha","0024"]) > > >>> s > > > set(["0024","haha"])>>> s.remove

os.popen--which one to use?

2007-04-03 Thread Kevin Walzer
I'm confused by the number of variations on "popen" that Python offers. I'm using os.popen in my programs without difficulty. Is this wrong? Should I be using popen 2, popen3, etc.? I'm not clear on what the advantages of popen2, 3 etc. are: they seem a lot more complicated. -- Kevin Walzer Co

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread Thomas Nelson
bahoo wrote: > Hi, > > I have a list like ['0024', 'haha', '0024'] > and as output I want ['haha'] > > If I > myList.remove('0024') > > then only the first instance of '0024' is removed. > > It seems like regular expressions is the rescue, but I couldn't find > the right tool. > > Thanks! > bahoo

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread kyosohma
On Apr 3, 1:31 pm, "Matimus" <[EMAIL PROTECTED]> wrote: > It depends on your application, but a 'set' might really be what you > want, as opposed to a list. > > >>> s = set(["0024","haha","0024"]) > >>> s > > set(["0024","haha"])>>> s.remove("0024") > >>> s > > set(["haha"]) If you want, you can a

Re: raw_input just continues anyway?

2007-04-03 Thread Steve Holden
[EMAIL PROTECTED] wrote: > How could I resolve this? > Try to keep each answer so it makes sense on its own, please. I presume you are responding to this: > In <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] wrote: > >> > if __name__ == "__main__": >> >bucket_name = raw_input('Name of the bucket y

Re: doing standart window icons unvisible in python

2007-04-03 Thread gslm
Only I want to print my application's view without these icons,ok. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: print the screen shot in python

2007-04-03 Thread kyosohma
On Apr 3, 1:16 pm, "gslm" <[EMAIL PROTECTED]> wrote: > Thanks, > I use TKinter,os:Xp home,python25. > I want to print all my application's view, except the close-minimize > icons. I don't know enough about Tkinter, but you can use the graphics module according to this post that should take a scree

Re: File Object behavior

2007-04-03 Thread 7stud
On Apr 3, 12:26 pm, "7stud" <[EMAIL PROTECTED]> wrote: > The file.writelines() documentation says that it > doesn't add line separators. Is adding a carriage return something > different? No. > Is this expected behavior? According to Python in a Nutshell(p. 217), it is. On windows, in text mode

Re: how to remove multiple occurrences of a string within a list?

2007-04-03 Thread Matimus
It depends on your application, but a 'set' might really be what you want, as opposed to a list. >>> s = set(["0024","haha","0024"]) >>> s set(["0024","haha"]) >>> s.remove("0024") >>> s set(["haha"]) -- http://mail.python.org/mailman/listinfo/python-list

Re: File Object behavior

2007-04-03 Thread 7stud
On Apr 3, 12:02 pm, Michael Castleton <[EMAIL PROTECTED]> wrote: > When I open a csv or txt file with: > > infile = open(sys.argv[1],'rb').readlines() > or > infile = open(sys.argv[1],'rb').read() > > and then look at the first few lines of the file there is a carriage return > + > line feed at the

Re: troubles building python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK

2007-04-03 Thread bhochstetler
On Apr 3, 2:04 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I am needing to build python 2.5 on Windows XP x64 Windows Server 2003 > > sp1 Platform SDK and am not finding anything documented on the process > > to use. Has anyone had any success with this? If so has a

how to remove multiple occurrences of a string within a list?

2007-04-03 Thread bahoo
Hi, I have a list like ['0024', 'haha', '0024'] and as output I want ['haha'] If I myList.remove('0024') then only the first instance of '0024' is removed. It seems like regular expressions is the rescue, but I couldn't find the right tool. Thanks! bahoo -- http://mail.python.org/mailman/lis

Re: print the screen shot in python

2007-04-03 Thread gslm
Thanks, I use TKinter,os:Xp home,python25. I want to print all my application's view, except the close-minimize icons. -- http://mail.python.org/mailman/listinfo/python-list

Re: raw_input just continues anyway?

2007-04-03 Thread [EMAIL PROTECTED]
How could I resolve this? Many thanks, O -- http://mail.python.org/mailman/listinfo/python-list

Re: File Object behavior

2007-04-03 Thread Steven Bethard
Michael Castleton wrote: > When I open a csv or txt file with: > > infile = open(sys.argv[1],'rb').readlines() > or > infile = open(sys.argv[1],'rb').read() > > and then look at the first few lines of the file there is a carriage return > + > line feed at the end of each line - \r\n > This is f

Re: How to have a list of lists (or array of lists)

2007-04-03 Thread 7stud
On Apr 3, 10:12 am, "bahoo" <[EMAIL PROTECTED]> wrote: > Hi, > > I want to have many lists, such as list0, list1, list2, ..., each one > holding different number of items. > Is there something like > list[0] > list[1] > list[2] > > so that I can iterate through this list of lists? > > Thanks! > bah

Re: Numeric compiling problem under QNX 4.25

2007-04-03 Thread John Nagle
ZMY wrote: > Dear all, > > I am a real newbie for both python and QNX, but I am still trying to > compile Numeric-24.2 under QNX4.25 with python 2.2. If you're new to QNX, why are you running QNX 4? That's for legacy systems only. Move up to QNX 6, which has been out for ten years now.

Re: How can I kill a running thread when exiting from __main__

2007-04-03 Thread skip
Steve> Maybe, then, the real answer is "just exit from the main thread"? Yes, I believe so. If that's not what's happening I would look to see if there is another thread which wasn't marked as a daemon. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: troubles building python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK

2007-04-03 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > I am needing to build python 2.5 on Windows XP x64 Windows Server 2003 > sp1 Platform SDK and am not finding anything documented on the process > to use. Has anyone had any success with this? If so has anyone > documented it? The documentation that resides in pcbuild/read

File Object behavior

2007-04-03 Thread Michael Castleton
When I open a csv or txt file with: infile = open(sys.argv[1],'rb').readlines() or infile = open(sys.argv[1],'rb').read() and then look at the first few lines of the file there is a carriage return + line feed at the end of each line - \r\n This is fine and somewhat expected. My problem comes

Re: cli user interface ala cisco IOS or JUNOS

2007-04-03 Thread phil . aerts . tln
On 3 apr, 11:57, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > for one of mypythonprojects I need an user interface similar to that > > of cisco IOS or even better JuniperJUNOS. > > Does anyone know of existingpythonmodules that gives this kind of > > functionality? > > I su

  1   2   3   >