Send email notification

2006-03-07 Thread Ernesto
Is there a special module for mail ? I'd like to send an email [to 'n' unique email addresses] from a python script. Thanks ! -- http://mail.python.org/mailman/listinfo/python-list

Re: vb dll

2006-03-07 Thread utabintarbo
How? -- http://mail.python.org/mailman/listinfo/python-list

Re: os.execve(pth,args,env) and os.chroot(pth) = problems

2006-03-07 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > ... It seems me that the os.chroot() call is messing up the > os.execve() (which executes the cgi script). os.execve(pth, args, > envVariables) is only executed if os.path.exists(pth) returns True. > But when I run

Re: Opening files without closing them

2006-03-07 Thread Peter Hansen
3c273 wrote: > "Robert Kern" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Paul Rubin wrote: >> >>>Say that the open is inside the try block. If the file can't be >>>opened, then 'open' raises an exception, 'f' doesn't get set, and then >>>the 'finally' clause tries to close f

Re: New python.org website

2006-03-07 Thread dimitri pater
I do like it, one thing I noticed though:http://www.python.org/doc/ has an image (batteries-included.jpg), a very nice image but it says "new V 1.6". Okay , this may not seem important, but maybe someone (the original artist?) can "update" it. regards,DimitriOn 7 Mar 2006 11:03:27 -0800, projecktze

Re: processing the genetic code with python?

2006-03-07 Thread Ralf Muschall
James Stroud wrote: > I'm writing your name down and this is the last time I'm doing homework > for you. This won't help - she doesn't even know her name (but google helps with that) ;-) The fact that she uses E.coli ribosomal protein L1 strongly indicates that this is really homework. ... > d

Re: New python.org website

2006-03-07 Thread projecktzero
Oops...it is live. Cool! -- http://mail.python.org/mailman/listinfo/python-list

Re: New python.org website

2006-03-07 Thread projecktzero
I think the new site is great. I really don't understand all the nit picking that's going on from the armchair web designers. The new site is clean and professional. It needs to go live soon! -- http://mail.python.org/mailman/listinfo/python-list

Re: New python.org website

2006-03-07 Thread Michael Tobis
While the new one is much better than the old website, the logo strikes me as awful. I tried to suggest repurposing the much better PyCon logo, but it didn't raise the vast groundswell of support I wanted it to. But for whatever its worth I'll try again. My rant is here: http://tinyurl.com/rkq3s

Re: Opening files without closing them

2006-03-07 Thread 3c273
"Robert Kern" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paul Rubin wrote: > > Say that the open is inside the try block. If the file can't be > > opened, then 'open' raises an exception, 'f' doesn't get set, and then > > the 'finally' clause tries to close f. f might have been

Re: processing the genetic code with python?

2006-03-07 Thread nuttydevil
Thanks so much guys for you all your help. I've had a month to learn python and do this for my project, I had the basics down but just kept getting unstuck. I won't message again - promise! Hehehe, thanks again everyone. -- http://mail.python.org/mailman/listinfo/python-list

Re: generators shared among threads

2006-03-07 Thread jess . austin
Alex wrote: > Last, I'm not sure I'd think of this as a reentrantQueue, so > much as a ReentrantCounter;-). Of course! It must have been late when I named this class... I think I'll go change the name in my code right now. -- http://mail.python.org/mailman/listinfo/python-list

Re: how about adding ping's uuid module to the standard lib ?

2006-03-07 Thread Trent Mick
[Fredrik Lundh wrote] > see subject and http://python.org/sf/1368955 > > comments ? +1, once it has been vetted a bit (as is being done on the tracker) Trent -- Trent Mick [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: SAX/Python : read an xml from the end to the top

2006-03-07 Thread Peter Hansen
kepioo wrote: > Peter, > > I cannot really process as your advice : it is not that stereotypical > entrieswe built a data structure for the xml and we report various > types of events, always under the same format but with different > contents types. > > The script i am writing aims at pickin

ANN: 2006 Python training courses, San Francisco

