[Tutor] 5 questions

2006-10-21 Thread Pine Marten
1. Is there a searchable archive of this list? 2. Is there list ettiquette one should be aware of? 3. Besides Vaults of Parnassus, are there other webpages which list projects written in Python? I'm mainly interested in looking at non-technical software, things for the common user to use. I

Re: [Tutor] can i pass a list to a function and get one back ?

2006-10-21 Thread shawn bright
way cool, thanks. I am always looking for ways to clean things up-skOn 10/21/06, Danny Yoo <[EMAIL PROTECTED] > wrote:> great, thanks,  i have idle right here, would have been just as easy. > sorry about thatNo problem; it's cool.>> >   hey there, i was just wondering if i could get a list back fro

[Tutor] 'json' should probably be the response to 'can we use eval to parse { ... }?'

2006-10-21 Thread Danny Yoo
Hi everyone, I ran across the JSON data format today: http://json.org/ with a nice Python implementation in 'simplejson'. http://undefined.org/python/#simple_json The JSON format matches very closely with Python data structure syntax. So the next time someone asks if they can use e

Re: [Tutor] can i pass a list to a function and get one back ?

2006-10-21 Thread Danny Yoo
> great, thanks, i have idle right here, would have been just as easy. > sorry about that No problem; it's cool. >> > hey there, i was just wondering if i could get a list back from a >> > function. >> > something like >> > def return_a_list(some_var): >> > some_list = [] >> >

Re: [Tutor] can i pass a list to a function and get one back ?

2006-10-21 Thread shawn bright
great, thanks,  i have idle right here, would have been just as easy.sorry about thatskOn 10/21/06, Bill Campbell < [EMAIL PROTECTED]> wrote:On Sat, Oct 21, 2006, shawn bright wrote:> >   hey there, i was just wondering if i could get a list back from a>   function.>   something like>   def return_

Re: [Tutor] Exception and sys.exit() in a cgi script

2006-10-21 Thread Paulino
Mike Hansen Mike.Hansen at atmel.com Mon Oct 16 18:43:29 CEST 2006 > This is a peace of a CGI script i have. > > 1 import cgi > 2 form=cgi.FieldStorage() > 3 try : > 4 ano=form["ano"].value > 5 conta=form["conta"].value > 6 except KeyError : > 7 print 'Please

Re: [Tutor] can i pass a list to a function and get one back ?

2006-10-21 Thread Bill Campbell
On Sat, Oct 21, 2006, shawn bright wrote: > > hey there, i was just wondering if i could get a list back from a > function. > something like > def return_a_list(some_var): > some_list = [] > for i in range(5): > var = some_var + i > some_list.append(var) >

[Tutor] can i pass a list to a function and get one back ?

2006-10-21 Thread shawn bright
hey there, i was just wondering if i could get a list back from a function.something likedef return_a_list(some_var):    some_list = []    for i in range(5):    var = some_var + i    some_list.append(var)     return some_listis this cool ?thanks    _

Re: [Tutor] checking for robots on a python script based site

2006-10-21 Thread Kent Johnson
Tsila Hassine wrote: > Hello All! > > I have a site that takes some input from the user and then produces a > dynamic page based on the input. In the last months bots (not only > search engine ones) have been hitting the site pretty heavily, so my sys > admin disabled it. As far as I know there

Re: [Tutor] what is PIL..???

2006-10-21 Thread Tony Cappellini
Also checkout GnuPlot http://www.gnuplot.info/and the Python bindings for ithttp://gnuplot-py.sourceforge.net/ Date: Sat, 21 Oct 2006 14:07:12 +0100From: "Asrarahmed Kadri" <[EMAIL PROTECTED]> Subject: [Tutor] what is PIL..???To: pythontutor Message-ID:        < [EMAIL PROTECTED]>

Re: [Tutor] checking for robots on a python script based site

