Fifth Fredericksburg, VA ZPUG Meeting

2005-10-11 Thread Gary Poster
Please join us October 12, 7:30-9:00 PM, for the fifth meeting of the Fredericksburg, VA Zope and Python User Group (ZPUG). Learn about Python configuration of Asterisk, an open source VOIP! Free food! Rob Page, Zope Corporation CEO and President, will present a technical session on Asterisk

REMINDER: BayPIGgies: October 13, 7:30pm (IronPort)

2005-10-11 Thread Aahz
The next meeting of BayPIGgies will be Thurs, October 13 at 7:30pm at IronPort. Tim Thompson will describe and demonstrate the interaction between Burning Man and Python using two applications, Radio Free Quasar and Ergo. BayPIGgies meetings alternate between IronPort (San Bruno, California) and

Batteries Included?

2005-10-11 Thread Alex
One of the first things I wanted to do when I start learning Python was to produce a simple standalone application that I could distribute to my users (windows users). Python's moto is Batteries Included, but where are the batteries for making exe files and making an installer file? I had to

Let My Terminal Go

2005-10-11 Thread [EMAIL PROTECTED]
Hello, A user of my application points me to a behavior in gVim, the text editor, that I would like to implement in my application. When gVim is launched from a shell terminal, it completely frees the terminal. You can continue to use the terminal for whatever purpose you wish, including closing

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-11 Thread Eric Nieuwland
Dave Hansen wrote: And Basic, and Fortran, and Lisp, and just about any programming language you care to name, including python (if Condition: Affirmative else: Negative). Not to mention that the sequence is identical to execution order. It's just plain goofy to have to scan to the middle of

Re: how to capture key pressing

2005-10-11 Thread Tim Roberts
billie [EMAIL PROTECTED] wrote: Look at curses. I was searching for something portable on multiple platforms. Keyboard access is not portable. It is quite system-specific, even in C. Curses doesn't work on Windows. Sure it does. You can find curses implementations for Windows. However, it

Re: Let My Terminal Go

2005-10-11 Thread marduk
On Mon, 2005-10-10 at 22:58 -0700, [EMAIL PROTECTED] wrote: Hello, A user of my application points me to a behavior in gVim, the text editor, that I would like to implement in my application. When gVim is launched from a shell terminal, it completely frees the terminal. You can continue

Re: Batteries Included?

2005-10-11 Thread Sybren Stuvel
Alex enlightened us with: Python's moto is Batteries Included, but where are the batteries for making exe files and making an installer file? Those aren't batteries. Those are things you can do with the program, but are outside the programming language. Writing and distributing software is one

Re: Let My Terminal Go

2005-10-11 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: When gVim is launched from a shell terminal, it completely frees the terminal. [...] How do I implement this in my application written in python? Using fork() and by catching the HUP signal. Sybren -- The problem with the world is stupidity. Not saying

Re: Looking for info on Python's memory allocation

2005-10-11 Thread Sybren Stuvel
Steven D'Aprano enlightened us with: he says that every time you try to append to a list that is already full, Python doubles the size of the list. This wastes no more than 50% of the memory needed for that list, but has various advantages -- and I'm damned if I can remember exactly what those

Re: Send password over TCP connection

2005-10-11 Thread Laszlo Zsolt Nagy
dcrespo wrote: ¡Beautiful and elegant solution! Two copies of the password: one on the client, the other on the server. 1. Client wants to connect 2. Server generates a random_alphanumeric_string and sends it to the client 3. Both Client and Server creates a hash string from

Re: Batteries Included?

2005-10-11 Thread Mike Meyer
Alex [EMAIL PROTECTED] writes: One of the first things I wanted to do when I start learning Python was to produce a simple standalone application that I could distribute to my users (windows users). Python's moto is Batteries Included, but where are the batteries for making exe files and

Re: Send password over TCP connection

2005-10-11 Thread Laszlo Zsolt Nagy
Ignoring all the other issues, any solution which actually requires the password to be stored on the server is a bad solution. Administrators should not have access to user passwords, and in addition users should not be put in the position of having to trust your server-side security to keep

Re: Batteries Included?