2006-03-07 Thread w chun
WE are giving 4 more Python training sessions (held near the San Francisco airport) for the remainder of this year. For the first time, there will be an "advanced" Python course available to the public. In fact, we've added the March intro course date for those prepping to take the advanced class

Re: Python as an extension language

2006-03-07 Thread Terry Hancock
On Mon, 06 Mar 2006 12:20:32 +0100 Torsten Bronger <[EMAIL PROTECTED]> wrote: > Sybren Stuvel <[EMAIL PROTECTED]> > writes: > > Torsten Bronger enlightened us with: > >> I already know how to do that in principle. My only > >concern is > distributing the thing, especially for the > >Windows platfo

Re: Pyserial again

2006-03-07 Thread Peter Hansen
Richie Hindle wrote: > A piece of that code has been chopped off by someone's newsreader - it's the > body of a method, and ser.readline() is the last line of that method. I'm pretty sure that's true. Technically, however, it's still a guess, though at this point one I'm sure we're all comfortab

Re: Compile ui files from within Eclipse

2006-03-07 Thread Chuck
I guess I could prompt for input but was hoping to find a better way. -- http://mail.python.org/mailman/listinfo/python-list

Re: setting PYTHONPATH

2006-03-07 Thread Terry Hancock
On Sun, 5 Mar 2006 23:05:31 -0800 (PST) anushya beauty <[EMAIL PROTECTED]> wrote: > Anybody, please help me to set PYTHONPATH to import > my modules?. Where is sy.path set? > > In some python groups site, to import the user modules, > they explained to create one __init__.py fi

Re: inserting into a list

2006-03-07 Thread John Salerno
Warby wrote: > It makes sense because a slice IS a list, so you should assign a list > to it. Yours is just a special case in which the target slice has a > length of zero. It's still a list, just an empty one: > L = [1,2,4] print L[2:2] > [] > > As for your question, yes: > L =

Re: Peter Naur wins ACM Turing Award

2006-03-07 Thread Terry Reedy
"Colin J. Williams" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Terry Reedy wrote: >> >>>http://campus.acm.org/public/pressroom/press_releases/3_2006/turing_3_01_2006.cfm >>> >>>Peter Naur was co-developer of Backus/Naur grammar notation, co-author >>>and >>>editor of the Algo

Re: Compile ui files from within Eclipse

2006-03-07 Thread Chuck
Well, I tried that but there isnt a way to get the filename without the extension. For example, pyuic -o MyClass.py MyClass.ui Using the variables in the external tool config I dont see a way to get just the filename in order to create an output filename and pass it into the pyoic. -- http://ma

Re: AES encryption

2006-03-07 Thread Bryan Olson
Tuvas wrote: [...] > I've tested my function with a thousand random texts, it > seems to return the same result as received every time. Unfortunately, the results seem incorrect, self-consistent as they may be. The following will call your code, and check the results against 3 popular test vectors

Re: Confused by Method(function) of a module and method of a class/instance

2006-03-07 Thread Rene Pijlman
Sullivan WxPyQtKinter: >Why do the three expression yield the same result "abc"? Because all three converted "ABC" to lowercase, as per your request. -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: Attaching files in windows using Python.