2006-10-21 Thread Danny Yoo
On Sat, 21 Oct 2006, Tsila Hassine wrote: > 1: write a robots.txt file - but then I'd have to rely on the bots' good > will. > 2: implement a "captcha" mechanism, which I am not sure I want. > > Does Python provide anything to deal with such problems ? I think you're asking the question: "Has a

Re: [Tutor] what is PIL..???

2006-10-21 Thread Alan Gauld
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Yeah, I am looling for bar graphs > If its simple 2D bar graphs they are almost as easy to draw yourself on a Canvas widget using coloured rectangles. The only trickiness is in drawing axes and scales. But its n

Re: [Tutor] what is PIL..???

2006-10-21 Thread Asrarahmed Kadri
Yeah, I am looling for bar graphs   On 10/21/06, Kent Johnson <[EMAIL PROTECTED]> wrote: Asrarahmed Kadri wrote:>> Folks,>> Continuing my journey into "Tkinter world"... >> May I ask someone to tell what PIL is and how can it be helpful in> drawing 2-dimensional graphs...Python Imaging Libr

Re: [Tutor] what is PIL..???

2006-10-21 Thread Kent Johnson
Asrarahmed Kadri wrote: > > Folks, > > Continuing my journey into "Tkinter world"... > > May I ask someone to tell what PIL is and how can it be helpful in > drawing 2-dimensional graphs... Python Imaging Library - just Google PIL. I don't think it will help much with graphs though, if y

Re: [Tutor] PyAlsaAudio with Multiple Sound Cards?

2006-10-21 Thread Michael Lange
On Fri, 20 Oct 2006 18:13:04 -0400 "Rick Sterling" <[EMAIL PROTECTED]> wrote: > > Hi. > > I am pretty new to Python, but am trying to get up to speed so I move over > to Python from Perl. One progam I wrote in Perl I am trying to re-write in > Python. It controls the mixer settings on my soun

Re: [Tutor] what is PIL..???

2006-10-21 Thread Rob Andrews
On 10/21/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > May I ask someone to tell what PIL is and how can it be helpful in drawing > 2-dimensional graphs... PIL = Python Imaging Library PIL provides a bunch of nifty tools for handling images and is well worth a google. -Rob A. ___

[Tutor] what is PIL..???

2006-10-21 Thread Asrarahmed Kadri
Folks,   Continuing my journey into "Tkinter world"...   May I ask someone to tell what PIL is and how can it be helpful in drawing 2-dimensional graphs...   Thanks..   Regards, Asrarahmed-- To HIM you shall return. ___ Tutor maillist - Tutor@pytho

Re: [Tutor] sending mails from python

2006-10-21 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 How about something like this? Create a function and then call it with the required optins of server url, sender address, destination address, subject, and message text? def send(serverURL=None, sender='', to='', subject='', text=''): """ F

Re: [Tutor] sending mails from python

2006-10-21 Thread Python
On Sat, 2006-10-21 at 12:45 +0200, euoar wrote: > I'm trying to learn how to send e-mails with python. But I always become > this error: socket.error: (110, 'Connection timed out'). It sounds like you were unable to connect to the mail server. That could be due to a large number of network issue

Re: [Tutor] Best way to replace items in a list.

2006-10-21 Thread Kent Johnson
Jason Massey wrote: > Why not: > > if item in lst: > loc = lst.index(item) > lst[loc] = str You can also just try to do the replacement and catch the ValueError that is raised if the item is not there: try: loc = list.index(item) list[loc] = str except ValueError: pass If lst is lon

[Tutor] checking for robots on a python script based site

2006-10-21 Thread Tsila Hassine
Hello All!I have a site that takes some input from the user and then produces a dynamic page based on the input. In the last months bots (not only search engine ones) have been hitting the site pretty heavily, so my sys admin disabled it. As far as I know there are 2 options to fight this : 1: wri

[Tutor] sending mails from python

2006-10-21 Thread euoar
I'm trying to learn how to send e-mails with python. But I always become this error: socket.error: (110, 'Connection timed out'). Is there something bad in the code? Does anyone knows what could be wrong? I'm using python from linux, and have no proxy... The code that I use is this (of course,