2005-10-11 Thread Paul Rubin
Sybren Stuvel [EMAIL PROTECTED] writes: I might be wrong expecting that a language whose moto is Batteries Included would be able to produce exe files. Indeed, you're wrong. Why would such an ability be included in Python? distutils.exe, included in Python, in fact does have the ability to

Re: Let My Terminal Go

2005-10-11 Thread Mike Meyer
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: Hello, A user of my application points me to a behavior in gVim, the text editor, that I would like to implement in my application. When gVim is launched from a shell terminal, it completely frees the terminal. You can continue to use the

Re: Batteries Included?

2005-10-11 Thread Michele Simionato
Mike Meyer: After you create a setup.py file for you program, doing python setup.py bdist --formats=wininst should do the trick. Of course, I don't own a Windows box, so I can't check it, but when I ask a setup file for help on formats, it tells me the wininst format is a windows

Re: Send password over TCP connection

2005-10-11 Thread Laszlo Zsolt Nagy
If you really want to do it right, use SRP, http://srp.stanford.edu. This is a bit offtopic here. I read the RFC and I do not see why SRP is not vulnerable to dictionary attacks. If I have a working client software then I can use it to reveal passwords. Isn't it a dictionary attack? Can you

LINDA WEST (925) 876-7441 of CHIPMAN UNITED VAN LINES likes to commit Fraud Forgery and she likes to put peoples names on moving contracts with out there Knowledge.Caton Mayflower Moving Storage D

2005-10-11 Thread Vulvazb
LINDA WEST (925) 876-7441 of CHIPMAN UNITED VAN LINES likes to commit Fraud Forgery and she likes to put peoples names on moving contracts with out there Knowledge.Caton Mayflower Moving Storage Dublin,ca concord,ca (925) 876-7441, 925-887-5515, 925-825-5000, 800-825-3866,800-447-9771,

Re: Batteries Included?

2005-10-11 Thread Marco Aschwanden
I might be wrong expecting that a language whose moto is Batteries Included would be able to produce exe files. Are there plans to do this in the future version of Python? Yes, you are wrong expecting that. Creating an exe-cutable is windows specific and python _tries_ to be platform

Re: Send password over TCP connection

2005-10-11 Thread Paul Rubin
Laszlo Zsolt Nagy [EMAIL PROTECTED] writes: This is a bit offtopic here. I read the RFC and I do not see why SRP is not vulnerable to dictionary attacks. If I have a working client software then I can use it to reveal passwords. Isn't it a dictionary attack? Dictionary attack in this context

Re: Question about StringIO

2005-10-11 Thread Frank Millman
Benjamin Niemann wrote: Frank Millman wrote: I will try to explain my experience with popen() briefly. I run through all the scripts and create a StringIO object with the string I want to pass. It is about 250 000 bytes long. If I run psql using popen(), and pass it the string via

Re: Question about StringIO

2005-10-11 Thread Frank Millman
Diez B. Roggisch wrote: Thanks, Steve and Diez, for the replies. I didn't think it was possible, but it was worth asking :-) I will try to explain my experience with popen() briefly. I have some sql scripts to create tables, indexes, procedures, etc. At present there are about 50

Re: Let My Terminal Go

2005-10-11 Thread en.karpachov
On 10 Oct 2005 22:58:08 -0700 [EMAIL PROTECTED] wrote: How do I implement this in my application written in python? Google for python daemonize. -- jk -- http://mail.python.org/mailman/listinfo/python-list

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-11 Thread Antoon Pardon
Op 2005-10-10, Terry Hancock schreef [EMAIL PROTECTED]: On Sunday 09 October 2005 07:50 am, phil hunt wrote: On Fri, 7 Oct 2005 01:05:12 -0500, Terry Hancock [EMAIL PROTECTED] wrote: GvR's syntax has the advantage of making grammatical sense in English (i.e. reading it as written pretty much

mod_python

2005-10-11 Thread Python_it
Today I was busy to install mod_python. I have put the line LoadModule python_module libexec/mod_python.so into the httpd.conf file. It Works! Apache load mod_python /3.2.2.b Python2.4 But my problem is where I have to place te following code in de httpd.conf? Directory C:\Program