2006-03-07 Thread sri2097
Hi all, I have got this far till now - import win32gui, struct, array, string OFN_ALLOWMULTISELECT=0x0200 OFN_EXPLORER=0x0008 def arrayToStrings(resultArray): """return list-of-strings corresponding to a char array, where each string is terminated by \000, and the whole

Re: Pyserial again

2006-03-07 Thread Grant Edwards
On 2006-03-07, luca72 <[EMAIL PROTECTED]> wrote: > Ok you write that it close :Because the "ser" object is never > used after that point, so it get's garbage collected and > deleted. Yes. > But for example if i make one button with the same caracteristic of the > previous com port: > > def OnBut

Re: Pyserial again

2006-03-07 Thread Richie Hindle
[luca] > Here is my code; why after the readline the port close? > > ser = serial.Serial(0) > [...] > ser.readline() > > Why after this the port close. [Grant] > Because the "ser" object is never used after that point, so it > get's garbage collected and deleted.

Re: Pyserial again

2006-03-07 Thread Grant Edwards
On 2006-03-07, luca72 <[EMAIL PROTECTED]> wrote: > Hello Grant and Hello Steve. > > Pls. don't kill me, but if you try the code above written you see that > after the read the port close. > My question is only: why it close without the close command? I've answered that question TWICE. The ser obj

os.execve(pth,args,env) and os.chroot(pth) = problems

2006-03-07 Thread [EMAIL PROTECTED]
Hello fellow python users, I've been working on a basic implementation of a privilege separated web server, and I've goto the point of running a basic cgi script. Basically when the execCGI function in my Unpriv.py program is called a few things should happen, it should fork (which it does), the s

Re: Python advocacy in scientific computation

2006-03-07 Thread Michael Tobis
> Indentation > makes all kinds of inlined code extremely clumsy or practically impossible > in Python. This is the only sensible argument against the indentation thing I've heard. Python squirms about being inlined in a presentation template. Making a direct competitor to PHP in pure Python is pr

Re: inserting into a list

2006-03-07 Thread John Salerno
Diez B. Roggisch wrote: > John Salerno wrote: > >> Diez B. Roggisch wrote: >> >>> Why don't you just _try_ that? It would have been way faster than to ask >>> questions you can easily answer yourself. >> I did try it, but I was still hoping for an explanation, which I've also >> gotten from you gu

Re: inserting into a list

2006-03-07 Thread Diez B. Roggisch
John Salerno wrote: > Diez B. Roggisch wrote: > >> Why don't you just _try_ that? It would have been way faster than to ask >> questions you can easily answer yourself. > > I did try it, but I was still hoping for an explanation, which I've also > gotten from you guys, some in nicer terms than o

Re: inserting into a list

2006-03-07 Thread John Salerno
Diez B. Roggisch wrote: > Why don't you just _try_ that? It would have been way faster than to ask > questions you can easily answer yourself. I did try it, but I was still hoping for an explanation, which I've also gotten from you guys, some in nicer terms than others. -- http://mail.python.or

Re: inserting into a list

2006-03-07 Thread Warby
It makes sense because a slice IS a list, so you should assign a list to it. Yours is just a special case in which the target slice has a length of zero. It's still a list, just an empty one: >>> L = [1,2,4] >>> print L[2:2] [] As for your question, yes: >>> L = [1,2,4] >>> L[2:2] = [[3]] >>>

Re: inserting into a list

2006-03-07 Thread Mel Wilson
John Salerno wrote: > Christoph Haas wrote: >> L[2:2]=[3] [ ... ] What if you wanted to insert an actual list into that slot? Would > you have to wrap it in double brackets? Yep. It's a strong-typing thing. Slices of lists are lists, and therefore what you assign to one has got to be a list,

Re: Pyserial again

2006-03-07 Thread luca72
Peter Hansen was asking you for the code AFTER the "ser.readline()" not BEFORE!! the code you have originally posted here OK IS MY MISTAKE; EXCUSE. I have read the example but if i ask is bucause i don't or maybe i don't understand the example Regaards Luca -- http://mail.python.org/mailman/l

Re: inserting into a list

2006-03-07 Thread Diez B. Roggisch
John Salerno wrote: > Christoph Haas wrote: > >> L[2:2]=[3] > > I'm still a little confused about this. If what I'm inserting is just an > integer, why wouldn't > L[2:2] = 3 > > work? Because a slice represents a list - even if it is a one-elemented one. So, replacing it you need another list

Distutils places 'extra_compile_args' in the wrong place?

2006-03-07 Thread greg . alpedhuez
I'm completely new to this, but trying to compile some code I've been given which uses the python Distutils stuff. I need to pass some compiler directives to gcc, and the documentation suggests that the parameteres 'extra_compile_args' can be used. However, this does so AFTER the rest of the argu

Attaching files in windows using Python.

2006-03-07 Thread sri2097
Hi all, I have to select a particular file (using the 'Browse') button in Windows. After this I need to populate the 'Open Dialogue Box' with the path of the file I need (I have the entier path of the file I need). Then I need to select the 'Open' Button. Only after this the file I want is attache

Re: Pyserial again

2006-03-07 Thread luca72
Ok you write that it close :Because the "ser" object is never used after that point, so it get's garbage collected and deleted. But for example if i make one button with the same caracteristic of the previous com port: def OnButton1Button(self, event): ser = serial.Serial(0) >

Re: Pyserial again

2006-03-07 Thread Petr Jakes
1) Peter Hansen was asking you for the code AFTER the "ser.readline()" not BEFORE!! the code you have originally posted here 2) the best way how to examine if your code works is to try to write some simplest code as possible first (not buttons, not GUI etc..., just a simple code) (all this suggest

Re: Python version of XMLUnit?

2006-03-07 Thread uche . ogbuji
Kent Johnson wrote: > I have found XMLUnit to be very helpful for testing Java and Jython code > that generates XML. At its heart XMLUnit is an XML-aware diff - it > parses expected and actual XML and pinpoints any differences. It is > smart enough to ignore things like attribute order, different q

SOAPpy, WSDL and objects

2006-03-07 Thread Bob . Capa
Hi, I am trying to access a webservice which needs a login request of the following form: FirstName LastName I am trying to do this with the following code: from SOAPpy import WSDL server = WSDL.Proxy(m_url) request = {'firstname': FirstName, 'lastname': La

Re: popen and exit code on Windows

2006-03-07 Thread iker . arizmendi
Thanks for the reply Giovanni. Is this behaviour of the close method on Windows documented anywhere? Regards, Iker -- http://mail.python.org/mailman/listinfo/python-list

Re: What version of python is running a script

2006-03-07 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Fernando Rodríguez <[EMAIL PROTECTED]> wrote: > >Hi, > >How can my script tell which version of python is running it? . . . $ python Python 2.3.5 (#2, Aug 30 2005, 15:50:26) [GCC 4.0.2 20

Re: inserting into a list

2006-03-07 Thread John Salerno
Christoph Haas wrote: > L[2:2]=[3] I'm still a little confused about this. If what I'm inserting is just an integer, why wouldn't L[2:2] = 3 work? What if you wanted to insert an actual list into that slot? Would you have to wrap it in double brackets? -- http://mail.python.org/mailman/listi

Re: inserting into a list

2006-03-07 Thread John Salerno
Diez B. Roggisch wrote: l = [1,2,3] l.insert(2, 10) l > [1, 2, 10, 3] > > Embarrasing enough? Actually, I was trying to figure it out with the slice technique instead. But yeah, as Christopher's example showed, it's not hard. But I didn't realize you had to assign a list item to

Re: Python advocacy in scientific computation

2006-03-07 Thread Magnus Lycka
Terry Reedy wrote: > I believe it is Guido's current view, perhaps Google's collective view, and > a general *nix view that such increases can just as well come thru parallel > processes. I believe one can run separate Python processes on separate > cores just as well as one can run separate pr

Re: Pyserial again

2006-03-07 Thread luca72
Hello Grant and Hello Steve. Pls. don't kill me, but if you try the code above written you see that after the read the port close. My question is only: why it close without the close command? -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between a library and a module...

2006-03-07 Thread bruno at modulix
sophie_newbie wrote: > OK this might seem like a retarded question, Better to look like an ignorant than to stay one !-) > but what is the difference > between a library and a module? Python only defines 'modules' and 'packages'. A module can technically be any python source file, but usually re

Re: inserting into a list

2006-03-07 Thread Ratko Jagodic
from the Library Reference:s.insert(i, x) same as s[i:i] = [x] (5)On 3/7/06, John Salerno <[EMAIL PROTECTED] > wrote:Let me apologize in advance for what I'm sure is an achingly simple question, but I just can't find the answer in either of my Python books.I've tried a few tests wit

Re: Pyserial again

2006-03-07 Thread Grant Edwards
On 2006-03-07, Steve Holden <[EMAIL PROTECTED]> wrote: >>>Here is my code; why after the readline the port close? >>> >>>ser = serial.Serial(0) >>>ser.baudrate = 9600 >>>ser.parity = serial.PARITY_ODD >>>ser.stopbits = serial.STOPBITS_TWO >>>ser.bytesize =se

Re: inserting into a list

2006-03-07 Thread Diez B. Roggisch
John Salerno wrote: > Let me apologize in advance for what I'm sure is an achingly simple > question, but I just can't find the answer in either of my Python books. > I've tried a few tests with the interactive prompt, but they don't work > either. > > All I'm trying to do is insert an item into

Re: inserting into a list

2006-03-07 Thread Christoph Haas
On Tuesday 07 March 2006 16:18, John Salerno wrote: > Let me apologize in advance for what I'm sure is an achingly simple > question, but I just can't find the answer in either of my Python books. > I've tried a few tests with the interactive prompt, but they don't work > either. > > All I'm trying

Re: generators shared among threads

2006-03-07 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Thanks for the great advice, Alex. Here is a subclass that seems to > work: You're welcome! > from Queue import Queue > from itertools import count > > class reentrantQueue(Queue): > def _init(self, maxsize): > self.maxsize = 0 > self.queue = []

ANN: PyGUI 1.6.1

2006-03-07 Thread greg
PyGUI 1.6.1 is now available: http://www.cosc.canterbury.ac.nz/~greg/python_gui/ Bug fixes: - Mouse down event in a GLView caused a crash. - Canvas methods fill_poly() and stroke_poly() didn't work. Added a test for these. What is PyGUI?

Dr. Dobb's Python-URL! - weekly Python news and links (Mar 6)

2006-03-07 Thread Cameron Laird
QOTW: "This PyCon has been better in so many respects than the three that preceded it. ... PyCon will continue to improve." - Steve Holden, chairman of PyCon 2003-2005 http://holdenweb.blogspot.com/ "Design patterns are kind of like sarcasm: hard to use well, not always appropriate, and di

Re: Pyserial again

2006-03-07 Thread Steve Holden
Grant Edwards wrote: > On 2006-03-07, luca72 <[EMAIL PROTECTED]> wrote: > > >>Here is my code; why after the readline the port close? >> >>ser = serial.Serial(0) >>ser.baudrate = 9600 >>ser.parity = serial.PARITY_ODD >>ser.stopbits = serial.STOPBITS_TWO >>s

inserting into a list

2006-03-07 Thread John Salerno
Let me apologize in advance for what I'm sure is an achingly simple question, but I just can't find the answer in either of my Python books. I've tried a few tests with the interactive prompt, but they don't work either. All I'm trying to do is insert an item into a list, like so: L = [1, 2, 4

Re: Difference between a library and a module...

2006-03-07 Thread Laszlo Zsolt Nagy
sophie_newbie wrote: >OK this might seem like a retarded question, but what is the difference >between a library and a module? > >If I do: > >import string > >am I importing a module or a library? > > I'm not a guru, but... I think that modules are things that live inside the Python language. I

Re: raw strings and \

2006-03-07 Thread John Salerno
Alex Martelli wrote: > John Salerno <[EMAIL PROTECTED]> wrote: > >> Alex Martelli wrote: >> Now get back to work on your new Nutshell book :-) >>> Yep, good point!-) >> Are you working on a new edition? I didn't see any new Python books >> listed on O'Reilly's site through April, but I'd def

Re: What version of python is running a script

2006-03-07 Thread Juho Schultz
Fernando Rodríguez wrote: > > Hi, > > How can my script tell which version of python is running it? > > Thanks > > import sys # examine these variables sys.version_info sys.version -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between a library and a module...

2006-03-07 Thread [EMAIL PROTECTED]
I'm not 100% sure what is a library in python. Your example above is importing a module. Someone else can correct me, but I use libraries to refer to underlying c/c++ code that is required for the python modules to function. So in pure python you are really only dealing with modules. string.rep

Re: What version of python is running a script

2006-03-07 Thread Ratko Jagodic
import syssys.version yields something like:2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]On 3/7/06, Fernando Rodríguez <[EMAIL PROTECTED]> wrote:Hi, How can my script tell which version of python is running it?Thanks--http://mail.python.org/mailman/listinfo/python-list -- http:/

Re: Pyserial again

2006-03-07 Thread Grant Edwards
On 2006-03-07, luca72 <[EMAIL PROTECTED]> wrote: > Here is my code; why after the readline the port close? > > ser = serial.Serial(0) > ser.baudrate = 9600 > ser.parity = serial.PARITY_ODD > ser.stopbits = serial.STOPBITS_TWO > ser.bytesize =serial.EIGHTBITS

What version of python is running a script

2006-03-07 Thread Fernando Rodríguez
Hi, How can my script tell which version of python is running it? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: SAX/Python : read an xml from the end to the top

2006-03-07 Thread kepioo
Thanks Diez for your suggestion, I'll look around to find out more about the seek function ( i learnt python 2 weeks ago and I do not have a programmer background, but so far, I am doing well). Peter, I cannot really process as your advice : it is not that stereotypical entrieswe built a data

Difference between a library and a module...

2006-03-07 Thread sophie_newbie
OK this might seem like a retarded question, but what is the difference between a library and a module? If I do: import string am I importing a module or a library? And if i do string.replace() am I using a module or a function or a method or what? Sorry. -- http://mail.python.org/mailman/li

AES encryption

2006-03-07 Thread Tuvas
I have just finished a new function that will do AES128 encryption, which is the standard for private-key cryptology today. In fact, the NSA permitted AES to be used for classified documents in the USA, the first time a public algorithm has been given this honor (Secret and Top Secret documents can

Re: Python and Java

2006-03-07 Thread Harry George
"JKPeck" <[EMAIL PROTECTED]> writes: > Suppose you have an application written in Java, and you want to enable > other applications or processes written in Python to communicate with > it, i.e., to use Python as a scripting language for the application. > On Windows you could do this with COM and

Re: Cryptographically random numbers

2006-03-07 Thread Tuvas
from os import urandom def cstring(bytes): ret='' while(len(ret)'0' and c<'z': ret=ret+c return ret That should do it, though I bet there might be a more efficient way. I don't know if that's the set of characters you want to use, but... If you want a better answer, you'd h

Re: Python and Java

2006-03-07 Thread Diez B. Roggisch
JKPeck wrote: > Suppose you have an application written in Java, and you want to enable > other applications or processes written in Python to communicate with > it, i.e., to use Python as a scripting language for the application. > On Windows you could do this with COM and various addons such as

Re: Checking function calls

2006-03-07 Thread gene tani
Roy Smith wrote: > Fredrik Tolf wrote: > >If I have a variable which points to a function, can I check if certain > >argument list matches what the function wants before or when calling it? > > > >Currently, I'm trying to catch a TypeError when calling the function > >(since that is what is rais

CP4E? (was: Help - just a few lines of code needed)

2006-03-07 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >There is some fine permutation code in the cookbook. Take a look at >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 . > >You can easily code something like: . .

Re: Python and Java

2006-03-07 Thread JKPeck
Thanks for these suggestions. To be clear, we already have a Python 2.4 minimum requirement for other reasons, and we are looking for a long-term solution so that as Python advances, the scripting solution can keep up in a timely way. Since the Java code is for a very large, complex application,

Re: Simulation Programming Skills and Python

2006-03-07 Thread Mc Osten
On Mon, 06 Mar 2006 10:48:46 -0500, Richard Blackwood wrote: > Two, is > Python a good language for simulation programming? Civilization 4 is (partly) written in Python. I suppose they thought Python was a good language for that. I said partly because as far as I know some code is C++ for speed

Re: Pyserial again

2006-03-07 Thread luca72
def OnButton1Button(self, event): ser = serial.Serial(0) > ser.baudrate = 9600 > ser.parity = serial.PARITY_ODD > ser.stopbits = serial.STOPBITS_TWO > ser.bytesize =serial.EIGHTBITS > ser.setRTS(level = 0) > ser.setDTR(level = 0) >

Re: Getting File Permissions

2006-03-07 Thread Tim Chase
> Traceback (most recent call last): > File "", line 1, in ? > NameError: name 'octal' is not defined > > Since I am new to python, can any one help me to solve this error? Looks like you just want the oct() function (not "octal()") >>> [x for x in dir(__builtins__) if x.lower().find("oct") !

Re: Getting File Permissions

2006-03-07 Thread Juho Schultz
Hari wrote: > Hi, > For getting permissions of a file, the following script has been > suggested in the same group > > import os, stat > st = os.stat(myfile) > mode = st[stat.ST_MODE] > print "mode is", octal(mode & 0777) > > But while executing I am getting error message as follows > > Tracebac

Re: Getting File Permissions

2006-03-07 Thread Kent Johnson
Hari wrote: > Hi, > For getting permissions of a file, the following script has been > suggested in the same group > > import os, stat > st = os.stat(myfile) > mode = st[stat.ST_MODE] > print "mode is", octal(mode & 0777) > > But while executing I am getting error message as follows > > Tracebac

Getting File Permissions

2006-03-07 Thread Hari
Hi, For getting permissions of a file, the following script has been suggested in the same group import os, stat st = os.stat(myfile) mode = st[stat.ST_MODE] print "mode is", octal(mode & 0777) But while executing I am getting error message as follows Traceback (most recent call last): File "",

Re: Checking function calls

2006-03-07 Thread Roy Smith
Fredrik Tolf wrote: >If I have a variable which points to a function, can I check if certain >argument list matches what the function wants before or when calling it? > >Currently, I'm trying to catch a TypeError when calling the function >(since that is what is raised when trying to call it with

Re: New python.org website

2006-03-07 Thread Nicola Musatti
Phoe6 wrote: > beta.python.org evolved very nice and noticed today the new python.org > website going live. There is a change in the look n feel, wherein it > looks "more official" and maximum possible information about python is > now directly accessible from the home page itself. Kudoes to the

Re: Cryptographically random numbers

2006-03-07 Thread Gervasio Bernal
Bryan Olson wrote: > Tuvas wrote: > >>Ahh, you are correct, that is a large bug... How about this one? > > > Much better. Do note the comments from Emile van Sebille and Paul > Rubin. There are some minor style and efficiency points, but it > looks reasonable. > > Incidentally, as of Python 2.4

Re: Peter Naur wins ACM Turing Award

2006-03-07 Thread Colin J. Williams
Kay Schluehr wrote: > Terry Reedy wrote: > >>http://campus.acm.org/public/pressroom/press_releases/3_2006/turing_3_01_2006.cfm >> >>Peter Naur was co-developer of Backus/Naur grammar notation, co-author and >>editor of the Algol 60 specification, and co-developer of a successful >>Algol compiler.

Webhosting python info

2006-03-07 Thread googlinggoogler
Hi, Is there a way in python to have all the modules/ packages availiable to me printed out, like phpinfo (http://uk2.php.net/phpinfo) on my webhosting. Cheers David -- http://mail.python.org/mailman/listinfo/python-list

Re: SAX/Python : read an xml from the end to the top

2006-03-07 Thread Peter Hansen
kepioo wrote: > The input xml I am parsing is always well formed. It is coming out from > another application that append to this xml. I didn't see the source > code of the application, but i know that it is not re-writing the whole > xml. I thinnk it is just removing the last root element, adding

Re: SAX/Python : read an xml from the end to the top

2006-03-07 Thread Diez B. Roggisch
> We don't want to create new output files for every entry ( each entry > is an event, and we have approximativaly 5 events per minute). So I > have to stick with this xml input file. Well, the overall amount of data won't change. But I can understand that decision. However, you might consider usi

Can anyone explain this behaviour (class attribute vs instance lookup)

2006-03-07 Thread Bruno da Silva de Oliveira
Hi all,From what I understand about the lookup semantics of instances and classes, the following is expected:>>> class A(object): pass...>>> A.__module__ '__main__'>>> A().__module__'__main__'IOW, if an attribute is not found in the instance, it is looked-up in class, and if found, returned. Then,

Re: SAX/Python : read an xml from the end to the top

2006-03-07 Thread kepioo
Hi Diez, thank you for your answer. Let me give you more background on the project. The input xml I am parsing is always well formed. It is coming out from another application that append to this xml. I didn't see the source code of the application, but i know that it is not re-writing the whole

Re: Pyserial again

2006-03-07 Thread Peter Hansen
luca72 wrote: > Here is my code ; why after the readline the port close? > What is the line of code before the first one shown here? > ser = serial.Serial(0) > ser.baudrate = 9600 > ser.parity = serial.PARITY_ODD > ser.stopbits = serial.STOPBITS_TWO > ser.

Re: Is this not infinite?

2006-03-07 Thread Peter Hansen
John Salerno wrote: > Kent Johnson wrote: > > >>This should be >> def __init__(self, etc): >> Base.__init__(self, etc...) > > >>It's a typo in the book. > > Thank goodness! At least I know my mind is heading in the right > direction then... :) Which book? Many of the author

Re: It is fun.the result of str.lower(str())

2006-03-07 Thread Christos Georgiou
On Tue, 07 Mar 2006 10:23:59 +0100, rumours say that bruno at modulix <[EMAIL PROTECTED]> might have written: >Now would you be kind enough to explain what's funny about all this ? I would guess it's the statement: "Funny, it works!" -- TZOTZIOY, I speak England very best. "Dear Paul, please s

Re: Compile ui files from within Eclipse

2006-03-07 Thread Fabio Zadrozny
Chuck wrote: >Hello, > >I am new to the Eclipse IDE. > >I am using pydev plug-in to create python projects. > >Is there a way to create custom builders to build certain types of >files? > >I have done this with other IDE's but can't seem to figure it out >with Eclipse. > >I am trying to build *.ui

Re: Checking function calls

2006-03-07 Thread bruno at modulix
James Stroud wrote: (snip) > Since python is "weakly typed", s/weakly/dynamically/ (snip) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: It is fun.the result of str.lower(str())

2006-03-07 Thread bruno at modulix
Sullivan WxPyQtKinter wrote: > Guess what would be the result of these functions: s/functions/method calls/ > str.lower('ASFA') => 'ASFA'.lower() => 'asfa' str.join(str(),['1','1','1']) => ''.join(['1','1','1']) => '111' str.join('a','b') => 'a'.join('b') => 'b' > > If you gue

Re: Pyserial again

2006-03-07 Thread luca72
Here is my code ; why after the readline the port close? ser = serial.Serial(0) ser.baudrate = 9600 ser.parity = serial.PARITY_ODD ser.stopbits = serial.STOPBITS_TWO ser.bytesize =serial.EIGHTBITS ser.setRTS(level = 0) ser.setDTR(level = 0)

Re: popen and exit code on Windows

2006-03-07 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > On UNIX one can use popen* to get a pipe for reading, a pipe for > writing, and the exit code of the child process via a call to close() > on the last pipe. Is there any way, in principle, to simulate such > behaviour on Windows? Some googling reveals that direct use of

Re: SAX/Python : read an xml from the end to the top

2006-03-07 Thread Diez B. Roggisch
kepioo schrieb: > I currently have an xml input file containing lots of data. My objectiv > is to write a script that reports in another xml file only the data I > am interested in. Doing this is really easy using SAX. > > The input file is continuously updated. However, the other xml file > shoul

Re: It is fun.the result of str.lower(str())

2006-03-07 Thread Duncan Booth
Sullivan WxPyQtKinter wrote: > Guess what would be the result of these functions: > str.lower('ASFA') str.join(str(),['1','1','1']) str.join('a','b') > > If you guess them correctly, please explain. I think it was because I've read the manuals. -- http://mail.python.org/mailman/lis

<    1   2   3   >