Re: [Tutor] Scraping gov site: site looking for Flash player

2010-04-05 Thread Benno Lang
On 6 April 2010 03:31, Roy Hinkelman wrote: > I am using urllib2 to open some government pages, and they have some js > checking for Flash on my computer. > Is there a way to show them that I have flash? Or possibly another solution? >From reading the JavaScript, you should fetch the URL domain.t

Re: [Tutor] python magazine

2010-03-26 Thread Benno Lang
On 27 March 2010 00:33, Lowell Tackett wrote: > The Python Magazine people have now got a Twitter site--which includes a > perhaps [telling] misspelling. Obviously that's why they're looking for a chief editor - maybe it's even a deliberate ploy. I'm not sure if this affects others, but to me yo

Re: [Tutor] raw_input()

2010-03-15 Thread Benno Lang
On 16 March 2010 08:28, Steven D'Aprano wrote: > On Tue, 16 Mar 2010 10:22:55 am kumar s wrote: >> thanks Benno. >> >> supplying 3.6 GB file is over-kill for the script. > > Then supply a smaller file. > > >> This is the reason I chose to input lines on fly. > > I don't understand what you are try

Re: [Tutor] raw_input()

2010-03-15 Thread Benno Lang
On 16 March 2010 08:04, kumar s wrote: > %cat mybigfile.rod | python x1.py > Traceback (most recent call last): >  File "x1.py", line 2, in >    second = raw_input() > EOFError: EOF when reading a line > > How to notify that at EOF break and suppress exception. try: second = raw_input() exce

Re: [Tutor] SQLite error messages