Re: Send password over TCP connection

2005-10-11 Thread Laszlo Zsolt Nagy
Paul Rubin wrote: Laszlo Zsolt Nagy [EMAIL PROTECTED] writes: This is a bit offtopic here. I read the RFC and I do not see why SRP is not vulnerable to dictionary attacks. If I have a working client software then I can use it to reveal passwords. Isn't it a dictionary attack?

Re: mod_python

2005-10-11 Thread deelan
Python_it wrote: (...) But my problem is where I have to place te following code in de httpd.conf? Directory C:\Program Files\Apache Group\Apache2\htdocs\project\ AddHandler mod_python .py PythonHandler mptest PythonDebug On /Directory Because al the

Re: Question about StringIO

2005-10-11 Thread Diez B. Roggisch
Thanks for this pointer. I have read it, but I don't think it applies to my situation, as it talks about 'reading' from the child's stdout while the child is 'writing' to stderr. But that is exactly the point: the psql blocks because you don't read away the buffered data. Start a thread, read

SOAPpy, WSDL, non-standard types and my graying hair

2005-10-11 Thread Miki Tebeka
Hello, I'm trying to use SOAPpy with WSDL (talking to http://www.seapine.com/ttpro.html). proxy.show_methods for getRecordListForTable is: Method Name: getRecordListForTable In #0: cookie ((u'http://www.w3.org/2001/XMLSchema', u'long')) In #1: tablename

Re: Question about StringIO

2005-10-11 Thread Diez B. Roggisch
My scripts are used to create the tables in the database. I didn't think that DB-API covered that. The DB-Api covers executin arbirary SQL - either DDL or DML. It is surely centered around DML, but that doesn't mean that its not usabel to issue create ... statements. However, even if it

Re: mod_python

2005-10-11 Thread Python_it
Thanks for your replay. I put the handler code at the end of the file. No error! But if I go to my localhost\project\mptest.py The code of my function appears. I solve this by put the following code in the confige file: Directory .. AllowOverride FileInfo /Directory --

Re: Question about StringIO

2005-10-11 Thread Frank Millman
Diez B. Roggisch wrote: Thanks for this pointer. I have read it, but I don't think it applies to my situation, as it talks about 'reading' from the child's stdout while the child is 'writing' to stderr. But that is exactly the point: the psql blocks because you don't read away the

Re: Looking for info on Python's memory allocation

2005-10-11 Thread Lasse Vågsæther Karlsen
Sybren Stuvel wrote: Steven D'Aprano enlightened us with: he says that every time you try to append to a list that is already full, Python doubles the size of the list. This wastes no more than snip If, on the other hand, you double the memory every time you run out, you have to copy much

Re: Learning Python

2005-10-11 Thread Chris Dewin
On Mon, 10 Oct 2005 17:20:35 +, dannypatterso wrote: [snip] I'm a hobby programmer using mostly BASIC(s) and some Java. I know procedural programming and I know what encapsulation, inheritance and polymorphism are but I have very little experience in using them as I've written just a

Re: Question about StringIO

2005-10-11 Thread Frank Millman
Diez B. Roggisch wrote: My scripts are used to create the tables in the database. I didn't think that DB-API covered that. The DB-Api covers executin arbirary SQL - either DDL or DML. It is surely centered around DML, but that doesn't mean that its not usabel to issue create ...

A faster shutil.rmtree or maybe a command.

2005-10-11 Thread martijn
H! Sometimes I must delete 2 very big directory's. The directory's have a very large tree with much small file's in it. So I use shutil.rmtree() But its to slow. Is there a faster method ? I use FreeBsd 5.4. --- is it maybe faster to walking in the directy en delete each file? Thanks,

Re: Learning Python

2005-10-11 Thread Paul Rubin
Chris Dewin [EMAIL PROTECTED] writes: There was an excellent such primer on devshed, by Icarus, but they appear to have taken it down. I saved a copy of it to my HD. Would there be anything morally, or legally wrong with me uploading it to my site? A little googling shows it's still up at:

Re: A faster shutil.rmtree or maybe a command.

