Re: Uninstalling Python

2006-03-29 Thread Michael Ekstrand
Pete wrote: > Ben Finney wrote: >> "Pete" <[EMAIL PROTECTED]> writes: >> >>> I googled "python" and have no interest in it and know nothing about >>> it. >>> >>> Therefore, I would like to uninstall both the versions since I do >>> not believe I need them. Would it be okay to uninstall them or >>

Re: GUI in python

2006-03-29 Thread Peter Decker
On 29 Mar 2006 14:20:03 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am a python newbie and have used it for about a month. I want to make > a simple GUI app in Python ( I take input form user and do processing > and show results). > > Which gui package is good for me. I need to do it q

Re: a hobbyist's dilemma

2006-03-29 Thread Jim Sizelove
John Salerno wrote: > Now that I've learned much of Python, I'm sort of stuck with what to do > with it. I'm not a professional programmer, so I don't really have a use > for Python now. But I really want to come up with some neat uses for it > (for fun, and so I don't just start forgetting it r

Re: Uninstalling Python

2006-03-29 Thread John Salerno
Robert Kern wrote: > "Why is Python Installed on my Computer?" FAQ: > http://www.python.org/doc/faq/installed/ Most importantly from that link: Some Windows machines also have Python installed. At this writing we're aware of computers from Hewlett-Packard and Compaq that include Python. Appare

Re: is 2.4.3 final?

2006-03-29 Thread John Salerno
Terry Reedy wrote: > "John Salerno" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> I just noticed on one page of the Python website that it said: >> >> "We are pleased to announce the release of Python 2.4.3 (final), a >> bugfix release of Python 2.4, on March 29, 2006." > > I b

Re: a hobbyist's dilemma

2006-03-29 Thread John Salerno
Jim Sizelove wrote: > John Salerno wrote: >> Now that I've learned much of Python, I'm sort of stuck with what to do >> with it. I'm not a professional programmer, so I don't really have a use >> for Python now. But I really want to come up with some neat uses for it >> (for fun, and so I don't

Re: Seems like I want a pre-processor, but...

2006-03-29 Thread Russell Warren
Yes, I definitely should have done that for that case. I'm not entirely sure why I didn't. If I had, though, I may not have been prompted to ask the question and get all the other great little tidbits! -- http://mail.python.org/mailman/listinfo/python-list

Re: Matplotlib: Histogram with bars inside grid lines...how??

2006-03-29 Thread Enigma Curry
Thank you John. Your explanation helped a lot! In case it helps anyone else in the future, here is my code for *exactly* what I was after: import pylab def ryan_hist(data, bar_width, min_x, max_x): """ Create a frequency histogram over a continuous interval min_x = the low end of th

Re: Uninstalling Python

2006-03-29 Thread Pete
John Salerno wrote: > Robert Kern wrote: > >> "Why is Python Installed on my Computer?" FAQ: >> http://www.python.org/doc/faq/installed/ > > Most importantly from that link: > > Some Windows machines also have Python installed. At this writing > we're aware of computers from Hewlett-Packard and Com

Re: Matplotlib: Histogram with bars inside grid lines...how??

2006-03-29 Thread Enigma Curry
pylab.xlim(0.5,6.5) should be: pylab.xlim(min_x-(bar_width/2),max_x+(bar_width/2)) -- http://mail.python.org/mailman/listinfo/python-list

Re: a hobbyist's dilemma

2006-03-29 Thread Ravi Teja
I don't have any dearth of Python needs ( I now, sort of pay my tuition through Python :-) ). But I use it for fun as well, say gaming. For example, I have scripts that send keystrokes based on voice commands or other keystrokes. Having a productive language like Python at your disposal can help a

Re: Seems like I want a pre-processor, but...

2006-03-29 Thread Michael Tobis
Well, Bill Mill and I simultaneously and independently decided to write a preprocessor to strip out the unfortunate "@" decorator syntax. I think we were both aiming at a polemic purpose rather than a practical one, but as time fades it seems less clear what we were simultaneously inspired to achie

Re: GUI in python

2006-03-29 Thread riplin
For quick, no learning curve, simple: http://www.ferg.org/easygui/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Try Python!

2006-03-29 Thread Armin Ronacher
BartlebyScrivener wrote: > Armin, > > Mike Meyer already took a crack at this, and his starts right up just > by clicking on the link. > > http://www.mired.org/home/mwm/try_python/ Hm. Looks not that useful since you can't create any functions and you can remove the prompt :-) > Yours looks pretti

Re: Matplotlib: Histogram with bars inside grid lines...how??

2006-03-29 Thread John Hunter
> "Enigma" == Enigma Curry <[EMAIL PROTECTED]> writes: Enigma> pylab.xlim(0.5,6.5) should be: Enigma> pylab.xlim(min_x-(bar_width/2),max_x+(bar_width/2)) Glad it's working better for you -- just a couple more smallish hints. You might prefer to have your grid lines behind, rather th

Re: Try Python!

2006-03-29 Thread Serge Orlov
Michael Tobis wrote: > We had some discussion of this in the edu-sig meeting at PyCon. > > I alleged that I had read that there is no such thing as a Python > sandbox. Others claimed that one could simply preprocess and disallow > "dangerous" constructs. My allegation was based on an argument from

List conversion

2006-03-29 Thread yawgmoth7
Hello, I have a piece of code: command = raw_input("command> ") words = string.split(command, ' ') temparg = words if len(words)<= 3: temparg = words[4:] else: tempar

Re: Try Python!

2006-03-29 Thread Ben Finney
"Michael Tobis" <[EMAIL PROTECTED]> writes: > So what is the scoop? Why does Guido say there is no such thing as a > secure Python, and (as is generally reasonable) presuming he is correct > on the matter, how can these sites work safely? "Security is a process, not a product." There's no such

Re: python challenge question (string manipulation)

2006-03-29 Thread Caleb Hattingh
Terry That is very succint. Rewriting my shift function given earlier: >>> import string >>> alpha = string.ascii_lowercase >>> print alpha abcdefghijklmnopqrstuvwxyz >>> def shift(lst, n): return [lst[(i+len(lst)-n)%len(lst)] for i,item in enumerate(lst)] >>> print shift(alpha,2) ['y',

Re: Simple py script to calc folder sizes

2006-03-29 Thread Caleb Hattingh
Hi John Your code works on some folders but not others. For example, it works on my /usr/lib/python2.4 (the example you gave), but on other folders it terminates early with StopIteration exception on the os.walk().next() step. I haven't really looked at this closely enough yet, but it looks as

Re: excel application

2006-03-29 Thread luca72
Thanks Peter Regards Luca -- http://mail.python.org/mailman/listinfo/python-list

dynamic construction of variables / function names

2006-03-29 Thread Sakcee
python provides a great way of dynamically creating fuctions calls and class names from string a function/class name can be stored as string and called/initilzed e.g def foo(a,b): return a+b def blah(c,d): return c*d list = ["foo", "blah"] for func in list: print func(2,4) o

difference between .cgi and .py

2006-03-29 Thread amaltasb
Hi, I am new to python.. I have uploaded few scripts in my cgi-bin folder, some with extension .cgi and some with .py. What is the difference between the two extensions.. which one is more prefered, do it effects performance ?? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic construction of variables / function names

2006-03-29 Thread limodou
On 29 Mar 2006 22:44:24 -0800, Sakcee <[EMAIL PROTECTED]> wrote: > python provides a great way of dynamically creating fuctions calls and > class names from string > > a function/class name can be stored as string and called/initilzed > > e.g > > def foo(a,b): > return a+b > > def blah(c,d): >

Re: python challenge question (string manipulation)

2006-03-29 Thread Felipe Almeida Lessa
Em Qua, 2006-03-29 às 22:20 -0800, Caleb Hattingh escreveu: > That is very succint. Rewriting my shift function given earlier: > > >>> import string > >>> alpha = string.ascii_lowercase > >>> print alpha > abcdefghijklmnopqrstuvwxyz > >>> def shift(lst, n): > return [lst[(i+len(lst)-n)%len(

Re: dynamic construction of variables / function names

2006-03-29 Thread Felipe Almeida Lessa
Em Qua, 2006-03-29 às 22:44 -0800, Sakcee escreveu: > either eval or exec should be used > is it correct way, is there a simple way, is this techniqe has a name? eval and exec are insecure. Try looking at globals(): $ python2.4 Python 2.4.3c1 (#2, Mar 29 2006, 08:34:35) [GCC 4.0.3 (Debian 4.0.3-1

does python could support sequence of short or int?

2006-03-29 Thread momobear
hi, is there a way to let python operate on sequence of int or short? In C, we just need declare a point, then I could get the point value, just like: short* k = buffer, //k is a point to a sequence point of short. short i = *k++, but python is a dynamic language, a = buffer i = ? I don't know how

Re: dynamic construction of variables / function names

2006-03-29 Thread Duncan Booth
Sakcee wrote: > python provides a great way of dynamically creating fuctions calls and > class names from string > > a function/class name can be stored as string and called/initilzed > > e.g > > def foo(a,b): > return a+b > > def blah(c,d): > return c*d > > > list = ["foo", "blah"]

Re: difference between .cgi and .py

2006-03-29 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > I am new to python.. I have uploaded few scripts in my cgi-bin > folder, some with extension .cgi and some with .py. > > What is the difference between the two extensions.. None at all, except the way you write them. > which one is more prefered That depe

Re: any() and all() on empty list?

2006-03-29 Thread Duncan Booth
Ron Adam wrote: > Where we are assembling widgets in a manufacturing plant. Where we don't > want to go to the next step until *all* the sub parts are present. > > if all(part.status == 'present' for part in unit): > do_release() > > Oops! Some empty bins showed up at the next assembly st

Re: dynamic construction of variables / function names

2006-03-29 Thread Steven D'Aprano
Sakcee wrote: > python provides a great way of dynamically creating fuctions calls and > class names from string > > a function/class name can be stored as string and called/initilzed > > e.g > > def foo(a,b): > return a+b > > def blah(c,d): > return c*d > > > list = ["foo", "blah"]

Re: difference between .cgi and .py

2006-03-29 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > Hi, > I am new to python.. I have uploaded few scripts in my cgi-bin folder, > some with extension .cgi and some with .py. Only how the Web server is configured. > What is the difference between the two extensions.. which one is more > prefered, do it effects performanc

Re: any() and all() on empty list?

2006-03-29 Thread Steven D'Aprano
Tim Peters wrote: >>In the all() example, if there *are* no values in S, then none of the >>values can be != 0, and IMHO all() should return False. > > > That would break everything mentioned above. Think of it another way: > if all(seq) is false, shouldn't it be the case that you can point to

i have error then use ftplib

2006-03-29 Thread Леонов Алексей
Hello! I use this code: from ftplib import FTP def handleDownload(block): file.write(block) print "." file = open('1', 'wb') ftp = FTP('ftp.utk.ru') ftp.set_pasv(1) ftp.login() ftp.retrlines('LIST') ftp.cwd('users/video/Anime/Beyond the Clouds') ftp.retrbinary('RETR "[Triad]_Beyond_th

<    1   2   3