ANN: Pythonutils 0.2.5

2005-12-19 Thread Fuzzyman
`Pythonutils 0.2.5 http://www.voidspace.org.uk/python/pythonutils.html`_ is now available. **Pythonutils** is a pure-Python package containing several modules that help with common programming tasks in Python. This new release updates to : * **ConfigObj** 4.1.0 * **odict** 0.2.1 * **validate**

Re: Looking for examples of developing new Tkinter Widgets in Tcl/Tk

2005-12-19 Thread Steve Holden
[EMAIL PROTECTED] wrote: Hi, Can anyone point me to any good examples of how to get started developing new Tkinter widgets in Tcl/Tk? I have read a number of the popular books on Python and Tkinter: - Grayson, J.E., Python and Tkinter Programming, Manning Publications, 2000 - Lutz,

Re: i need your help

2005-12-19 Thread Kevin Yuan
You may use IDLE in the Start menu2005/12/19, Steve Holden [EMAIL PROTECTED]: emrah gün wrote: hi.i dont know it is true or not to write you about that.I ve problem to run phyton in my personal computer.I install it and there is no error when installing but when i want to run pythonw.exe, no

Re: disassemble, was(How do (not) I distribute my Python progz?)

2005-12-19 Thread Juergen Kareta
gene tani schrieb: http://users.cs.cf.ac.uk/J.P.Giddy/python/decompiler/decompiler.html Thanks for the links. Regards, Jürgen -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with exec

2005-12-19 Thread Antoon Pardon
Op 2005-12-16, Peter Otten schreef [EMAIL PROTECTED]: Antoon Pardon wrote: I'm using PLY. The assign function is a dumbded down version of a production function that will be called during the parsing of a config file. Each time a line of the form: var = val is encounterd I do

Re: Accessing next/prev element while for looping

2005-12-19 Thread Steve Holden
Steven D'Aprano wrote: On Sun, 18 Dec 2005 04:50:20 -0800, Max Erickson wrote: j is a built-in object used to make complex numbers. Or at least it was, until you rebound it to the current element from myarray. That's bad practice, but since using complex numbers is rather unusual, one you