2005-10-11 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: Sometimes I must delete 2 very big directory's. The directory's have a very large tree with much small file's in it. So I use shutil.rmtree() But its to slow. Is there a faster method ? Is os.system(rm -rf %s % directory_name) much faster? -- Giovanni Bajo --

A problem while using urllib

2005-10-11 Thread Johnny Lee
Hi, I was using urllib to grab urls from web. here is the work flow of my program: 1. Get base url and max number of urls from user 2. Call filter to validate the base url 3. Read the source of the base url and grab all the urls from href property of a tag 4. Call filter to validate every url

Idle bytecode query on apparently unreachable returns

2005-10-11 Thread sxanth
What puzzles me, though, are bytecodes 17, 39 and 42 - surely these aren't reachable? Does the compiler just throw in a default 'return None' epilogue, with routes there from every code path, even when it's not needed? If so, why? Hi. pyc (http://freshmeat.net/projects/pyc) can already remove

Re: Batteries Included?

2005-10-11 Thread en.karpachov
On 11 Oct 2005 00:10:01 -0700 Paul Rubin wrote: Personally I think including a .exe packager in Python would be a great idea. As a Linux user I can't easily run Windows-specific utilities like Inno Setup. So I don't have a good way to make .exe's from my Python code that Windows users can

Re: A faster shutil.rmtree or maybe a command.

2005-10-11 Thread martijn
A little. I think its yust to big to handle it. I'm going to ask it in a freebsd forum, maybe they know how to speed up. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python

2005-10-11 Thread Peter
deelan wrote: Python_it wrote: (...) But my problem is where I have to place te following code in de httpd.conf? Directory C:\Program Files\Apache Group\Apache2\htdocs\project\ AddHandler mod_python .py PythonHandler mptest PythonDebug On /Directory Because

strange import error with Python-2.4.1

2005-10-11 Thread Robin Becker
Whilst testing the excellent xlrd http://www.python.org/pypi/xlrd/0.3a1 I came across the following strangeness when trying to add an import of os to assist with debugging/tracing. At line 66 I replaced import sys with import sys, os and then ran python runxlrd.py --help and got this error

Re: Looking for info on Python's memory allocation

2005-10-11 Thread Peter Otten
Lasse Vågsæther Karlsen wrote: If I have a generator or other iterable producing a vast number of items, and use it like this: s = [k for k in iterable] if I know beforehand how many items iterable would possibly yield, would a construct like this be faster and use less memory? s =

Re: Batteries Included?

2005-10-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: Because you can't run it yourself? If you cannot run the freshly-made exe yourself, why would you want to distrubute it, without even trying? But if you can, then you can run the InnoSetup as well. Obviously I'd want someone to test the .exe before putting it in wide

Re: Let My Terminal Go

2005-10-11 Thread Mystilleef
Hello, Thank you. That's all I needed. For some reason, I had always assumed forking was an expensive process. I guess I was ill-informed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Let My Terminal Go

2005-10-11 Thread Mystilleef
Hello, Thanks to all the responders and helpers on the group. I'm learning everyday. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: strange import error with Python-2.4.1

2005-10-11 Thread Steve Holden
Robin Becker wrote: Whilst testing the excellent xlrd http://www.python.org/pypi/xlrd/0.3a1 I came across the following strangeness when trying to add an import of os to assist with debugging/tracing. At line 66 I replaced import sys with import sys, os and then ran python

Re: strange import error with Python-2.4.1

2005-10-11 Thread Fredrik Lundh
Steve Holden wrote: Can I ask if you are specifying a source encoding in your file with a pragma (?) like # -*- coding: iso-8859-15 -*- I've noticed what appear to be spurious syntax errors from time to time on such files, and have been attempting to debug the problem for some time

Re: strange import error with Python-2.4.1

2005-10-11 Thread Richard Brodie
Robin Becker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This behaviour doesn't occur with 2.4.2 or 2.4 only with 2.4.1. I looked for some bug fix in the recently released 2.4.2 that related, but couldn't find anything obvious. One of the various codecs fixes, I think. Bug

Re: Idle bytecode query on apparently unreachable returns

2005-10-11 Thread Raymond Hettinger
[Tom Anderson]: What puzzles me, though, are bytecodes 17, 39 and 42 - surely these aren't reachable? Does the compiler just throw in a default 'return None' epilogue, with routes there from every code path, even when it's not needed? If so, why? Since unreachable code is never executed,

Re: Python's Performance

2005-10-11 Thread Peter Hansen
Steve Holden wrote: And we definitely need agile in there. Bugger, I'll go out and come in again ... Used in the same breath as the word bugger, I'm not sure the phrase go out and come in again is entirely appropriate for a family forum. ;-) But I'm also not sure I ought to post that to the

Re: Merging sorted lists/iterators/generators into one stream of values...

2005-10-11 Thread Lasse Vågsæther Karlsen
snip Another idea for this method would be that in some cases I noticed that it was useful to know which source each element would come from as well, as well as removing duplicates from the results. For instance s1 = [1, 3, 5, 7] s2 = [2, 3, 4] for k, s in merge_by_sort(s1, s2): print

Re: Send password over TCP connection

2005-10-11 Thread Peter Hansen
Laszlo Zsolt Nagy wrote: Peter Hansen wrote: Ignoring all the other issues, any solution which actually requires the password to be stored on the server is a bad solution. Administrators should not have access to user passwords, and in addition users should not be put in the position of

Re: Python's Performance

2005-10-11 Thread Peter Hansen
Peter Hansen wrote: But I'm also not sure I ought to post that to the group, so I'll spare them and just inflict the thought on you! Or, maybe I'll just fail to trim the newsgroup line and accidentally post to the group anyway. Yes, that's just what I'll do. Sorry folks. :-) -Peter --

Re: strange import error with Python-2.4.1

2005-10-11 Thread Steve Holden
Fredrik Lundh wrote: Steve Holden wrote: Can I ask if you are specifying a source encoding in your file with a pragma (?) like # -*- coding: iso-8859-15 -*- I've noticed what appear to be spurious syntax errors from time to time on such files, and have been attempting to debug the problem

Re: subprocess and non-blocking IO (again)

