Re: New python.org website

2006-03-07 Thread Kay Schluehr
Steven Bethard wrote: > 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

Re: Pyserial again

2006-03-07 Thread luca72
Dear All Thanks for your help, and patience. Now all works in the right mode. Belive me for a person of my age and my background ( i'm a physics, but at my time no computer was allowed) all that for you is simple, is not for me. So many Thanks and Regards Luca -- http://mail.python.org/mailman/

Re: suse linux 10 and wx.listctrl display issues

2006-03-07 Thread ianaré
hum finally did find some SuSE specific RPM's through yast by setting the media directory to mirros.kernel.org. Cool. But still the same thing happens... -- http://mail.python.org/mailman/listinfo/python-list

Re: New python.org website

2006-03-07 Thread Steven Bethard
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: how to download a zip or rar file to local machine using python?

2006-03-07 Thread dongdong
thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading binary from a file...

2006-03-07 Thread Steve Holden
KraftDiner wrote: > Hi! > In python I'm able to read in binary data from a file. > data = file.read() # Reads in an entire file. > Note that you should open the file in binary mode to be platform-agnostic and as portable as possible. (Just in case you aren't). > However the data is 16bits per s

suse linux 10 and wx.listctrl display issues

2006-03-07 Thread ianaré
hey, Having some problems getting wxpython apps to look right on SuSE 10.0 and KDE 3.4. There are no RPMs that i could find so I built my own from source. First time using 'default' settings - GTK 2.x and unicode: rpmbuild -tb --define 'pyver 2.4' --define 'port gtk2' \ --define 'unicode 1' wxPyt

Re: Python advocacy in scientific computation

2006-03-07 Thread Steve Holden
Andy Salnikov wrote: > "Michael Tobis" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>>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.

Re: New python.org website

2006-03-07 Thread Kay Schluehr
Michael wrote: > The new website is to blah. It's so light colored across the whole thing > that it kind of just melts away in my mind. Maybe giving a little color > in the menu bar on the right would help. My experience is that white is > a bad background color when over used. I agree. The text i

Re: asynchat - operation could not complete w/ blocking

2006-03-07 Thread Andreas R.
Fredrik Lundh wrote: > "Andreas R." wrote: > >> I'm using Python's asynchat module for networking. >> When calling the sendall() method of asynchat, >> I sometimes get the error message "the operation >> could not complete without blocking". > > what sendall method ? to get proper output bufferi

Re: Send email notification