2010-03-09 Thread Benno Lang
On 10 March 2010 11:37, Alan Harris-Reid wrote: > Hi there, > > I am using the sqlite3 module with Python 3.1, and have some code which goes > something like as follows... > > import sqlite3 > con = sqlite3.connect('MyDatabase.db') > > try: >   execresult = con.execute('INSERT INTO MyTable (field_

Re: [Tutor] WSGI / Apache

2010-03-08 Thread Benno Lang
On 5 March 2010 04:37, Giorgio wrote: > Hi, > > as you all probably know i'm using the Google App Engine platform for my > python code. > > As I learn python i try to understand more and more how GAE works. Today > i've noticed that all applications on GAE are running on WSGI. A quick > Google sea

Re: [Tutor] Instantiating a list of strings into a list of classes

2010-03-05 Thread Benno Lang
On 6 March 2010 10:38, Daryl V wrote: > I have a csv list of data, of the form: > plot, utmN83_X, utmN83_Y, plot_radius_m > Spring1,348545,3589235,13.2 > etc. > I built a nifty ClassGPSPoint(Xpos,Ypos,plotRadius,workPaths) that eats the > X&Y positions, the plot radius, and previously instantiated

Re: [Tutor] returning to my quest

2010-02-25 Thread Benno Lang
On 26 February 2010 11:55, Kent Johnson wrote: > On Thu, Feb 25, 2010 at 8:59 PM, Kirk Bailey wrote: >> for  WEBMAIIL portal to a pop3/smtp email service in my server; centrally >> hosted or in the laptop is fine, what can people recommend? Without going to >> IMAP, i want to leave the mail on th

Re: [Tutor] strange bidi requirement

2010-02-24 Thread Benno Lang
On 25 February 2010 01:34, rick wrote: > I'm trying to write a math quiz program that replicates an old book on > arithmetic. > > when it comes to summing a long column, I need to read the answer from > the user, one digit at a time. > > so, if the answer should be something like > > 14238.83 > >

Re: [Tutor] ask

2010-02-23 Thread Benno Lang
On 24 February 2010 12:58, Shurui Liu (Aaron Liu) wrote: > This time is not my assignment, I promise. > > In python, when we want to list numbers, we use the command "range", like, > if we want to list integer from 0 to 9, we can write: range(10); if we want > to list integer from 10 to 29, we can

Re: [Tutor] What Editori?

2010-02-23 Thread Benno Lang
On 24 February 2010 01:24, Giorgio wrote: > what text-editor do you use for python? I use jEdit, and without a GUI I guess I'd use nano - I'm not the sort who likes reading manuals in order to use a text editor. Many years ago when I was on Windows I used to use TextPad. Then I started using jEdi

Re: [Tutor] Strange list behaviour in classes

2010-02-22 Thread Benno Lang
On 23 February 2010 08:16, Benno Lang wrote: > class Hand: >    def __init__(self): >        self.hand = [] Of course, I meant "class Player" ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: htt

Re: [Tutor] Strange list behaviour in classes

2010-02-22 Thread Benno Lang
On 23 February 2010 07:10, C M Caine wrote: > Or possibly strange list of object behaviour > > IDLE 2.6.2 class Player(): >        hand = [] > > Colin = Player() Alex = Player() Players = [Colin, Alex] def hands(): >        for player in Players: >              

Re: [Tutor] Using and

2010-02-21 Thread Benno Lang
On 21 February 2010 22:44, jim serson wrote: > Can anyone tell me if I can have my program check to see if something is > true the add to count > > For example something like > > if c_1 and c_2 and c_3 true: >     count + 1 Your code currently throws the result of the count + 1 expression

Re: [Tutor] DOWHILE counter

2010-02-16 Thread Benno Lang
On 17 February 2010 12:32, wrote: > > Hi i am trying to write a pseudocode to read an input number and its 15% > output value. The counter is supposed to process 4 input numbers. Help > please!! If it's pseudocode, then you can write a loop however you like. If you have a Python-related questio

Re: [Tutor] Coin flip game

2010-02-11 Thread Benno Lang
On Fri, Feb 12, 2010 at 7:15 AM, Jones, Lawrence D wrote: > My code is below. But can someone please explain to me why the following > variable has to be placed where it is for the code to work? I thought it > would need to go nearer the start of the code i.e. just before heads = 0, > tails = 0 et

Re: [Tutor] html and python

2010-02-10 Thread Benno Lang
On Thu, Feb 11, 2010 at 5:26 AM, Grigor Kolev wrote: > I apologize to my question is incorrectly set. > We have a mail list and we want to do in site a list of all participants > with their photos and names. > List with people is saved in the txt file. > I want to open this file. Take all mail add

Re: [Tutor] "else:" triggering a Syntax Error

2010-02-06 Thread Benno Lang
On Sat, Feb 6, 2010 at 9:19 PM, spir wrote: > On Sat, 6 Feb 2010 20:18:53 +0900 > Benno Lang wrote: > >> > if ((self.start_dot.x > self.end_dot.x) and (self.start_dot.y !=   >> > self.end_dot.y)): >> (1) Are you sure you want all those superfluous parenth

Re: [Tutor] "else:" triggering a Syntax Error

2010-02-06 Thread Benno Lang
On Sat, Feb 6, 2010 at 7:56 PM, Stijn . wrote: > class Line(): #The class >     def __init__( self, start_dot, end_dot, width): #init function >     self.start_dot = start_dot >     self.surface = pygame.Surface((w, h), SRCALPHA) >     self.surface.fill((0,0,0,0)) >     self.end_do

Re: [Tutor] help with random.randint

2010-02-02 Thread Benno Lang
On Wed, Feb 3, 2010 at 12:21 PM, David wrote: > Hello list, > > I thought this was easy even for me, but I was wrong, I guess. > Here is what I want to do: take two random numbers between 1 and 99, and put > them into a list. > > import random > terms =  [] > for i in range(2): >        terms = ra

Re: [Tutor] can any one help

2010-01-31 Thread Benno Lang
On Mon, Feb 1, 2010 at 6:27 AM, invincible patriot wrote: > thanks for the reply > i did one question > i will tel u my progress in another question n then u tel me that what next > must be done > thatz the question > i think that first i woulf take a string 'foobar' > convert it into a list >

Re: [Tutor] Help with a Dictionary

2010-01-07 Thread Benno Lang
On Thu, Jan 7, 2010 at 10:51 PM, Garry Bettle wrote: > I have a list that I output in the following order: > > 2010-01-07 1103 Sund A7 450m > 2010-01-07 Sheff A7 500m > 2010-01-07 1119 Sund A6 450m > 2010-01-07 1128 Sheff A6 500m > 2010-01-07 1134 Sund A5 450m > 2010-01-07 1142 Sheff A7 500m

Re: [Tutor] mod_python authentication

2009-12-05 Thread Benno Lang
On Sat, Dec 5, 2009 at 8:26 PM, Rayon wrote: > I need to  setup a login page for a web application but I am not finding any > code in the mod_python doc that shows me how to do this. > > What is need is the code to tell apache to get this login data from a login > page. If you want Apache to dire

Re: [Tutor] Function design

2009-10-27 Thread Benno Lang
On Tue, Oct 27, 2009 at 8:21 AM, Dave Angel wrote: > I agree with Luke's comments.  But I'd like to point out an apparent bug (I > haven't tried the code, this is just by inspection). > > You use the test >     if '0' in row[.] > > that's not going to check for a zero value, it's going to chec

Re: [Tutor] small program

2009-10-02 Thread Benno Lang
On Thu, Oct 1, 2009 at 8:31 PM, Andrius wrote: > Hi! > > There are interesting online course > http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-00Fall-2008/LectureVideos/index.htm > where I'm trying to learn Python. > Looks quite interesting and I would like to create a prog

Re: [Tutor] Switching from 2.3 to 2.6

2009-09-23 Thread Benno Lang
On Thu, Sep 24, 2009 at 5:46 AM, Kristina Ambert wrote: > Hi guys, > I'm getting this error after I tried to switch from python 2.3 to 2.6. I > tried to look online for what it means, but I can't find any good > explanation. > Do any of you guys have any idea what's causing it and what it means? >

Re: [Tutor] eazy python question involving functions and parameters

2009-09-20 Thread Benno Lang
On Mon, Sep 21, 2009 at 5:19 AM, daggerdvm wrote: > > assume that  jade2 is a function that expects two  int parameters and returns > the value of the larger one. > > Also assume that four variables,  population1 ,  population2 ,  population3 > , and  population4 have already been defined and asso

Re: [Tutor] Calling a dictionary entry inside of a function

2009-09-18 Thread Benno Lang
On Sat, Sep 19, 2009 at 9:27 AM, Corey Richardson wrote: > I am trying to use a parameter of a function to call a word inside a > dictionary. > Here is my code > wordList = { >   'Apple' : ["A delicious snack"], >   'Word' : ["This code is not working..."], > } > def define(word): >   print wordLi

Re: [Tutor] Best Practice: Subroutines and Loop logic

2009-09-03 Thread Benno Lang
On Fri, Sep 4, 2009 at 3:29 AM, GoodPotatoes wrote: > Hello, > > I am trying to find the best way to do this.  My goal is to only call this > subroutine only ONCE, and the logic is contingent upon two outputs. > > lWords=[...] # List of many, many words > lData=[...] #list of some words that need t