2005-10-11 Thread Nick Craig-Wood
Marc Carter [EMAIL PROTECTED] wrote: import subprocess,select,sys speakers=[] lProc=[] for machine in ['box1','box2','box3']: p = subprocess.Popen( ('echo '+machine+';sleep 2;echo goodbye;sleep 2;echo cruel;sleep 2;echo world'), stdout=subprocess.PIPE,

Re: subprocess and non-blocking IO (again)

2005-10-11 Thread Marc Carter
Donn Cave wrote: If you want to use select(), don't use the fileobject functions. Use os.read() to read data from the pipe's file descriptor (p.stdout.fileno().) This is how you avoid the buffering. Thankyou, this works perfectly. I figured it would be something simple. Marc --

How to do *args, **kwargs properly

2005-10-11 Thread Lasse Vågsæther Karlsen
I must be missing something but what is the proper way to do a function using such arguments ? Specifically I'm looking for: - ability to take an unspecified number of positional arguments - ability to take optional named arguments that follows the first arguments - raise appropriate errors if

Re: A problem while using urllib

2005-10-11 Thread Alex Martelli
Johnny Lee [EMAIL PROTECTED] wrote: ... try: webPage = urllib2.urlopen(url) except urllib2.URLError: ... webPage.close() return True But every time when I ran to the 70 to 75 urls (that means 70-75 urls have

Re: How to do *args, **kwargs properly

2005-10-11 Thread Paul Rubin
Lasse Vågsæther Karlsen [EMAIL PROTECTED] writes: or is the proper python way simply this: def fn(*values, **options): if cmp in options: comparison = options[cmp] else: comparison = cmp # rest of function here and thus ignoring the wrong parameter names? I don't know

Re: How to do *args, **kwargs properly

2005-10-11 Thread Alex Martelli
Lasse Vågsæther Karlsen [EMAIL PROTECTED] wrote: ... fn(1, 2, 3) fn(1, 2, 3, cmp=lambda x, y: y-x) fn(1, 2, 3, cpm=lambda x, y: y-x) # TypeError on this I assume these are your specs. or is the proper python way simply this: def fn(*values, **options): if cmp in options:

Re: Wanted: Python module allowing direct access to raw sectors ofharddrives (MFT, boot sector, etc.) in MS Windows

2005-10-11 Thread Claudio Grondi
Thank you for your reply, even if currently not that interesting for me because after the first CD writer for IDE were available I stopped to use SCSI and didn't come back to it since then. Does the Python open() command not work the same way for SCSI drives as for IDE or USB drives (I can't try

Re: Let My Terminal Go

2005-10-11 Thread Ivan Voras
Mike Meyer wrote: The easy way to do all these things - from C, anyway - is with daemon(3). That isn't wrapped as part of the Python library. The easiest way to solve your problem may be write a wrapper for that call. If daemon exists on enough systems, submitting your wrapper as a patch to

XMS .NET: IBM Message Service Client for .NET Beta

2005-10-11 Thread rungta
IronPython and Boo developers may find this interesting: The second refresh of the IBM Message Service Client for .NET Beta is now available: http://www14.software.ibm.com/webapp/download/search.jsp?go=yrs=message The key enhancements in this refresh are: - The supported messaging environments

Re: How to do *args, **kwargs properly

2005-10-11 Thread Max M
Lasse Vågsæther Karlsen wrote: I must be missing something but what is the proper way to do a function using such arguments ? - ability to take an unspecified number of positional arguments You should probably pass a sequence to the method instead. You can do it the other way, but it's poor

datetime and daylight savings problem

2005-10-11 Thread James
I need to import a bunch of data into our database for which there's a single entry each day which occurs at the same time every day in local time - so I need to convert this to UTC taking into account local daylight savings. However daylight savings just don't seem to be working at all... Python

Re: How to do *args, **kwargs properly

2005-10-11 Thread Lasse Vågsæther Karlsen
Max M wrote: Lasse Vågsæther Karlsen wrote: I must be missing something but what is the proper way to do a function using such arguments ? - ability to take an unspecified number of positional arguments You should probably pass a sequence to the method instead. You can do it the

Re: Comparing lists

2005-10-11 Thread Scott David Daniels
Christian Stapfer wrote: Steve Holden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Christian Stapfer wrote: George Sakkis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Christian Stapfer [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: try to use set. A

Re: Send password over TCP connection

2005-10-11 Thread dcrespo
then, what you proppose? -- http://mail.python.org/mailman/listinfo/python-list

Python Doc Problem Example: sort() (reprise)

2005-10-11 Thread Xah Lee
Python Doc Problem Example: sort() Xah Lee, 200503 Exhibit: Incompletion Imprecision Python doc “3.6.4 Mutable Sequence Types” at http://python.org/doc/2.4/lib/typesseq-mutable.html in which contains the documentation of the “sort” method of a list. Quote: « Operation Result Notes

Where is the error

2005-10-11 Thread enas khalil
hello, when i run the following code to Read and tokenize data from a tagged text as follows : from nltk.corpus import brownfrom nltk.tagger import TaggedTokenizerfrom nltk.tokenizer import *tagged_txt_str=open('corpus.txt'

Re: Function decorator that caches function results

2005-10-11 Thread Piet van Oostrum
Paul Rubin http://[EMAIL PROTECTED] (PR) wrote: PR Tom Anderson [EMAIL PROTECTED] writes: PR That's misleading, I'd say a closure is a combination of a function PR (executable code) and a lexical environment [snip] PR This is all described in SICP (mitpress.mit.edu/sicp). Where the word

python server?

2005-10-11 Thread Francesco Marchetti-Stasi
Hello everybody, I am the happy yet unsatisfied owner of an ipaq 3760. I am writing a python+pygtk editor optimized for an handheld, and in the future I'd like to write more applications (to-do-list and agenda are on top of my priorities, since the existing ones don't fit my needs). I was now

RE: WMI - Restore Setting in Python

2005-10-11 Thread Tim Golden
[saw huan chng] I am beginner in Python. I have some questions on WMI Service in Python. I was able to use properties of Class Restore in WMI, but not able to use the method. Here is the sample code that I done, anyone can help me? [... snip code ...] OK, I don't actually use XP (and the

Re: Python's Performance

2005-10-11 Thread Piet van Oostrum
Terry Hancock [EMAIL PROTECTED] (TH) wrote: TH He's got to be talking about runtime name-binding. In TH other words, when you refer to: TH a.spam TH the Python interpreter actually knows you labeled that attribute 'spam', TH and the string is stored in a.__dict__ , so you can also access it

Re: Function decorator that caches function results

2005-10-11 Thread Fredrik Lundh
Tom Anderson wrote: Okay, a crack at a definition: a closure is a function in which some of the variable names refer to variables outside the function. And i don't mean global variables - i mean somebody else's locals; call them 'remote variables'. in Python, the global variables are someone

win32com, generating the cache programaticaly?

2005-10-11 Thread Andrew Markebo
Hello! I am messing around with communicating between LabVIEW and Python, got it to work by a small 'fix' (grabbing the generated file, and importing it by hand) What I might want to do, is to automatically generate the data done by executing makepy.py and run by it. What I select in makepy.py

Re: Learning Python

2005-10-11 Thread Paul DiRezze
These are all great suggestions. Thanks to all who replied. paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Merging sorted lists/iterators/generators into one stream of values...

2005-10-11 Thread Lasse Vågsæther Karlsen
Lasse Vågsæther Karlsen wrote: snip Another idea for this method would be that in some cases I noticed that it was useful to know which source each element would come from as well, as well as removing duplicates from the results. snip The removing duplicates problem would probably be

Re: How to do *args, **kwargs properly

2005-10-11 Thread George Sakkis
Lasse Vågsæther Karlsen [EMAIL PROTECTED] wrote: So what you're saying is that instead of: def fn(*values, **options): I should use: def fn(values, cmp=cmp): in this specific case? and then instead of: fn(1, 2, 3, cmp=...) this: fn([1, 2, 3], cmp=...) snip I think I'll

Re: Python's Performance

2005-10-11 Thread Steven D'Aprano
On Mon, 10 Oct 2005 16:47:35 -0700, Paul Boddie wrote: The difficulty is that the target architecture in not realized in hardware. Or isn't perhaps feasible/viable for hardware realisation: one of the EuroPython speakers dangled the promise of hardware support for high-level languages (the

Re: How to do *args, **kwargs properly

2005-10-11 Thread Lasse Vågsæther Karlsen
George Sakkis wrote: Lasse Vågsæther Karlsen [EMAIL PROTECTED] wrote: snip I think I'll re-write to use a list instead Actually in most cases you don't need to assume it's a list; any iterable is usually good enough. You can always turn it into a list (or a tuple or a set or..) in the

REMINDER: BayPIGgies: October 13, 7:30pm (IronPort)

2005-10-11 Thread Aahz
The next meeting of BayPIGgies will be Thurs, October 13 at 7:30pm at IronPort. Tim Thompson will describe and demonstrate the interaction between Burning Man and Python using two applications, Radio Free Quasar and Ergo. BayPIGgies meetings alternate between IronPort (San Bruno, California) and

Re: Learning Python

2005-10-11 Thread Steven D'Aprano
On Tue, 11 Oct 2005 18:26:58 +0900, Chris Dewin wrote: On Mon, 10 Oct 2005 17:20:35 +, dannypatterso wrote: [snip] I'm a hobby programmer using mostly BASIC(s) and some Java. I know procedural programming and I know what encapsulation, inheritance and polymorphism are but I have

Re: Merging sorted lists/iterators/generators into one stream of values...

2005-10-11 Thread George Sakkis
Function name is perhaps not the best one. It occurs to me that this is the GROUP BY in SQL so perhaps a different name is better, but then again this might be moot if such a already exists somewhere :) Amazing, you keep reinventing things, even with the exact same name :) from itertools

Re: Python's Performance

2005-10-11 Thread Charles Krug
On Mon, 10 Oct 2005 11:21:18 -0700, Donn Cave [EMAIL PROTECTED] wrote: Iron- Python). is it still an interpreter if it generates machine code? Is what an interpreter? I am not very well acquainted with these technologies, but it sounds like variations on the implementation of an