2006-03-07 Thread Steve Holden
Ernesto wrote: > I guess that was jerk-off version of: > > "smtplib" > > Thanks a lot. > Well, it gave you the information you wanted, right? (Except that it might have mentioned the "email" package, which would help you formulating the messages as well. But that which doesn't kill us makes u

Re: how to download a zip or rar file to local machine using python?

2006-03-07 Thread dongdong
but I want to ask: how to find out explaination about the parameters of 'open()' function? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to download a zip or rar file to local machine using python?

2006-03-07 Thread dongdong
thank james; and I have got a way to resolve it : urllib.urlretrieve('http://x.x.x.x/library.zip','library.zip') -- http://mail.python.org/mailman/listinfo/python-list

Re: inserting into a list

2006-03-07 Thread Steve Holden
Steven D'Aprano wrote: > On Tue, 07 Mar 2006 12:26:00 -0800, James Stroud 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

Reading binary from a file...

2006-03-07 Thread KraftDiner
Hi! In python I'm able to read in binary data from a file. data = file.read() # Reads in an entire file. However the data is 16bits per sample and python is storing the data in a string. How do I convert that 8bit data into a list of 16 bit integers? Note: I want generic python lists or tupels

Re: how to download a zip or rar file to local machine using python?

2006-03-07 Thread James Stroud
dongdong wrote: > I wrote as following: > content=urllib2.urlopen("http://www.sdfagfa.org/asasg/a.zip";).read() > f=open("d:\\a.zip",'a+',1) > f.writelines(content) > > the zip file has been download to my machine,but when be unzip , error > occurs: > " there is an error at the end of the f

Re: asynchat - operation could not complete w/ blocking

2006-03-07 Thread Fredrik Lundh
"Andreas R." wrote: > I'm using Python's asynchat module for networking. > When calling the sendall() method of asynchat, > I sometimes get the error message "the operation > could not complete without blocking". what sendall method ? to get proper output buffering with asynchat, use "push" (or

how to download a zip or rar file to local machine using python?

2006-03-07 Thread dongdong
I wrote as following: content=urllib2.urlopen("http://www.sdfagfa.org/asasg/a.zip";).read() f=open("d:\\a.zip",'a+',1) f.writelines(content) the zip file has been download to my machine,but when be unzip , error occurs: " there is an error at the end of the file" -- http://mail.python.org

Re: linux clipboard?

2006-03-07 Thread Andrew Gwozdziewycz
On Mar 7, 2006, at 10:00 PM, [EMAIL PROTECTED] wrote: > ah.. ok. > gnome it is. > > are there py commands for gnome? > Since gnome uses gtk, you're best bet would be to check the pygtk documentation --- Andrew Gwozdziewycz [EMAIL PROTECTED] http://ihadagreatview.org http://and.rovir.us --

sending a text message via webpage button

2006-03-07 Thread John
Can anyone help me in coding a script that can send a text message typed to the script like. sendmessage 6318019564 "test message" What I want to do is fill up this information on this webpage http://www.cingularme.com/do/public/send;jsessionid=aKDwXM1S0Reh and click the submit button using the

Re: generators shared among threads

2006-03-07 Thread Alex Martelli
Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > The main problem with this is that the yield leaves the lock locked. > > If any other thread wants to read the generator it will block. > > Ouch, good catch. Do you see a good fix other than try/finally? > Is there a c

Re: linux clipboard?

2006-03-07 Thread david . humpherys
ah.. ok. gnome it is. are there py commands for gnome? -- http://mail.python.org/mailman/listinfo/python-list

Re: AES encryption

2006-03-07 Thread Tuvas
Ere, I mean testing only symetrical keys, and symetrical messages, nothing more realistic. Sigh. Oh well. It works, and that's the important thing. I don't know if I'll put in support for the larger key sizes, but, I'll leave it be for now. -- http://mail.python.org/mailman/listinfo/python-list

Re: AES encryption

2006-03-07 Thread Tuvas
Okay, I figured out the problem. The problem was that my algorythm filed the numbers into the matrix as so: 1 2 3 4 5 6 7 8... While it should have been 1 5 9 13 2 6 10 14 ... When this was fixed, the program works great! That's what I get for testing only asymetrical keys... Oh well, thanks for

Re: generators shared among threads

2006-03-07 Thread Paul Rubin
[EMAIL PROTECTED] writes: > The main problem with this is that the yield leaves the lock locked. > If any other thread wants to read the generator it will block. Ouch, good catch. Do you see a good fix other than try/finally? Is there a classical way to do it with coroutines and semaphores? --

Re: Opening files without closing them

2006-03-07 Thread Bryan
Peter Hansen wrote: > 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

Re: linux clipboard?

2006-03-07 Thread david . humpherys
ah.. ok. gnome it is. are there py commands for gnome? -- http://mail.python.org/mailman/listinfo/python-list

Interpreting python profiler results

2006-03-07 Thread Will Ware
I'm working on a piece of software that uses PyQt and PyOpenGL for drawing acceleration. While profiling it to find opportunities to speed things up, I got this from the profiler: ncalls tottime percall cumtime percall filename:lineno(function) 12108/12084 55.3900.005 55.3900.00

Re: deriving from complex

2006-03-07 Thread Schüle Daniel
thank you I will have to take a closer look on __new__ Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Basic Python FTP Question

2006-03-07 Thread Bob Piton
I have just discovered how to do ftp with python, and have a question about using macdef. I can connect to the ftp site, using the .netrc file: machine my.ftpsite.com login myuserid password mypass macdef dload cd maindir get myfile and the python command: cmdline = "ftp my.ftpsite.com" % () o

Re: Cryptographically random numbers

2006-03-07 Thread Paul Rubin
Tim Hochberg <[EMAIL PROTECTED]> writes: > > is fast, but if a is aliased, Python can't do the optimization, so > Is this really true? After the first time through the loop, 'a' won't > be aliased any more since strings are immutable. Hmm, ok, there was some previous discussion of this problem a

Re: Python universal binary for OSX

2006-03-07 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hello everyone, > > I recently made the plunge to an mactel platform because, well, it was > new laptop time. I have a few python projects I need to get going and, > for the most part, things are a-ok. I have been using a source > compiled copy of 2.4.2. I feel slight

Announcing atomfeed.py, xmlelements.py, and feedutils.py

2006-03-07 Thread Steve R. Hastings
I have written some Python library modules to help with creating Atom syndication feeds. Originally, I had a single module called "PyAtom"; now I have split it up into three modules: xmlelements.py, atomfeed.py, and feedutils.py. You can download these modules from here: http://home.blarg.net/~s

Re: reshape a list?

2006-03-07 Thread KraftDiner
I'm wondering if your solution fits my requirements I need to be able to pass these objects which are python lists to a pyObjC (on MAC OS X) framework. At the moment the framework is expecting NSArray or NSData as input and this works for 'generic' python lists I don't know about numpy arr

Python universal binary for OSX

2006-03-07 Thread [EMAIL PROTECTED]
Hello everyone, I recently made the plunge to an mactel platform because, well, it was new laptop time. I have a few python projects I need to get going and, for the most part, things are a-ok. I have been using a source compiled copy of 2.4.2. I feel slightly uncomfortable doing this, mainly b

Re: Type Hinting vs Type Checking and Preconditions

2006-03-07 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > You can look at this, its API looks very well thought out to me: > > http://oakwinter.com/code/typecheck/ > > > >> Now, on the other hand, if we were to introduce a purely option

Re: Type Hinting vs Type Checking and Preconditions

2006-03-07 Thread Paul Boddie
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > "Tom Bradford" <[EMAIL PROTECTED]> wrote: > > > > def multiplyByTwo(value): > > return value * 2 [...] > The question is, what is the function *supposed to do*? Without knowing > what it is *supposed to do*, it is impossible to say for su

Re: generators shared among threads

2006-03-07 Thread jess . austin
Paul wrote: >def f(): >lock = threading.Lock() >i = 0 >while True: >lock.acquire() >yield i >i += 1 >lock.release() > > but it's easy to make mistakes when implementing things like that > (I'm not even totally confident tha

Re: New python.org website

2006-03-07 Thread Michael
The new website is to blah. It's so light colored across the whole thing that it kind of just melts away in my mind. Maybe giving a little color in the menu bar on the right would help. My experience is that white is a bad background color when over used. -- Michael McGlothlin, tech monkey Tub

Re: Learning different languages

2006-03-07 Thread Michael
> Anyway, my question is: what experience you people have with working > with different languages at the same time? > To me, it makes sense to use the best language for any given task and that isn't always the same language (great as Python is). Certainly web developers work in many different

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

2006-03-07 Thread kepioo
An example ( i changed the content to make it easier) : ### input file 3 fruits 5 10 25 names vincent Robert open the car fruits 25 8

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

2006-03-07 Thread kepioo
An example ( i changed the content to make it easier) : ### input file 3 fruits 5 10 25 names vincent Robert open the car fruits 25 8

Re: Cryptographically random numbers

2006-03-07 Thread Tim Hochberg
Paul Rubin wrote: > "Tuvas" <[EMAIL PROTECTED]> writes: > >>I've actually done the tests on this one, it's actually faster to use >>the += than a list, odd as it may sound. > > > Frederik explained the reason; there's an optimization in Python 2.4 > that I'd forgotten about, for that specific c

Re: deriving from complex

2006-03-07 Thread Scott David Daniels
Schüle Daniel wrote: ... > btw I like how Ruby handles the creation of complex numbers > > c = Complex(1,1) > p = Complex.polar(1,45.0/360*2*PI) class Complex(complex): @classmethod def polar(class_, radius, angle): return class_(radius * cos(angle), radius * sin(angle)) --Sco

Re: deriving from complex

2006-03-07 Thread Scott David Daniels
Scott David Daniels wrote: > Schüle Daniel wrote: >> ... And, of course, I reply with a cutto-pasto (pre-success code). > ... > Which will produce instances of Complex, or: > class Complex(complex): > def __new__(class_, x, y=0.0, polar=False): > if polar: >

Re: Type Hinting vs Type Checking and Preconditions

2006-03-07 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Tom Bradford" <[EMAIL PROTECTED]> wrote: > Here is what I mean. The following function, though conventionally > indicating that it will perform a multiplication, will yield standard > Python behaviors if a string value is passed to it: > > def multiplyByTwo(valu

Re: deriving from complex

2006-03-07 Thread Scott David Daniels
Schüle Daniel wrote: > I am trying to customize the handling of complex numbers > what I am missing is a builtin possibility to create > complex numbers in polar coordinates I wrote...: > >>> def polar(r,arg): > ... re, im = r*cos(arg), r*sin(arg) > ... return re + im*1j > then I tried

Re: Python advocacy in scientific computation

2006-03-07 Thread Andy Salnikov
"Michael Tobis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> 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

Re: Any advantage in LISPs having simpler grammars than Python?

2006-03-07 Thread Douglas Alan
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2006-03-07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> Is there any advantage to a language having a nice mathematically >> compact grammar like LISP does? (or at least used to?) Yes, Lisp's syntax allows for a very powerful macro mechanism tha

Re: Any advantage in LISPs having simpler grammars than Python?

2006-03-07 Thread Paul Rubin
Douglas Alan <[EMAIL PROTECTED]> writes: > Experienced Lisp programmers use indentation to visually parse the > program structure, just like Python programmers do for Python. > Experienced Lisp programmers learn to not see the parentheses when > they don't need to. The OP might find this interest

Re: Type Hinting vs Type Checking and Preconditions

2006-03-07 Thread Jay Parlar
On Mar 7, 2006, at 1:32 PM, Tom Bradford wrote: > > Let me first say that I'm sure that this subject has come up before, > and so forgive me for beating a dead horse. Secondly, let me say that > Python's strength is its dynamic nature, and I don't believe that it > should ever require a precondit

Re: deriving from complex

2006-03-07 Thread Schüle Daniel
what do you think of this design? >>> def polar(x,y=None): ... if type(x) in (list,tuple) and len(x) == 2 and y is None: ... return complex(x[0]*cos(x[1]), x[0]*sin(x[1])) ... if type(x) is complex and y is None: ... return (abs(x), atan2(x.imag,x.real)) ... if

Re: Learning different languages

2006-03-07 Thread gene tani
Rich wrote: > Hi, > > (this is a probably a bit OT here, but comp.lang seems rather > desolated, so I'm not sure I would get an answer there. And right now > I'm in the middle of learning Python anyway so...) > > Anyway, my question is: what experience you people have with working > with different

Re: Learning different languages

2006-03-07 Thread Roy Smith
Rich <[EMAIL PROTECTED]> wrote: > Anyway, my question is: what experience you people have with working > with different languages at the same time? At one point, I was working with Perl, Python, Tcl, and C++ all more or less at the same time. I just kept crib sheets handy, so I could look up sy

Re: Any advantage in LISPs having simpler grammars than Python?

2006-03-07 Thread Douglas Alan
Terry Hancock <[EMAIL PROTECTED]> writes: > I think experienced Lisp programmers must learn to visually parse > the *words* in the Lisp program to determine the structure, but I > find that really unhelpful, myself. Experienced Lisp programmers use indentation to visually parse the program struct

deriving from complex

2006-03-07 Thread Schüle Daniel
Hello I am trying to customize the handling of complex numbers what I am missing is a builtin possibility to create complex numbers in polar coordinates so first I wrote a standalone function >>> def polar(r,arg): ... re, im = r*cos(arg), r*sin(arg) ... return re + im*1j then I tried t

Re: linux clipboard?

2006-03-07 Thread Rene Pijlman
[EMAIL PROTECTED]: >how can i copy text to the linux clipboard? Linux is an operating system. It doesn't have a clipboard. The clipboard is provided by desktop frameworks, such as KDE or Gnome. -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning different languages

2006-03-07 Thread rtilley
Rich wrote: > Anyway, my question is: what experience you people have with working > with different languages at the same time? IMO, it's a good idea. Currently, I'm using Python and Ruby. I'll write something in one and then try it in the other. I know Python better than Ruby, so it's a learni

Re: Learning different languages

2006-03-07 Thread Terry Hancock
On Tuesday 07 March 2006 04:44 pm, Rich wrote: > Anyway, my question is: what experience you people have with working > with different languages at the same time? Invariably, you will occasionally confuse one with the other, which is a penalty you already know, I'm sure. OTOH, it will reduce your

Re: Learning different languages

2006-03-07 Thread [EMAIL PROTECTED]
Rich wrote: > Anyway, my question is: what experience you people have with working > with different languages at the same time? At any given time, I'm doing a fair amount of Python and C work. I also do a lot of bash scripting for supporting frameworks. Beyond that I use a fair number of domain-

Re: Any advantage in LISPs having simpler grammars than Python?

2006-03-07 Thread Terry Hancock
On Tuesday 07 March 2006 04:21 pm, [EMAIL PROTECTED] wrote: > Is there any advantage to a language having a nice mathematically > compact grammar like LISP does? (or at least used to?) > Many have admired the mathematically simple grammar of LISP > in which much of the language is built up from con

asynchat - operation could not complete w/ blocking

2006-03-07 Thread Andreas R.
Hi again, I'm using Python's asynchat module for networking. When calling the sendall() method of asynchat, I sometimes get the error message "the operation could not complete without blocking". So how do I enable blocking with synchat, or otherwise fix this error? Thanks for the help I've recei

linux clipboard?

2006-03-07 Thread david . humpherys
how can i copy text to the linux clipboard? I've seen a number of posts explain how to do it with tk is this the only way? (i'm not using tk as my gui tool kit.) many thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Cryptographically random numbers

2006-03-07 Thread Paul Rubin
"Tuvas" <[EMAIL PROTECTED]> writes: > I've actually done the tests on this one, it's actually faster to use > the += than a list, odd as it may sound. Frederik explained the reason; there's an optimization in Python 2.4 that I'd forgotten about, for that specific case. It's not in earlier versio

RE: Learning different languages

2006-03-07 Thread Delaney, Timothy (Tim)
Rich wrote: > I'm more thinking about Python, PHP, C++, Perl, Euphoria, which are > languages I'm thinking of learning now. They look much more like each > other than basic and MC, at places some even share the exact same > syntax it seems, so your brain might get confused with what language > you

Re: Peter Naur wins ACM Turing Award

2006-03-07 Thread Colin J. Williams
Kay Schluehr wrote: > Colin J. Williams wrote: > > >>Without detracting from the last sentence, I disagree. >> >>Peter Naur's honour is long overdue. >> >>Colin W. > > > Sometimes it's hard for me to figure out about what somebody else > disagrees with me in particular when I agree with him. Ka

Learning different languages

2006-03-07 Thread Rich
Hi, (this is a probably a bit OT here, but comp.lang seems rather desolated, so I'm not sure I would get an answer there. And right now I'm in the middle of learning Python anyway so...) Anyway, my question is: what experience you people have with working with different languages at the same tim

Re: Type Hinting vs Type Checking and Preconditions

2006-03-07 Thread bearophileHUGS
Delaney, Timothy (Tim): > Search for `python optional static typing` for discussions - the first > two links from Google are blog entries by Guido from a year ago (there's > also a third one linked from PEP 3000). I am sorry. Yes, I have read those posts about a year ago, and I remember most of th

Re: New python.org website

2006-03-07 Thread Brain Murphy
I dont know, when i went to the web site i wasent sure i was in the right place, i prefer the old web site, it (no pun intendid) said Python all over it. the logog was good and i had no trouble finding anything when i first went there. BrianMichael Tobis <[EMAIL PROTECTED]> wrote: While the new o

Re: Type Hinting vs Type Checking and Preconditions

2006-03-07 Thread Tom Bradford
Thanks for the info... Kinda comforting that Guido's syntactic ideas were somewhat similar to my own. -- http://mail.python.org/mailman/listinfo/python-list

Re: Any advantage in LISPs having simpler grammars than Python?

2006-03-07 Thread Grant Edwards
On 2006-03-07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is there any advantage to a language having a nice mathematically > compact grammar like LISP does? (or at least used to?) Yes. Grammars like LISP's make it easy for programs to generate and read code. Grammars like Python's make it e

Re: Cryptographically random numbers

2006-03-07 Thread Steven D'Aprano
On Tue, 07 Mar 2006 22:32:04 +0100, Fredrik Lundh wrote: >> Python lists have a special efficiency hack so that ret.append doesn't >> copy the whole list around, but rather, allocates space in bigger >> chunks so that appending usually takes constant time. > > in 2.4 and later, += on strings does

Any advantage in LISPs having simpler grammars than Python?

2006-03-07 Thread [EMAIL PROTECTED]
Is there any advantage to a language having a nice mathematically compact grammar like LISP does? (or at least used to?) Many have admired the mathematically simple grammar of LISP in which much of the language is built up from conses IIRC. Python's grammar seems complicated by comparison. Is th

Re: Send email notification

2006-03-07 Thread rtilley
Ernesto wrote: > Is there a special module for mail ? > > I'd like to send an email [to 'n' unique email addresses] from a python > script. from email.MIMEText import MIMEText import email.Utils import smtplib # 'users' is a list of email addys. for u in users: try

Re: inserting into a list

2006-03-07 Thread Steven D'Aprano
On Tue, 07 Mar 2006 12:26:00 -0800, James Stroud 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

RE: Type Hinting vs Type Checking and Preconditions

2006-03-07 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > You can look at this, its API looks very well thought out to me: > http://oakwinter.com/code/typecheck/ > >> Now, on the other hand, if we were to introduce a purely optional >> type hint to the function prototype, such as follows: >> def multiplyByTwo(value:int): retur

Re: Cryptographically random numbers

2006-03-07 Thread Tuvas
I've actually done the tests on this one, it's actually faster to use the += than a list, odd as it may sound. I ran into this one a while back. The best way to do it is to build an array from scratch, fill the array, and then join it, but I didn't have time to do it that way... -- http://mail.py

Re: Type Hinting vs Type Checking and Preconditions

2006-03-07 Thread bearophileHUGS
You can look at this, its API looks very well thought out to me: http://oakwinter.com/code/typecheck/ > Now, on the other hand, if we were to introduce a purely optional type > hint to the function prototype, such as follows: > def multiplyByTwo(value:int): return value * 2 I don't think Python w

Re: Problem with dbi, odbc module and Oracle 9.2 - suffixed "L" with number data type

2006-03-07 Thread dananrg
Thanks Andrew. > I've been bugging ESRI about upgrading, and I'm sure others have too. The beta of ArcGIS Desktop 9.2 ships with Python 2.4, so I imagine the release of ArcGIS Desktop 9.2 this summer will also ship with Python 2.4. I've read threads recently on the geoprocessing / scripting suppo

Re: Cryptographically random numbers

2006-03-07 Thread Fredrik Lundh
Paul Rubin wrote: > The usual Python idiom for building up a string in approx linear time > is: > >def cstring(n): > ret = [] > while (something): > ret.append(generate_another_character()) > return ''.join(ret) > > Python lists have a special efficiency hack so that

Re: ODBC module and strange date reference <...>

2006-03-07 Thread dananrg
Magnus Lycka wrote: > Are you using an old version of ESRI software, or are > they shipping a product with an ancient version of Python? We're using the latest and greatest ArcGIS Desktop product, which is at release 9.1. Evidently they chose to use Python 2.1 to ensure a "silent install" when Arc

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

2006-03-07 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I'm not 100% sure what is a library in python. Technically, nothing. > > string.replace() I'm 90% sure is a function in the string module. it is. > However something like this: > foo = "bar" > foo.Capitalize() s/C/c/ > bar.capitalize is a method. ...which is usu

Re: Cryptographically random numbers

2006-03-07 Thread Paul Rubin
"Tuvas" <[EMAIL PROTECTED]> writes: > from os import urandom > def cstring(bytes): > ret='' > while(len(ret) c=os.urandom(1) > if c>'0' and c<'z': > ret=ret+c > return ret > > That should do it, though I bet there might be a more efficient way. One efficie

Re: Cryptographically random numbers

2006-03-07 Thread Tuvas
I will admit though, I have the same question as Paul, why do you want a random string of numbers, letters, and symbols? But, you asked for it, so, that'll do. -- http://mail.python.org/mailman/listinfo/python-list

Re: Send email notification

2006-03-07 Thread Larry Bates
Ernesto wrote: > Is there a special module for mail ? > > I'd like to send an email [to 'n' unique email addresses] from a python > script. > > Thanks ! > This class makes what you want to do extremely easy. http://motion.sourceforge.net/related/send_jpg.py -Larry Bates -- http://mail.pytho

Type Hinting vs Type Checking and Preconditions

2006-03-07 Thread Tom Bradford
Let me first say that I'm sure that this subject has come up before, and so forgive me for beating a dead horse. Secondly, let me say that Python's strength is its dynamic nature, and I don't believe that it should ever require a precondition scaffolding. With that said, I do believe that somethin

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

2006-03-07 Thread Bruno Desthuilliers
Laszlo Zsolt Nagy a écrit : > 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 ar

Re: Peter Naur wins ACM Turing Award

2006-03-07 Thread James Stroud
Kay Schluehr wrote: > Colin J. Williams wrote: > > >>Without detracting from the last sentence, I disagree. >> >>Peter Naur's honour is long overdue. >> >>Colin W. > > > Sometimes it's hard for me to figure out about what somebody else > disagrees with me in particular when I agree with him. >

Re: inserting into a list

2006-03-07 Thread John Salerno
James Stroud wrote: > Here is one my favorite examples of python intuitiveness: > > if something is not something_else: > do_whatever() > > Who would have thunk it? That's actually one of the things that first surprised me about Python, that you can actually say "is not" in a programming lan

Re: inserting into a list

2006-03-07 Thread James Stroud
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 tha

Re: Pyserial again

2006-03-07 Thread Grant Edwards
On 2006-03-07, Peter Hansen <[EMAIL PROTECTED]> wrote: > Serial ports aren't trivial, and combining them with a GUI > program written by a rookie is a pretty big order. You can > learn enough to figure this out, but it will be lots of work > and a challenge. If you're up to it, please go read th

Re: AES encryption

2006-03-07 Thread Tuvas
I don't know if it means anything, but the AES system that I have isn't set up to do anything other than 128 bit encryption at the moment, nor will it likely do so, mainly because most systems only explain how to get the 128 encryption, and not the larger sizes. I'm sure it's fairly easy to change,

Re: Cryptographically random numbers

2006-03-07 Thread Gervasio Bernal
Tuvas wrote: > from os import urandom > def cstring(bytes): > ret='' > while(len(ret) c=os.urandom(1) > if c>'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

Re: Cryptographically random numbers

2006-03-07 Thread Paul Rubin
Gervasio Bernal <[EMAIL PROTECTED]> writes: > How can I generate a random string containing digits, symbols and > letters? I will use this random string for the key of a cryptographic > algorithm. Generally if this is a string that some human user has to type in, it's preferable to select some wor

Re: Peter Naur wins ACM Turing Award

2006-03-07 Thread Kay Schluehr
Colin J. Williams wrote: > Without detracting from the last sentence, I disagree. > > Peter Naur's honour is long overdue. > > Colin W. Sometimes it's hard for me to figure out about what somebody else disagrees with me in particular when I agree with him. Is it possible that Peter Naur was forg

Re: generators shared among threads

2006-03-07 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > > g=itertools.count() > > I believe that in the current implementation you'd get "lucky", but > there is no guarantee that such luck would persist across even a minor > bugfix in the implementation. Don't do it. I remember being told that xrange(sys.ma

BayPIGgies: March 9, 7:30pm (Google)

2006-03-07 Thread Aahz
The next meeting of BayPIGgies will be Thurs, March 9 at 7:30pm at Google. This meeting features a PyCon report from Guido van Rossum and possibly others. BayPIGgies meetings alternate between IronPort (San Bruno, California) and Google (Mountain View, California). For more information and dire

Re: Send email notification

2006-03-07 Thread Ernesto
I guess that was jerk-off version of: "smtplib" Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: Compile ui files from within Eclipse

2006-03-07 Thread Fabio Zadrozny
Chuck wrote: >I guess I could prompt for input but was hoping to find a better way. > > > Well, what we usually do here is creating a simple python script (in our case build_ui) which receives something that Eclipse can give you (we use a folder, so that it builds all the .ui files below that

Re: Send email notification

2006-03-07 Thread Laszlo Zsolt Nagy
Ernesto wrote: >Is there a special module for mail ? > >I'd like to send an email [to 'n' unique email addresses] from a python >script. > > http://www.justfuckinggoogleit.com/search.pl?python+smtp -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >