Re: list/dictionary as case statement ?

2007-01-02 Thread Hendrik van Rooyen
"Stef Mientki" <[EMAIL PROTECTED]> wrote: > > If I'm not mistaken, I read somewhere that you can use > function-names/references in lists and/or dictionaries, but now I can't > find it anymore. > > The idea is to build a simulator for some kind of micro controller (just > as a general practis

Re: Iterate through list two items at a time

2007-01-02 Thread Gerard Flanagan
Dave Dean wrote: > Hi all, > I'm looking for a way to iterate through a list, two (or more) items at a > time. Basically... > > myList = [1,2,3,4,5,6] > > I'd like to be able to pull out two items at a time - simple examples would > be: > Create this output: > 1 2 > 3 4 > 5 6 > > Create this

Re: A question about unicode() function

2007-01-02 Thread JTree
hi, I just removed the unicode() method from my codes. As John Machin said, I had an wrong understanding of unicode and ascii. Paul Watson wrote: > JTree wrote: > > Thanks everyone! > > > > Sorry for my ambiguous question. > > I changed the codes and now it works fine. > > > > > > > > JTree wrote:

Synchronization methodology

2007-01-02 Thread Chris Ashurst
Hi, I'm coming in from a despised Java background, and I'm having some trouble wrapping my head around sharing an object between multiple instances of a single class (in simpler terms, I would say imagine a simple chat server that has to share a list of connected users to each instance of a con

Re: Iterate through list two items at a time

2007-01-02 Thread Dave Dean
Thanks for all the fast responses. I'm particularly a fan of the zip method, followed closely by the xrange example. All, of course, are a lot of help! Thanks, Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for python SIP/MGCP stacks

2007-01-02 Thread Anthony Baxter
On 1/3/07, Jenny Zhao (zhzhao) <[EMAIL PROTECTED]> wrote: > Thanks Anthony. > > I am wondering where I can get Divmod Sine and Shtoom. Are they open > source ? > > Thanks again > Jenny http://www.google.com/search?q=divmod+sine http://www.google.com/search?q=shtoom -- http://mail.python.org/mailm

Re: Iterate through list two items at a time

2007-01-02 Thread Jeffrey Froman
Dave Dean wrote: > I'm looking for a way to iterate through a list, two (or more) items at a > time. Here's a solution, from the iterools documentation. It may not be the /most/ beautiful, but it is short, and scales well for larger groupings: >>> from itertools import izip >>> def groupn(itera

Re: Iterate through list two items at a time

2007-01-02 Thread Gabriel Genellina
At Tuesday 2/1/2007 22:57, Dave Dean wrote: myList = [1,2,3,4,5,6] I'd like to be able to pull out two items at a time - simple examples would be: Create this output: 1 2 3 4 5 6 b=iter(a) for x in b: y=b.next() print x,y b=iter(a) for x,y in ((item, b.next()) for item in b): prin

Re: Iterate through list two items at a time

2007-01-02 Thread skip
>> I'm looking for a way to iterate through a list, two (or more) items >> at a time. Basically... >> >> myList = [1,2,3,4,5,6] >> >> I'd like to be able to pull out two items at a time... Dan> def pair_list(list_): Dan> return [list_[i:i+2] for i in xrange(

Re: Iterate through list two items at a time

2007-01-02 Thread bearophileHUGS
Few alternative solutions (other are possible), I usually use a variant of the first version, inside a partition function, the second variant is shorter when you don't have a handy partition() function and you don't want to import modules, and the forth one needs less memory when the data is very l

Re: Iterate through list two items at a time

2007-01-02 Thread Dan Bishop
On Jan 2, 7:57 pm, "Dave Dean" <[EMAIL PROTECTED]> wrote: > Hi all, > I'm looking for a way to iterate through a list, two (or more) items at a > time. Basically... > > myList = [1,2,3,4,5,6] > > I'd like to be able to pull out two items at a time... def pair_list(list_): return [list_[i:

Re: Writing more efficient code

2007-01-02 Thread bearophileHUGS
Jon Harrop: > I think this sort of functionality would be a welcome addition to Python. I don't know. > Perhaps it can be written in Python? Pyparsing and beautifulsoup show that practically useful parsing modules can be done using Python alone too. Set module of Python 2.3, translated to C in

Iterate through list two items at a time

2007-01-02 Thread Dave Dean
Hi all, I'm looking for a way to iterate through a list, two (or more) items at a time. Basically... myList = [1,2,3,4,5,6] I'd like to be able to pull out two items at a time - simple examples would be: Create this output: 1 2 3 4 5 6 Create this list: [(1,2), (3,4), (5,6)] I want the f

Re: Writing more efficient code

2007-01-02 Thread Jon Harrop
[EMAIL PROTECTED] wrote: > Jon Harrop: >> I think most people could pick up the core ideas in a day and start >> writing working programs. > > Probably I am not that intelligent, I probably need some months :-) But > that language has many good sides, and one day I'll probably try to > learn it a

Re: DOS, UNIX and tabs

2007-01-02 Thread Tom Plunket
Peter Decker wrote: > > Maybe I'm also weird, but I use a variable-pitch font when programming > > in Python. So a "tab equals some number of spaces" really isn't useful > > to me. My setup is, "tab equals this much space". > > A year ago I would have thought you were weird, but after reading a

Re: Writing more efficient code

2007-01-02 Thread Jon Harrop
Beliavsky wrote: > If in the newsgroup comp.lang.x somone asks how to do y, and you > suggest using language z, without answering their question, which was > how to do it in x, you will likely just annoy people and perhaps make > it even less likely that they will try z. Pattern matching isn't a l

Filename encoding on XP

2007-01-02 Thread kent sin
What encoding does the NTFS store the filename? I got some downloaded files, some with Chinese filename, I can not backup them to CD because the name is not accepted. I use walk, then print the filename, there are some ? in it, but some Chinese characters were display with no problem. I suspect t

Re: Python embedded interpreter: how to initialize the interpreter ?

2007-01-02 Thread Ziga Seilnacht
[EMAIL PROTECTED] wrote: > Hello, > > I've written a C embedded application. I want to open a python gui > application in my C program but when I do : > > PyRun_String( "import gui.py", file_input, pDictionary, pDictionary ); > > the interpreter emits an error: tkinter module not defined > > What s

Re: array of class

2007-01-02 Thread Podi
> > Or more compactly: > > > > words = [Word(w) for w in 'this is probably what you want'.split()] > > print words > > I didn't want to introduce yet some more "confusing" stuff !-) Indeed, the for loop is perfectly fine and totally readable. Let's save the "confusing stuff" to the Perl folks. -

Need old pywin32/win32all for Win95

2007-01-02 Thread Bob Greschke
Does anyone have an old version of this? I've got some old OEM stuff that will only handle Win95 because of some custom hardware drivers. The build 200 on sourceforge of pywin32 isn't old enough. I'm trying to get pyserial up and running. Python/Tkinter does OK at 233MHz! :) Thanks! Bob

Re: array of class

2007-01-02 Thread Bruno Desthuilliers
George Sakkis a écrit : > Bruno Desthuilliers wrote: > (snip) >>words = [] >>for w in ['this', 'is', 'probably', 'what', 'you', 'want']: >> words.append(Word(w)) >>print words > > Or more compactly: > > words = [Word(w) for w in 'this is probably what you want'.split()] > print words I didn'

Re: list/dictionary as case statement ?

2007-01-02 Thread Bruno Desthuilliers
Stef Mientki a écrit : > > If I'm not mistaken, I read somewhere that you can use > function-names/references in lists and/or dictionaries, Python's functions are objects too - instances of the (builtin) class 'function'. So yes, you can use them like any other object (store them in container

Re: list/dictionary as case statement ?

2007-01-02 Thread Stef Mientki
> > Yes. Functions are (so called) first class objects. You can refer to one > by name, and pass that reference around in variables and other data > structures. > > That said, your code above won't work as written because function1 is > not in existence when you refer to it. > Yes, I just fou

Re: A question about unicode() function

2007-01-02 Thread Paul Watson
JTree wrote: > Thanks everyone! > > Sorry for my ambiguous question. > I changed the codes and now it works fine. > > > > JTree wrote: >> Hi,all >> I encountered a problem when using unicode() function to fetch a >> webpage, I don't know why this happenned. >> My codes and error messa

Re: array of class

2007-01-02 Thread George Sakkis
Bruno Desthuilliers wrote: > FWIW, I guess that what you want here may looks like this: > > class Word(object): >def __init__(self, word=''): > self._word = word >def __repr__(self): > return "" % (self._word, id(self)) > > > words = [] > for w in ['this', 'is', 'probably', 'what

Re: list/dictionary as case statement ?

2007-01-02 Thread Gary Herron
Stef Mientki wrote: > If I'm not mistaken, I read somewhere that you can use > function-names/references in lists and/or dictionaries, but now I can't > find it anymore. > > The idea is to build a simulator for some kind of micro controller (just > as a general practise, I expect it too be very

Re: array of class

2007-01-02 Thread Carl Banks
mm wrote: > How can I do a array of class? > > s1=[] ## this array should hold classes > > ## class definition > class Word: >word="" > > > ## empty words... INIT > for i in range(100): ## 0..99 >s1.append(Wort) > > s1[0].word="There" > s1[1].word="should" > s1[2].word="be" > s1[3].word=

Re: list/dictionary as case statement ?

2007-01-02 Thread Grant Edwards
On 2007-01-02, Stef Mientki <[EMAIL PROTECTED]> wrote: > If I'm not mistaken, I read somewhere that you can use > function-names/references in lists and/or dictionaries, but > now I can't find it anymore. > > The idea is to build a simulator for some kind of micro > controller (just as a general

list/dictionary as case statement ?

2007-01-02 Thread Stef Mientki
If I'm not mistaken, I read somewhere that you can use function-names/references in lists and/or dictionaries, but now I can't find it anymore. The idea is to build a simulator for some kind of micro controller (just as a general practise, I expect it too be very slow ;-). opcodes ={ 1: ('

Re: array of class

2007-01-02 Thread Bruno Desthuilliers
mm a écrit : > > How can I do a array of class? s/array/list/ > s1=[] ## this array should hold classes > > ## class definition > class Word: > word="" > > > ## empty words... INIT > for i in range(100): ## 0..99 > s1.append(Wort) I guess that s/Wort/Word/ > s1[0].word="There" > s1[1]

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Piet van Oostrum
> Sebastian 'lunar' Wiesner <[EMAIL PROTECTED]> (SW) wrote: >SW> Linux seems to ignore SUID bit on scripts: The reason is that obeying SUID bits on scripts would be a security risk. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Chris Lambacher
On Tue, Jan 02, 2007 at 09:08:41AM -0800, Ben Sizer wrote: > Chris Lambacher wrote: > > > On Sat, Dec 30, 2006 at 04:55:09PM -0800, Ben Sizer wrote: > > > > Yet many scripts and applications require parameters, or to be executed > > > from a certain directory. For example, setup.py. Or the variou

Re: Unsubscribing from the list

2007-01-02 Thread Dotan Cohen
On 02/01/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Dotan Cohen wrote: > > I need to unsubscribe from this list. I've mailed > > [EMAIL PROTECTED] but that did not unsubscribe me. I've > > also gone to the list homepage and entered my user information, but > > that just sent me a message that som

Re: Some basic newbie questions...

2007-01-02 Thread Kent Johnson
jonathan.beckett wrote: I'm just finding it a bit weird that some of the built in functions are > static, rather than methods of objects (such as len() being used to > find the length of a list). Another explanation here: http://effbot.org/pyfaq/why-does-python-use-methods-for-some-functionality

Remote askopenfilename()

2007-01-02 Thread half . italian
Hi all. I'm trying to get Tkinter.askopenfilename() to list a directory tree on a remote computer. I've got some ideas, but nothing is slapping me in the face. Can someone point me in the right direction? ~Sean -- http://mail.python.org/mailman/listinfo/python-list

How to format a number?

2007-01-02 Thread Clodoaldo
I want to format a number with thousands separator to the 'pt_br' locale. I'm trying like this: >>> import locale >>> locale.setlocale(locale.LC_ALL, ('pt_br', 'ascii')) 'pt_BR.ISO8859-1' >>> locale.format('%d', 9876, True) '9876' >>> locale.localeconv()['thousands_sep'] '' >>> locale.localeconv(

Re: Python embedded interpreter: how to initialize the interpreter ?

2007-01-02 Thread [EMAIL PROTECTED]
> >the interpreter emits an error: tkinter module not defined Capitalize the 't', in Tkinter, its case sensitive. -- http://mail.python.org/mailman/listinfo/python-list

wsdl2py question

2007-01-02 Thread Laszlo Nagy
Hi All! I just installed ZSI and tried to generate client code for a wsdl. Here is the exception I got: Traceback (most recent call last): File "/usr/local/bin/wsdl2py", line 9, in ? wsdl2py() File "/usr/local/lib/python2.4/site-packages/ZSI/generate/commands.py", line 222, in wsdl2py

Re: array of class

2007-01-02 Thread hg
mm wrote: > > How can I do a array of class? > > s1=[] ## this array should hold classes > > ## class definition > class Word: >word="" > > > ## empty words... INIT > for i in range(100): ## 0..99 >s1.append(Wort) > > s1[0].word="There" > s1[1].word="should" > s1[2].word="be" > s1[

array of class

2007-01-02 Thread mm
How can I do a array of class? s1=[] ## this array should hold classes ## class definition class Word: word="" ## empty words... INIT for i in range(100): ## 0..99 s1.append(Wort) s1[0].word="There" s1[1].word="should" s1[2].word="be" s1[3].word="different" s1[4].word="classes" ... b

Re: DOS, UNIX and tabs

2007-01-02 Thread Neil Cerutti
On 2007-01-02, Peter Decker <[EMAIL PROTECTED]> wrote: > On 1/1/07, Tom Plunket <[EMAIL PROTECTED]> wrote: >> Maybe I'm also weird, but I use a variable-pitch font when >> programming in Python. So a "tab equals some number of >> spaces" really isn't useful to me. My setup is, "tab equals >> this

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Gabriel Genellina
At Tuesday 2/1/2007 13:58, Ben Sizer wrote: > Notice that there is NO need to alter the system path. You just have > to tell Windows where python.exe resides; there is a per-application > path located at > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths. >From what I can

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Ravi Teja
> > > > How about invoking scripts with SUID root set? > > Linux seems to ignore SUID bit on scripts: Yes. My bad. The work around was to use native launchers. I don't remember the details. Perhaps with the interpreter embedded to launch it in-process and to hard code the script paths (or at least

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Sebastian 'lunar' Wiesner
Carsten Haese <[EMAIL PROTECTED]> typed > On Tue, 2007-01-02 at 17:17 +0100, Sebastian 'lunar' Wiesner wrote: >> Ravi Teja <[EMAIL PROTECTED]> typed >> >> > >> > Ivan Voras wrote: >> >> Ramdas wrote: >> >> > Well, >> >> > >> >> > I need to add users from a web interface for a web server, which >

Re: python2.5 frameobject - how to upgrade?

2007-01-02 Thread skip
Helmut> A personal question: Have you converted from Perl to Python, as Helmut> well? Never really needed to. Anybody hiring me for my Perl expertise would be in big trouble. ;-) Skip -- http://mail.python.org/mailman/listinfo/python-list

Python Guru needed in San Jose!

2007-01-02 Thread Brent Rogers -X (breroger - Spherion at Cisco)
Start the New Year off with a new Python job! Cisco Systems (San Jose, CA) Posted 16-Nov-2006 Technical Leader I (759661) Description We are looking for a Software Development Engineer who will work in development of a new Cisco product. Architect and develop high per

Re: how to use execfile with argument under windows

2007-01-02 Thread Peter Otten
baur79 wrote: > i need to execute this command line (different source for n times) > > filename.exe -type png -source sourcearg -file filename.png > i try with python (python script and filename.exe in same directory) > execfile("filename.exe -type png -source sourcearg -file filename.png") Th

Re: how to use execfile with argument under windows

2007-01-02 Thread Matimus
> > error output > IOError: [Errno 2] No such file or directory:"filename.exe -type png > -source sourcearg -file filename.png" Use 'os.system' not 'execfile'. 'execfile' is for executing other python scripts, not arbitrary command line. Try this: import os ... ... os.system("filename.exe -type

Re: DOS, UNIX and tabs

2007-01-02 Thread Peter Decker
On 1/1/07, Tom Plunket <[EMAIL PROTECTED]> wrote: > Maybe I'm also weird, but I use a variable-pitch font when programming > in Python. So a "tab equals some number of spaces" really isn't useful > to me. My setup is, "tab equals this much space". A year ago I would have thought you were weird,

Re: python2.5 frameobject - how to upgrade?

2007-01-02 Thread Helmut Jarausch
[EMAIL PROTECTED] wrote: > Helmut> I'd like to install a package ('rekall') which uses > Helmut> frame->f_nlocals which is no longer contained in frameobject.h. > > Helmut> What's the recommended way to upgrade such an application? > > I suspect PySequence_Length(frame->f_locals) will

RE: Looking for python SIP/MGCP stacks

2007-01-02 Thread Jean-Paul Calderone
On Tue, 2 Jan 2007 09:02:17 -0800, "Jenny Zhao \(zhzhao\)" <[EMAIL PROTECTED]> wrote: >Thanks Anthony. > >I am wondering where I can get Divmod Sine and Shtoom. Are they open >source ? > http://divmod.org/trac/wiki/DivmodSine http://divmod.org/trac/wiki/ShtoomProject Shtoom is LGPL. Sine borro

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Ben Sizer
Chris Lambacher wrote: > On Sat, Dec 30, 2006 at 04:55:09PM -0800, Ben Sizer wrote: > > Yet many scripts and applications require parameters, or to be executed > > from a certain directory. For example, setup.py. Or the various > > turbogears scripts. Or easy_install. > Martin's point was that i

how to use execfile with argument under windows

2007-01-02 Thread baur79
Hi everybody i need to execute this command line (different source for n times) filename.exe -type png -source sourcearg -file filename.png i try with python (python script and filename.exe in same directory) import os .. .. execfile("filename.exe -type png -source sourcearg -file file

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Thomas Heller
Ben Sizer schrieb: > Gabriel Genellina wrote: > >> Notice that there is NO need to alter the system path. You just have >> to tell Windows where python.exe resides; there is a per-application >> path located at >> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths. >> In order

Re: popen on windows

2007-01-02 Thread hubritic
Thanks for your reply. I figured it out. I was not closing the file that path pointed to before executing the command. D'oh! So sometimes it read the file that was created on the previous test run ... Anyway, for the benefit of anyone who might be googling for a similar question, what seems to wor

RE: Looking for python SIP/MGCP stacks

2007-01-02 Thread Jenny Zhao (zhzhao)
Thanks Anthony. I am wondering where I can get Divmod Sine and Shtoom. Are they open source ? Thanks again Jenny -Original Message- From: Anthony Baxter [mailto:[EMAIL PROTECTED] Sent: Saturday, December 30, 2006 2:38 AM To: Jenny Zhao (zhzhao) Cc: python-list@python.org Subject: Re: L

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Ben Sizer
Gabriel Genellina wrote: > At Saturday 30/12/2006 21:55, Ben Sizer wrote: > > >python setup.py install > > > >On Unix, you'd run this command from a shell prompt; on Windows, you > >have to open a command prompt window (``DOS box'') and do it there; " > > > >Pretty much none of the instructions in

Re: Python Wrapper for C# Com Object

2007-01-02 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > [EMAIL PROTECTED] skrev: > >> Hi, >> >> I wish to write a Python wrapper for my C# COM object but am unsure >> where to start. I have a dll and a tlb file, and I can use this object >> in C via the following code - >> >> // ConsolApp.cpp : Defines the entry point for t

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Chris Lambacher
On Sat, Dec 30, 2006 at 04:55:09PM -0800, Ben Sizer wrote: > Martin v. L?wis wrote: > > > Ben Sizer schrieb: > > > I've installed several different versions of Python across several > > > different versions of MS Windows, and not a single time was the Python > > > directory or the Scripts subdirec

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Carsten Haese
On Tue, 2007-01-02 at 17:17 +0100, Sebastian 'lunar' Wiesner wrote: > Ravi Teja <[EMAIL PROTECTED]> typed > > > > > Ivan Voras wrote: > >> Ramdas wrote: > >> > Well, > >> > > >> > I need to add users from a web interface for a web server, which > >> > runs only Python. I need to add users, set qu

Re: trees, iterations and adding leaves

2007-01-02 Thread Gabriel Genellina
At Sunday 31/12/2006 14:25, vertigo wrote: I use nltk package - but it should not matter here. Yes, it does. The framework should provide some form of tree traversal. So i wanted to 'travel thru my tree' to last node which should be changed: >>> tree6 = Tree('main', ['sub1', 'sub2']) >>> sub

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Sebastian 'lunar' Wiesner
Ravi Teja <[EMAIL PROTECTED]> typed > > Ivan Voras wrote: >> Ramdas wrote: >> > Well, >> > >> > I need to add users from a web interface for a web server, which >> > runs only Python. I need to add users, set quotas and in future >> > even look at managing ip tables to limit bandwidth. >> > >> >

Re: Unsubscribing from the list

2007-01-02 Thread Robert Kern
Dotan Cohen wrote: > I need to unsubscribe from this list. I've mailed > [EMAIL PROTECTED] but that did not unsubscribe me. I've > also gone to the list homepage and entered my user information, but > that just sent me a message that someone had tried to resubscribe this > username. What must one d

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Jan Dries
Ivan Voras wrote: > Ramdas wrote: >> Well, >> >> I need to add users from a web interface for a web server, which runs >> only Python. I need to add users, set quotas and in future even look at >> managing ip tables to limit bandwidth. >> >> I know os.system(), but this has to be done through a for

Re: Python embedded interpreter: how to initialize the interpreter ?

2007-01-02 Thread Gabriel Genellina
At Sunday 31/12/2006 10:55, [EMAIL PROTECTED] wrote: I've written a C embedded application. I want to open a python gui application in my C program but when I do : PyRun_String( "import gui.py", file_input, pDictionary, pDictionary ); the interpreter emits an error: tkinter module not defined

Re: Convert Perl to Python

2007-01-02 Thread Bruno Desthuilliers
Marc 'BlackJack' Rintsch a écrit : > In <[EMAIL PROTECTED]>, > Χρυσάνθη Αϊναλή wrote: > > >>How can I convert a perl script to Python? > > > Look what the Perl script does and then rewrite it in Python. Automatic > translations between programming languages, if possible, usually result in > co

Re: Newbie query about secure embedded python

2007-01-02 Thread Paul Rubin
Richard Dwan <[EMAIL PROTECTED]> writes: > My question is; is there a secure python interpreter > that prevents malicious code from using C/C++ modules > or built-in functions from causing damage to a users > system. You mean like a java sandbox? There used to be one in Python (the rexec/Bastion

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Ravi Teja
Ivan Voras wrote: > Ramdas wrote: > > Well, > > > > I need to add users from a web interface for a web server, which runs > > only Python. I need to add users, set quotas and in future even look at > > managing ip tables to limit bandwidth. > > > > I know os.system(), but this has to be done throu

Re: Can I beat perl at grep-like processing speed?

2007-01-02 Thread Bruno Desthuilliers
js a écrit : > Just my curiosity. > Can python beats perl at speed of grep-like processing? Probably not. > > $ wget http://www.gutenberg.org/files/7999/7999-h.zip > $ unzip 7999-h.zip > $ cd 7999-h > $ cat *.htm > bigfile > $ du -h bigfile > du -h bigfile > 8.2Mbigfile > > -- grep.

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Gabriel Genellina
At Saturday 30/12/2006 21:55, Ben Sizer wrote: python setup.py install On Unix, you'd run this command from a shell prompt; on Windows, you have to open a command prompt window (``DOS box'') and do it there; " Pretty much none of the instructions in that part of the docs will work without you

Re: OO question

2007-01-02 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > First I want to say thanks everyone for helping me! > > John Machin wrote: > > >>[EMAIL PROTECTED] wrote: >> >>>I want to make an addressbook and I'm new to OO programming, so I >>>wonder if this sounds reasonable. >>> >>>I think of making a class Address which cont

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Ivan Voras
Ramdas wrote: > Well, > > I need to add users from a web interface for a web server, which runs > only Python. I need to add users, set quotas and in future even look at > managing ip tables to limit bandwidth. > > I know os.system(), but this has to be done through a form entry > through a web i

Re: python2.5 frameobject - how to upgrade?

2007-01-02 Thread skip
Helmut> I'd like to install a package ('rekall') which uses Helmut> frame->f_nlocals which is no longer contained in frameobject.h. Helmut> What's the recommended way to upgrade such an application? I suspect PySequence_Length(frame->f_locals) will do the trick. Skip -- http://mail

Newbie query about secure embedded python

2007-01-02 Thread Richard Dwan
(Originally incorrectly posted to C++ SIG mailing list) Hello, First let me apologise if this question is obvious - I've never embedded python before and I am deciding of it meets my needs. My question is; is there a secure python interpreter that prevents malicious code from using C/C++ modul

Re: mutable numeric type

2007-01-02 Thread Diez B. Roggisch
Helmut Jarausch schrieb: > [EMAIL PROTECTED] wrote: >> Way to go. >> Try doing this. >> x = MutableNumeric(42) > ^^ > where is this defined? In the OPs example. Diez -- http://mail.python.org/mailman/listinfo/python-list

python2.5 frameobject - how to upgrade?

2007-01-02 Thread Helmut Jarausch
Hi, I'd like to install a package ('rekall') which uses frame->f_nlocals which is no longer contained in frameobject.h What's the recommended way to upgrade such an application? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen

Unsubscribing from the list

2007-01-02 Thread Dotan Cohen
I need to unsubscribe from this list. I've mailed [EMAIL PROTECTED] but that did not unsubscribe me. I've also gone to the list homepage and entered my user information, but that just sent me a message that someone had tried to resubscribe this username. What must one do to unsubscribe from python-

Re: Special Characters (Unicode, Ascii) in Python and MySQL

2007-01-02 Thread Carsten Haese
On Mon, 2007-01-01 at 21:57 -0800, ronrsr wrote: > I have an MySQL database called zingers. The structure is: > > zid - integer, key, autoincrement > keyword - varchar > citation - text > quotation - text > > I am having trouble storing text, as typed in latter two fields. > Special characters an

How to get BOOST working on XP and Visual C++ 2005

2007-01-02 Thread Osiris
My experiences with BOOST on Windows XP and Visual C++ 2005 I'm new to Python. I built software in more than ten other computer languages. I'm not sure if that is not a handicap, when reading documentation of a system like BOOST. However: It took me more than four full working days to get a Python

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Fuzzyman
Ben Sizer wrote: [snip..] > I have no problem with something being configurable, but I do have a > problem with Windows users being forced to jump through unnecessary > hoops that Unix and MacOS users don't have to endure. And I think the > default should be to edit the PATH and allow you to expli

Re: mutable numeric type

2007-01-02 Thread Peter Otten
Andreas Beyer wrote: > There has been quite some traffic about mutable and immutable data types > on this list. I understand the issues related to mutable numeric data > types. However, in my special case I don't see a better solution to the > problem. > Here is what I am doing: > > I am using a

Re: Difference between __init__ (again) and nothing ...

2007-01-02 Thread Bruno Desthuilliers
Stef Mientki a écrit : > Marc 'BlackJack' Rintsch wrote: > >> In <[EMAIL PROTECTED]>, Stef Mientki wrote: >> >>> What's the difference between using __init__ and using nothing, >>> as the examples below. >>> >>> class cpu: >>>PC = 4 >> >> >> This is a *class attribute*. It's the same for all

Re: simple ftputil ssl client

2007-01-02 Thread Stefan Schwarzer
On 2006-12-31 19:27, Croteam wrote: > I trying to make ftputil client that uses ssl security.First I was try > to make that with M2Crypto,but > when I use it, I get the error: > > Traceback (most recent call last): > File "", line 1, in -toplevel- > import M2Crypto > File "C:\Python24\lib\s

Re: Difference between __init__ (again) and nothing ...

2007-01-02 Thread Stef Mientki
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Stef Mientki wrote: > >> What's the difference between using __init__ and using nothing, >> as the examples below. >> >> class cpu: >>PC = 4 > > This is a *class attribute*. It's the same for all instances of `cpu`. > >> class cpu: >

Re: mutable numeric type

2007-01-02 Thread Helmut Jarausch
[EMAIL PROTECTED] wrote: > Way to go. > Try doing this. > x = MutableNumeric(42) ^^ where is this defined? > y = x > x += 42 > print y > -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailm

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Ben Sizer
Tom Plunket wrote: > vbgunz wrote: > > Some if not most python documentation assumes Python is on the path... > > Really? I must live in different places in the docs, but I can't recall > encountering any such documentation. I have posted a few examples above: "Installing Python Modules" (http:/

Re: Difference between __init__ (again) and nothing ...

2007-01-02 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Stef Mientki wrote: > What's the difference between using __init__ and using nothing, > as the examples below. > > class cpu: >PC = 4 This is a *class attribute*. It's the same for all instances of `cpu`. > class cpu: >def __init__: > self.PC = 4 This is a

Re: mutable numeric type

2007-01-02 Thread pgarrone
Way to go. Try doing this. x = MutableNumeric(42) y = x x += 42 print y -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Ben Sizer
robert wrote: > Ben Sizer wrote: > > My opinion is that this is not as big a problem as some may feel that > > it is. Unlike Unix systems, the PATH variable is rarely used. > > It is a big problem. > > It is not less than the majority of Python users (at least those who do > things on the command

Re: Unexpected output while walking dirs

2007-01-02 Thread Evan Carmi
wittempj hotmail.com gmail.com> writes: > > If I do get this correct - you have files like \test\Mail\somename.msf > and \test\Mail\somedirectory\someothername.msf, these files you want to > move to \test\backup\timestamp\somename.msf and > \test\backup\timestamp\somedirectory\someothername.msf

Difference between __init__ (again) and nothing ...

2007-01-02 Thread Stef Mientki
What's the difference between using __init__ and using nothing, as the examples below. class cpu: PC = 4 class cpu: def __init__: self.PC = 4 thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: how to move files based on file-ending from dirs and subdirs to specific dir?

2007-01-02 Thread Evan Carmi
Marc 'BlackJack' Rintsch gmx.net> writes: > This line is quite complicated and I don't really grasp what it's doing. > Maybe some comments, possible with examples, are needed here. And maybe > then you'll see why it doesn't work as wanted!? If these are the > destination paths and they should b

Re: doctesting

2007-01-02 Thread Ben Artin
In article <[EMAIL PROTECTED]>, belinda thom <[EMAIL PROTECTED]> wrote: > I'd like to write a tester script that I can place in one place (say > ~/bin/python/tester.py) and then have it visible to me at the cmd- > line (by setting the path variable appropriately). I have had no > luck in ge

Re: doctesting

2007-01-02 Thread Peter Otten
belinda thom wrote: > I'd like to write a tester script that I can place in one place (say > ~/bin/python/tester.py) and then have it visible to me at the cmd- > line (by setting the path variable appropriately). I have had no > luck in getting it to work, however. > > It appears like the doctes

[Off] WXP Fingerprint + Python...

2007-01-02 Thread durumdara
Hi! I have an application (Python + wx) somewhere. The users use they fingerprint to log[in/out]. But we have a problem that in this time the fingerprint logon is do REAL windows logon, so every user need a windows user too, and many times it need to close/open application, and Windows. We need

doctesting

2007-01-02 Thread belinda thom
Hi, I'd like to write a tester script that I can place in one place (say ~/bin/python/tester.py) and then have it visible to me at the cmd- line (by setting the path variable appropriately). I have had no luck in getting it to work, however. It appears like the doctest code itself assumes t

Re: how to move files based on file-ending from dirs and subdirs to specific dir?

2007-01-02 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Evan Carmi wrote: > top = 'f:\\test\\mail' > > […] > > indexdest = [] Here you bind the name `indexdest` to an empty list but replace it in the very next line with another list. So this line is unnecessary. > indexdest = ['%s\\..\\..\\%s\\%s\\%s' % (x , time.strftime('%

Re: Writing more efficient code

2007-01-02 Thread John Machin
On 2/01/2007 2:23 PM, gonzlobo wrote: > Thanks to John, Paul & Jon for their responses. This list is great for > info. Hi gonzlobo, Please dont use private e-mail; post to the Python mailing-list / newsgroup, so that everybody can see what the eventual outcome is. Please also answer the questi