Re: Merging sorted lists/iterators/generators into one stream of values...

2005-10-11 Thread Lasse Vågsæther Karlsen
George Sakkis wrote: Function name is perhaps not the best one. It occurs to me that this is the GROUP BY in SQL so perhaps a different name is better, but then again this might be moot if such a already exists somewhere :) Amazing, you keep reinventing things, even with the exact same name

Re: When someone from Britain speaks, Americans hear a British accent...

2005-10-11 Thread Charles Krug
On Mon, 10 Oct 2005 15:46:34 -0500, Terry Hancock [EMAIL PROTECTED] wrote: On Saturday 08 October 2005 04:35 am, Steve Holden wrote: I must have been working at NASA at the time; they are well known for embiggening prices. Not nearly as much as the DoD, from what I hear. Truthfully, I

HELP: Searching File Manager written in Python

2005-10-11 Thread anton
Hi, I am googeling some hours now ... still without result. So I have a question: Does somebody know a filemanager: - which looks like Norton Commander/7-Zip Filemanager - where I can add python scripts which I can execute on a selected file I already looked at wxpyatol but its not

Can module access global from __main__?

2005-10-11 Thread Neal Becker
Suppose I have a main program, e.g., A.py. In A.py we have: X = 2 import B Now B is a module B.py. In B, how can we access the value of X? -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for info on Python's memory allocation