Reliable software [was Re: Xah's Edu Corner: Responsible Software Licensing]

2005-12-19 Thread Steven D'Aprano
robic0 wrote about software liabilities: If the software opens a file and is in the middle of writing to it, then the user dumps the power to the machine and ends up having to reformat, thereby losing all his data, at what point does the liability stop? And how is fault proven or dished out?

Re: Columns and Rows in Excel

2005-12-19 Thread Steven D'Aprano
Anand wrote: Greetings, How can I find the number of active columns and rows used in an excel work sheet? What I mean is how can i find the last column and row or cell position, where the data is stored in an excel sheet? Is the worksheet currently open in Excel or OpenOffice, and you

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Steve Holden
Kevin Yuan wrote: How to remove duplicated elements in a list? eg. [1,2,3,1,2,3,1,2,1,2,1,3] - [1,2,3]? Thanks!! list(set([1,2,3,1,2,3,1,2,1,2,1,3])) [1, 2, 3] regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com

Re: Columns and Rows in Excel

2005-12-19 Thread [EMAIL PROTECTED]
In Python you probaly best follow a recipe like this. 1 Save the file in Excel as a csv file. 2.Study the reader object of Python's csv module : http://docs.python.org/lib/module-csv.html 3. Read a row for row in in a list, split it on comma, count the elements, the maximum of all these is the

Re: how to remove duplicated elements in a list?

2005-12-19 Thread bonono
Steve Holden wrote: Kevin Yuan wrote: How to remove duplicated elements in a list? eg. [1,2,3,1,2,3,1,2,1,2,1,3] - [1,2,3]? Thanks!! list(set([1,2,3,1,2,3,1,2,1,2,1,3])) [1, 2, 3] Would this have the chance of changing the order ? Don't know if he wants to maintain the order or

Re: Accessing next/prev element while for looping

2005-12-19 Thread Paul Rubin
Joseph Garvin [EMAIL PROTECTED] writes: And this way I can keep referring to j instead of myarray[i], but I'm still forced to use myarray[i-1] and myarray[i+1] to refer to the previous and next elements. Being able to do j.prev, j.next seems more intuitive. Is there some other builtin

Re: Accessing next/prev element while for looping

2005-12-19 Thread Paul Rubin
Paul Rubin http://[EMAIL PROTECTED] writes: elts = iter(myarray) prev,cur,next = elts.next(),elts.next(),elts.next() for next2 in elts: do_something_with (prev, cur, next) prev,cur,next = cur, next, next2 Of course these fail when there's less than 3 elements. Ehh,

Win32 popen with py2exe

2005-12-19 Thread Kinsley Turner
Hey, Does os.popen() actually work in a py2exe win32 package? As far as I can tell, it just doesn't seem to do anything, although it seems to work ok outside of py2exe. Any hints? There does seem to be a popen.exe combined with py2exe... Ah... maybe that's not being included in the package!?

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-19 02:27: Steve Holden wrote: Kevin Yuan wrote: How to remove duplicated elements in a list? eg. [1,2,3,1,2,3,1,2,1,2,1,3] - [1,2,3]? Thanks!! list(set([1,2,3,1,2,3,1,2,1,2,1,3])) [1, 2, 3] Would this have the chance of changing the

Re: Problem with exchange mail server

2005-12-19 Thread Vinayakc
Hi Team, Thanks for reply. Yes, I can give you fair idea what I am doing here hdr = email.message_from_string( smtp_header_string ) tmpContentType = msg['Content-Type'] del msg['Content-Type'] for key in hdr.keys(): values = hdr.get_all(key) if values != None:

How to SetFocus to an activex control when a dialog is prompted?

2005-12-19 Thread Haobing
I embeded an flash activex control to a wxPanel inherited class 'MyPanel' using wxPython's MakeActiveXClass method, and 'MyPanel' only has flash control ;But when then dialog init,the focus is not on the flash, I have to click the flash control manully to setfocus on it; It will lose focus again

Testing the availability of a module

2005-12-19 Thread Bo Peng
Dear list, Is there a better way than doing try: import aModule except: has_aModule = False else: has_aModule = True The main concern here is that loading aModule is unnecessary (and may take time). Many thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Kevin Yuan
2005/12/19, Brian van den Broek [EMAIL PROTECTED]: [EMAIL PROTECTED] said unto the world upon 2005-12-19 02:27: Steve Holden wrote:Kevin Yuan wrote:How to remove duplicated elements in a list? eg. [1,2,3,1,2,3,1,2,1,2,1,3] - [1,2,3]?Thanks!! list(set([1,2,3,1,2,3,1,2,1,2,1,3]))[1, 2, 3] Would this

Re: PyQT dll's | missing qt-mtedu333.dll

2005-12-19 Thread Phil Thompson
On Sunday 18 December 2005 10:21 pm, jelle wrote: Hi, I'm trying to run a python program which requires PyQt, which is installed properly on my machine, but unfortuanately it doesn't come with the required .dll to run the .pyd's, I'm missing qt-mtedu333.dll. This version is no longer available

Re: Testing the availability of a module

2005-12-19 Thread Kevin Yuan
2005/12/19, Bo Peng [EMAIL PROTECTED]: Dear list,Is there a better way than doingtry: import aModuleexcept: has_aModule = Falseelse: has_aModule = TrueThe main concern here is that loading aModule is unnecessary (and may take time).If loading aModule is unnecessary, the best way is not loading it

ANN: Pythonutils 0.2.5

2005-12-19 Thread Fuzzyman
`Pythonutils 0.2.5 http://www.voidspace.org.uk/python/pythonutils.html`_ is now available. **Pythonutils** is a pure-Python package containing several modules that help with common programming tasks in Python. This new release updates to : * **ConfigObj** 4.1.0 * **odict** 0.2.1 * **validate**

Re: Columns and Rows in Excel

2005-12-19 Thread Anand
Greetings, The worksheet is currently opened in Excel. And I want to read the data from the excel worksheet. Instead of looping through the entire worksheet, I want to limit the looping to the rows and columns used so far! Thanks and regards, Anand Steven D'Aprano [EMAIL PROTECTED] wrote in

Re: object oriented programming question

2005-12-19 Thread Daniel Nogradi
Hi Michael, one more thing. As you could see my only goal was to be able to say 1 inst = x() 2 3 inst.a(some string) 4 inst.a.func() 5 6 inst.b(some other string) 7 inst.b.func() and (3) should modify 'inst.content' in some way depending on some string and the attribute 'a' while (4) should

Re: Columns and Rows in Excel

2005-12-19 Thread Steve Holden
Steven D'Aprano [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Anand wrote: Greetings, How can I find the number of active columns and rows used in an excel work sheet? What I mean is how can i find the last column and row or cell position, where the data is stored in an

Re: Windows Services

2005-12-19 Thread Mondal
Hi, Every one please accept my thanks. I have stopped using Python IDLE. Know I am using Pythonwin IDE from Active State. They have the same core modules. But the Pywin32 extensions are a plus from Active State. The problem is that the Pywin32 Documentation is incomplete/incorrect. The modules

Re: Xah's Edu Corner: Responsible Software Licensing

2005-12-19 Thread Roedy Green
On Sun, 18 Dec 2005 18:42:52 -0800, robic0 wrote, quoted or indirectly quoted someone who said : If the software opens a file and is in the middle of writing to it, then the user dumps the power to the machine and ends up having to reformat, thereby losing all his data, at what point does the

reading files

2005-12-19 Thread Johhny
Hello All, I am working my way through learning python as a language. I am having some issues with something that looks right and does not work. I am trying to get myself more familure with reading files. Based on the tutorials at www.python.org This should work. but im not sure what the issue

getopt and options with multiple arguments

2005-12-19 Thread [EMAIL PROTECTED]
I want to be able to do something like: myscript.py * -o outputfile and then have the shell expand the * as usual, perhaps to hundreds of filenames. But as far as I can see, getopt can only get one argument with each option. In the above case, there isn't even an option string before the *, but

Re: reading files

2005-12-19 Thread bonono
Johhny wrote: Hello All, I am working my way through learning python as a language. I am having some issues with something that looks right and does not work. I am trying to get myself more familure with reading files. Based on the tutorials at www.python.org This should work. but im not

Re: reading files

2005-12-19 Thread Steve Holden
Johhny wrote: Hello All, I am working my way through learning python as a language. I am having some issues with something that looks right and does not work. I am trying to get myself more familure with reading files. Based on the tutorials at www.python.org This should work. but im not

Re: reading files

2005-12-19 Thread Jorge Godoy
Johhny [EMAIL PROTECTED] writes: ===SNIP=== import string Why's that here? You don't need that import... vsftpd=open('vsftpd.conf', 'r') Open the file and associate its resulting *object* to the 'vsftpd' variable. print vsftpd Print the object's __str__. vsftpd.read() Read the full

Re: reading files

2005-12-19 Thread bonono
Steve Holden wrote: Johhny wrote: Hello All, I am working my way through learning python as a language. I am having some issues with something that looks right and does not work. I am trying to get myself more familure with reading files. Based on the tutorials at www.python.org This

Re: getopt and options with multiple arguments

2005-12-19 Thread Simon Brunning
On 19 Dec 2005 02:29:41 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I want to be able to do something like: myscript.py * -o outputfile and then have the shell expand the * as usual, perhaps to hundreds of filenames. But as far as I can see, getopt can only get one argument with each

Re: reading files

2005-12-19 Thread Johhny
Thanks for your assistance, Is it proper practice in python to flush any memory when you exit? for example Ive read the file into memory, when I close the file do I also have to flush any memory allocations ? -- http://mail.python.org/mailman/listinfo/python-list

Re: reading files

2005-12-19 Thread bonono
Johhny wrote: Thanks for your assistance, Is it proper practice in python to flush any memory when you exit? for example Ive read the file into memory, when I close the file do I also have to flush any memory allocations ? No. you don't need to and shouldn't unless you have very very specific

coupling python scripts

2005-12-19 Thread sandercaerteling
Hi There! I created a few python scripts and everything is working fine. But to make it easier to run the procedure i want to couple these scripts in one big script. Is there a possibility to do this, can I for example make a script dat 'calls' the other script in the right order? Many thanks!

Re: getopt and options with multiple arguments

2005-12-19 Thread PoD
On Mon, 19 Dec 2005 02:29:41 -0800, [EMAIL PROTECTED] wrote: I want to be able to do something like: myscript.py * -o outputfile and then have the shell expand the * as usual, perhaps to hundreds of filenames. But as far as I can see, getopt can only get one argument with each option. In

Re: Testing the availability of a module

2005-12-19 Thread Gerhard Häring
Bo Peng wrote: Dear list, Is there a better way than doing try: import aModule except: has_aModule = False else: has_aModule = True The main concern here is that loading aModule is unnecessary (and may take time). No, there is not really a better way. You *could* check

Re: coupling python scripts

2005-12-19 Thread Daniel Nogradi
Hi There!I created a few python scripts and everything is working fine. But to make it easier to run the procedure i want to couple these scripts inone big script. Is there a possibility to do this, can I for examplemake a script dat 'calls' the other script in the right order?Many thanks! Sander

Re: Testing the availability of a module

2005-12-19 Thread Thomas Heller
Gerhard Häring [EMAIL PROTECTED] writes: Bo Peng wrote: Dear list, Is there a better way than doing try: import aModule except: has_aModule = False else: has_aModule = True The main concern here is that loading aModule is unnecessary (and may take time). No, there is not

Re: Testing the availability of a module

2005-12-19 Thread Robert Kern
Gerhard Häring wrote: Bo Peng wrote: Dear list, Is there a better way than doing try: import aModule except: has_aModule = False else: has_aModule = True The main concern here is that loading aModule is unnecessary (and may take time). No, there is not really a better way.

Re: reading files

2005-12-19 Thread Steven D'Aprano
On Mon, 19 Dec 2005 02:47:22 -0800, Johhny wrote: Thanks for your assistance, Is it proper practice in python to flush any memory when you exit? for example Ive read the file into memory, when I close the file do I also have to flush any memory allocations ? You've done this: fileobject =

Re: Testing the availability of a module

2005-12-19 Thread Steven D'Aprano
On Mon, 19 Dec 2005 02:52:08 -0600, Bo Peng wrote: Dear list, Is there a better way than doing try: import aModule except: has_aModule = False else: has_aModule = True Do you mean to catch every possible exception when importing aModule? If you replace except: with except

canceling and joining threads

2005-12-19 Thread sir_alex
Hello everybody! I have a couple of questions about threads: the first is, is there the possibility to cancel a thread while it is executing (like the C function thread_cancel), for implementing something like an abort button? And the second is, i have a GUI in which there's a button that launches

wxGridCellEditor and EVT_CHAR

2005-12-19 Thread lux
Hi to all, I need to handle EVT_CHAR in a wxGrid when wxCellEditor is activated, but I don't know how. Can anyone help me? Thank's, Luca -- http://mail.python.org/mailman/listinfo/python-list

Re: coupling python scripts

2005-12-19 Thread Steven D'Aprano
On Mon, 19 Dec 2005 02:54:23 -0800, sandercaerteling wrote: Hi There! I created a few python scripts and everything is working fine. But to make it easier to run the procedure i want to couple these scripts in one big script. Is there a possibility to do this, can I for example make a

Re: getopt and options with multiple arguments

2005-12-19 Thread Steven D'Aprano
On Mon, 19 Dec 2005 02:29:41 -0800, [EMAIL PROTECTED] wrote: I want to be able to do something like: myscript.py * -o outputfile and then have the shell expand the * as usual, perhaps to hundreds of filenames. If you are calling this from most Linux and Unix shells, the shell will

Re: Proposal: Inline Import

2005-12-19 Thread en.karpachov
-- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing next/prev element while for looping

2005-12-19 Thread Peter Otten
Bengt Richter wrote:  def pcniter(seq, NULL=NotImplemented): ... seqiter = iter(seq) ... prev = curr = NULL ... try: next = seqiter.next() ... except StopIteration: return ... for item in seqiter: ... prev, curr, next = curr, next, item ... yield prev, 

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Bengt Richter
On 19 Dec 2005 00:27:48 -0800, [EMAIL PROTECTED] wrote: Steve Holden wrote: Kevin Yuan wrote: How to remove duplicated elements in a list? eg. [1,2,3,1,2,3,1,2,1,2,1,3] - [1,2,3]? Thanks!! list(set([1,2,3,1,2,3,1,2,1,2,1,3])) [1, 2, 3] Would this have the chance of changing the

Re: attach a pdf file to an email

2005-12-19 Thread Pelmen
here is my code for Excel outer = MIMEMultipart() outer['Subject'] = header.decode('cp1251').encode('koi8-r') outer['To'] = baseParam['mailto'] outer['From'] = baseParam['mailfrom'] outer.preamble = '' # To guarantee the message ends with a newline outer.epilogue = ''

Re: Can you pass functions as arguments?

2005-12-19 Thread Xavier Morel
[EMAIL PROTECTED] wrote: I want to calculate f(0) + f(1) + ...+ f(100) over some function f which I can change. So I would like to create a function taking f as argument giving back the sum. How do you do that in Python? Python functions (and classes, and modules) are first-class objects, so

Re: Can you pass functions as arguments?

2005-12-19 Thread Bengt Richter
On 18 Dec 2005 23:18:48 -0800, Paul Rubin http://[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: I want to calculate f(0) + f(1) + ...+ f(100) over some function f which I can change. So I would like to create a function taking f as argument giving back the sum. How do you do that in

Re: canceling and joining threads

2005-12-19 Thread Ove Svensson
sir_alex [EMAIL PROTECTED] writes: Hello everybody! I have a couple of questions about threads: the first is, is there the possibility to cancel a thread while it is executing (like the C function thread_cancel), for implementing something like an abort button? As far as I know, python

Re: Can you pass functions as arguments?

2005-12-19 Thread Paul Rubin
[EMAIL PROTECTED] (Bengt Richter) writes: or if the OP actually wants the specific function, def sum100a(f): return sum(imap(f, xrange(101))) ... sum100a(square) 338350 Similarly with generator comprehension, if I have the syntax right: def sum100c(f): return sum(f(i) for i in

Re: Can Python write foreign characters to the console?

2005-12-19 Thread Sibylle Koczian
Martin v. Löwis schrieb: Michel Claveau wrote: Hi! I have a problem, under win-XP, with this code : # -*- coding: cp-1252 -*- import sys print uMartin v. Löwis print € for Noël print u€ for Noël sys.exit() == Python a provoqué une erreur Am I the only one to have that? P.S. I never

Re: Wingide is a beautiful application

2005-12-19 Thread Claudio Grondi
BartlebyScrivener wrote: If you're on Windows XP why not try Xemacs? That's free and does syntax highlighting etc. Doesn't have a problem with large files and so on. rpd Installed: http://ftp.dk.xemacs.org/pub/emacs/xemacs/binaries/win32/InnoSetup/XEmacs%20Setup%2021.4.18-1.exe Requesting

Re: Enumeration idioms: Values from different enumerations

2005-12-19 Thread Ben Sizer
Steven D'Aprano wrote: On Fri, 16 Dec 2005 02:43:35 -0800, Ben Sizer wrote: Is it possible to make it have the following sort of behaviour? : ShirtSize.small == AppleSize.small True Okay, so I was wrong to say that nobody was seriously suggesting that sort of behaviour. I was working

Re: wxGridCellEditor and EVT_CHAR

2005-12-19 Thread Geoffrey Clements
lux [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi to all, I need to handle EVT_CHAR in a wxGrid when wxCellEditor is activated, but I don't know how. Can anyone help me? it's probably better to ask this on comp.soft-sys.wxwindows -- Geoff --

Re: XML and namespaces

2005-12-19 Thread and-google
Uche Ogbuji [EMAIL PROTECTED] wrote: Andrew Clover also suggested an overly-legalistic argument that current minidom behavior is not a bug. I stick by my language-law interpretation of spec. DOM 2 Core specifically disclaims any responsibility for namespace fixup and advises the application

Re: Columns and Rows in Excel

2005-12-19 Thread Gerard Flanagan
Anand wrote: Greetings, How can I find the number of active columns and rows used in an excel work sheet? What I mean is how can i find the last column and row or cell position, where the data is stored in an excel sheet? A code snippet would be of great help. Thanks for your

Re: Testing the availability of a module

2005-12-19 Thread Peter Hansen
Bo Peng wrote: Is there a better way than doing try: import aModule except: has_aModule = False else: has_aModule = True The main concern here is that loading aModule is unnecessary (and may take time). Loading a module does *not* take time after the first time. All it

Re: attach a pdf file to an email

2005-12-19 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hi, I am writing a simple program that sends emails with attachments. I could use MIMEImage for .png and then attach it to an MIMEMultipart object. But I couldn't or don't know how to attachment a .pdf or something else to my emails. I'm new to python, could

Re: canceling and joining threads

2005-12-19 Thread Antoon Pardon
Op 2005-12-19, sir_alex schreef [EMAIL PROTECTED]: Hello everybody! I have a couple of questions about threads: the first is, is there the possibility to cancel a thread while it is executing (like the C function thread_cancel), You can have one thread raise an exception in an other thread.

Re: reading files

2005-12-19 Thread Fuzzyman
Steven D'Aprano wrote: [snip..] (It is good practice to close the file as soon as you can, especially on platforms like Windows where open files can't be read by any other process.) Unfortuantely not the case - on windoze (XP SP2 at least) you can open a file in one process (for reading or

Re: Wingide is a beautiful application

2005-12-19 Thread BartlebyScrivener
Go to Options. Near the bottom, it will say Edit Init.File Click on it. Make an entry on a separate line near the top as follows (require 'python-mode) Then save the init file. When you open files with a .py extension xemacs should automatically go into python mode If you read the init.el

Re: Windows Services

2005-12-19 Thread Roger Upole
Active State's help file is missing parameters from some modules built using Swig. The .chm included with the SourceForge releases has complete parameter info. hth Roger Mondal [EMAIL PROTECTED] wrote: Hi, Every one please accept my thanks. I have stopped using Python IDLE.

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Alex Martelli
Brian van den Broek [EMAIL PROTECTED] wrote: ... orig_list = [3,1,2,3,1,2,3,1,2,1,2,1,3] new_list = list(set(orig_list)) new_list.sort(cmp= lambda x,y: cmp(orig_list.index(x), orig_list.index(y))) new_list [3, 1, 2] A better way to exploit exactly the same idea is to use:

Re: Constructing RFC2822 Message

2005-12-19 Thread Narendra
Thanks Steve, No I'm not using windows XP client. I'm using linux client and no firewall is there Thanks, Narendra -- http://mail.python.org/mailman/listinfo/python-list

Please i need a hand with writing a simple task.

2005-12-19 Thread Marian
Can you pleae help me with this task. I have really hard time with my textbook desolving this problem. The Task: Write a program that will create a text file, print the contents of the text file as you create the file. Read the contents of the fileafter it's been created, add a record and print

Re: Testing the availability of a module

2005-12-19 Thread Bo Peng
if the user happens to prefer the command line interface, why bother looking for a GUI ? sounds like you haven't really thought this through... here's an outline that matches your use case: if user wants command line: command line only else: if wxPython is

Re: Wingide is a beautiful application

2005-12-19 Thread Claudio Grondi
BartlebyScrivener wrote: Go to Options. Near the bottom, it will say Edit Init.File Click on it. Done. A completely new file was created. Make an entry on a separate line near the top as follows (require 'python-mode) Then save the init file. Have copy/pasted to it including braces

Re: settings network timeouts in python

2005-12-19 Thread Steve Holden
Narendra wrote: Hi All, I have a problem here. I'm connecting to some pop server.Here i need to set the network timeouts,since some times my program disconnecting from net at tht point of time I'm unable to connect to POP server. Can any one provide the solution for it. code; import

Re: reading files

2005-12-19 Thread Mike Meyer
Steven D'Aprano [EMAIL PROTECTED] writes: The text you read is still hanging around, waiting for you to use it. Once you are done with it, you might want to reclaim that memory used, especially if it is a 100MB text file: mytext = # re-bind the name 'mytext' to the empty string If you have

Re: Testing the availability of a module

2005-12-19 Thread Fredrik Lundh
Bo Peng wrote: here's an outline that matches your use case: if user wants command line: command line only else: if wxPython is available: prepare wx based GUI elif Tkinter is available: prepare tk based GUI else:

Re: Testing the availability of a module

2005-12-19 Thread Peter Otten
Bo Peng wrote: def GUI(): if options['cml']: cml() else: if imp.find_module('wx'): wxGUI() elif imp.find_module('Tkinter'): tkGUI() else: cml() On the other hand, I don't see how this is superior to an exception-based approach... def

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Brian van den Broek
Alex Martelli said unto the world upon 2005-12-19 10:48: Brian van den Broek [EMAIL PROTECTED] wrote: ... orig_list = [3,1,2,3,1,2,3,1,2,1,2,1,3] new_list = list(set(orig_list)) new_list.sort(cmp= lambda x,y: cmp(orig_list.index(x), orig_list.index(y))) new_list [3, 1, 2] A better

Re: debian and python--any potential pitfalls?

2005-12-19 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-19 00:36: Brian van den Broek wrote: snip I've tried solo and failed a few times to install various Linux distros on Intel x86 laptops. (The software modem was always the sticking point.) A recent acquaintance has volunteered to guide me

Re: hi, ive a new mail address (Away from my office until January 2)

2005-12-19 Thread Aaron Del Monte
Thank you for your e-mail. I am away from my office until Monday, January 2. I will respond to your e-mail when I return. Happy Holidays! Aaron * * * * * * * * * * * * * * * * * * * * * * * * * * * Aaron Del Monte Assistant Information Systems Analyst Webmaster, CDFG Marine Region Web Site

What is unique about Python?

2005-12-19 Thread gsteff
I'm a computer science student, and have recently been trying to convince the professor who teaches the programming language design course to consider mentioning scripting languages in the future. Along those lines, I've been trying to think of features of Python, and scripting languages in

Re: settings network timeouts in python

2005-12-19 Thread Narendra
Thanks Steve Itz working. Thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: Enumeration idioms: Values from different enumerations

2005-12-19 Thread eswald
Ben Finney wrote: Antoon Pardon wrote: I just downloaded your enum module for python [from the Cheeseshop] and played a bit with it. IMO some of the behaviour makes it less usefull. [...] I also think it would be more usefull if enums from different enumerations just tested unequal.

Re: Please i need a hand with writing a simple task.

2005-12-19 Thread Brian van den Broek
Marian said unto the world upon 2005-12-19 10:58: Can you pleae help me with this task. I have really hard time with my textbook desolving this problem. The Task: Write a program that will create a text file, print the contents of the text file as you create the file. Read the contents of the

valide html - Encoding/Decoding

2005-12-19 Thread rabby
hello world! how to get the string / + ( ) + \ + [ ] + : + äöü converted into valide html. decode(html) does not run :( thank you for help -- http://mail.python.org/mailman/listinfo/python-list

show in GUI stdout of a command

2005-12-19 Thread twigster
Hi, I need to display in real time the output of a command line tool in a GUI written so far with Tkinter and Pmw. I've got a command line tool that I want to integrate to a GUI. The parameters are set using the GUI and a button executes the command. The calc is long so I need to see how fast

understanding mod_python

2005-12-19 Thread PyPK
Hi I'm trying to learn mod python and need some one to explain how to do http redirection(302) with an example code -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I load python script into Html ??

2005-12-19 Thread PatPoul
Yes I register Python script. I see in your exemple that you use file extention pys. That was why my exemple does'nt work. Thanks ! Patrick Poulin -- http://mail.python.org/mailman/listinfo/python-list

Re: Wingide is a beautiful application

2005-12-19 Thread Tony Nelson
In article [EMAIL PROTECTED], [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ... I get the feeling that a ot of people working with heavy IDEs don't realize how capable vim/emacs are, so I'll give a brief rundown of what my Vim environment does for me. (I do Python web development)--if you

how to lock a file in ftp site

2005-12-19 Thread muttu2244
hi all am trying to write some information into the file, which is located in ftp, and this file can be updated by number of people, but if at all i download a file from the ftp to my local machine, update it and then upload it back to ftp, and at the same time if some one else downloads the same

Re: What is unique about Python?

2005-12-19 Thread Kent Johnson
gsteff wrote: I'm a computer science student, and have recently been trying to convince the professor who teaches the programming language design course to consider mentioning scripting languages in the future. Along those lines, I've been trying to think of features of Python, and scripting

this where I am so far !

2005-12-19 Thread Marian
Any one who have a clue how can I add and remove records from a list. if the record is dictionary type) This the program I am working on. I have no idea how can I remove and add some more courses ! import cPickle, shelve def write_file(): CIT101 = ["Academic Computer Skills"]

Re: Difference between ActivePython and Python.org

2005-12-19 Thread Peter A.Schott
Amen to this one. Found out this after struggling with no SSL module when trying to write some secure FTP and HTTPS code. Downloaded the version from Python.org and it worked like a champ. I believe you can get both and have no issues with the install, though. For my part, I decided to

Re: Testing the availability of a module

2005-12-19 Thread Erik Max Francis
Bo Peng wrote: Is there a better way than doing try: import aModule except: has_aModule = False else: has_aModule = True The main concern here is that loading aModule is unnecessary (and may take time). Yes. Specifically catch ImportError in your except clause. -- Erik

Re: What is unique about Python?

2005-12-19 Thread Luis M. Gonzalez
Perhaps you should ask yourself why you like Python first, and then you'll probably have an answer. I'd say that Python is all about productivity. You can get more done in less time and with fewer lines of code because it's more consice, flexible and expressive. It's also very clear, easy to

How to create linked list automatically

2005-12-19 Thread Shahriar Shamil Uulu
Hi All, i have this program, = class Node: def __init__(self,name=None,next=None): self.name=name self.next=next def __str__(self): return str(self.name) w=[] for i in range(10): node=Node(i)

Re: canceling and joining threads

2005-12-19 Thread sir_alex
1) no, i didn't; i'll go and read that function 2) well, the actual situation is: there's the main thread (the application itself) and then the second thread that i create with threading.Thread, in which i make some things; in this thread i call gtk.gdk to update a window with a progress bar... 3)

Re: how to lock a file in ftp site

2005-12-19 Thread billie
No, I think you have to manually set this policy directly on the ftp server. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create linked list automatically

2005-12-19 Thread Fredrik Lundh
Shahriar Shamil Uulu wrote: w=[] for i in range(10): node=Node(i) w.append(node) for i in range(10): a=w[i] if i+19: b=w[9] a.next=b I'm not sure what you're trying to do here, but I'm quite sure that this code doesn't do what you think it does. (hint:

Re: How to create linked list automatically

2005-12-19 Thread Simon Brunning
I haven't the time (or inclination) to sort out all your problems here, but one thing jumps out at me: On 12/19/05, Shahriar Shamil Uulu [EMAIL PROTECTED] wrote: class Node: def __init__(self,name=None,next=None): self.name=name self.next=next def __str__(self):

  1   2   >