2005-10-11 Thread Steven D'Aprano
On Tue, 11 Oct 2005 11:22:39 +0200, Lasse Vågsæther Karlsen wrote: This begs a different question along the same lines. Er, no it doesn't. Begs the question does _not_ mean asks the question or suggests the question. It means assumes the truth of that which needs to be proven.

Re: date reformatting

2005-10-11 Thread Magnus Lycka
Bell, Kevin wrote: Anyone aware of existing code to turn a date string 8-15-05 into the number 20050815? import datetime s = 8-15-05 month,day,year = map(int, s.split('-')) date = datetime.date(2000+year,month,day) date.strftime('%Y%m%d') '20050815' Of course, if you really want the

Re: How to do *args, **kwargs properly

2005-10-11 Thread Max M
Lasse Vågsæther Karlsen wrote: Max M wrote: So what you're saying is that instead of: def fn(*values, **options): I should use: def fn(values, cmp=cmp): in this specific case? and then instead of: fn(1, 2, 3, cmp=...) this: fn([1, 2, 3], cmp=...) Precisely. Sometimes

Re: strange import error with Python-2.4.1

2005-10-11 Thread Robin Becker
Fredrik Lundh wrote: Steve Holden wrote: Can I ask if you are specifying a source encoding in your file with a pragma (?) like # -*- coding: iso-8859-15 -*- I've noticed what appear to be spurious syntax errors from time to time on such files, and have been attempting to debug the problem

how to(can we ?) pass argument to .py script ?

2005-10-11 Thread quiteblack
howdy~ i wrote a .py file and it works fine, my goal is to pass argument to that py file when it get executed, and accept that argument within py file, eg. i prefer a command like below: python test.py -t and then, i may get -t within test.py for later use. i have no ideas how to do and i'm

ANN: Kamaelia 0.3.0 released!

2005-10-11 Thread Michael Sparks
Kamaelia 0.3.0 has been released! Introduction Kamaelia is a networking/communications infrastructure for innovative multimedia systems. Kamaelia uses a component architecture designed to simplify creation and testing of new protocols and large scale media delivery systems. A subset

Re: Can module access global from __main__?

2005-10-11 Thread Steve Holden
Neal Becker wrote: Suppose I have a main program, e.g., A.py. In A.py we have: X = 2 import B Now B is a module B.py. In B, how can we access the value of X? Without trying in any way to dodge the question, why do you want to do that? There's a property of software called coupling

Re: how to(can we ?) pass argument to .py script ?

2005-10-11 Thread Simon Brunning
On 11 Oct 2005 07:07:44 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: i wrote a .py file and it works fine, my goal is to pass argument to that py file when it get executed, and accept that argument within py file, eg. i prefer a command like below: python test.py -t and then, i may get

  1   2   3   >