[Tutor] Can Python monitor web browser content

2013-01-25 Thread 3n2 Solutions
Hello, I was wondering if Python can monitor web browser content. Specifically, I'm connected to a Machine to Machine device (essentially a Gateway) and monitoring its activity on a web browser (either IE or Chrome). There are certain parameters like RSSI (received signal strength indicator ) that

Re: [Tutor] Can Python monitor web browser content

2013-01-25 Thread Alan Gauld
On 25/01/13 17:52, 3n2 Solutions wrote: I was wondering if Python can monitor web browser content. Browsers just display html text and Python can read html so yes you can do it by getting your program to emulate a browser. Look at the standard library modules urllibm htmllib and htmlParser. O

Re: [Tutor] Calculate hours

2013-01-25 Thread शंतनू
Reply inline. On 23/01/13 8:22 AM, anthonym wrote: > Hello All, > > I originally wrote this program to calculate and print the employee > with the most hours worked in a week. I would now like to change this > to calculate and print the hours for all 8 employees in ascending order. > > The employ

Re: [Tutor] Calculate hours

2013-01-25 Thread Peter Otten
शंतनू wrote: > s = [sum(x) for x in matrix] > for q in sorted([(x,y) for x,y in enumerate(s)], > key=operator.itemgetter(1)): > print("Employee %d has worked %d hours" % (q[0], q[1])) A minor simplification: s = (sum(x) for x in matrix) for q in sorted(enumerate(s), key=operator.itemgetter(

[Tutor] lambda

2013-01-25 Thread anthonym
Hello All, I have the code below that I used to create a simple tic tac toe game for class. I am learning Python but have programmed in C+ before so I brought over a lambda and found that it worked in Python. Unfortunately I don't think my classmates will understand the use of lambda here but I

Re: [Tutor] lambda

2013-01-25 Thread Alan Gauld
On 25/01/13 23:57, anthonym wrote: I don't think my classmates will understand the use of lambda here but I am having are hard time converting that to strictly python. lambdas are strictly python but they can be easily reanslated into a named function as lambda p: expr becomes def f(p):

Re: [Tutor] lambda

2013-01-25 Thread Danny Yoo
On Fri, Jan 25, 2013 at 4:57 PM, anthonym wrote: > I have the code below that I used to create a simple tic tac toe game for > class. I am learning Python but have programmed in C+ before so I brought > over a lambda and found that it worked in Python. Unfortunately I don't > think my classmate

Re: [Tutor] lambda

2013-01-25 Thread anthonym
Thanks Alan. I prefer the lambda too. Especially given how much code I saved. I forgot about i and j being dynamic and the call function. On 1/25/13 4:14 PM, "Alan Gauld" wrote: >On 25/01/13 23:57, anthonym wrote: > >> I don't think my classmates will understand the use of lambda here but I

Re: [Tutor] lambda

2013-01-25 Thread eryksun
On Fri, Jan 25, 2013 at 7:14 PM, Alan Gauld wrote: > > Your problem of course is that you need i and j to be dynamically defined so > you need to create and call a function that returns a function like this > > def buttonFunMaker(i,j): > def func(x=i,y=j): > return ttt(x,y) > retur

Re: [Tutor] lambda

2013-01-25 Thread Alan Gauld
On 26/01/13 01:22, eryksun wrote: With a function call you no longer need the default parameter hack (i.e. x=i, y=j). You can make a closure over the local i and j in buttonFunMaker: def buttonFunMaker(i, j): def func(): return ttt(i, j) return func Good ca

[Tutor] Cheese shop tutorial mirror

2013-01-25 Thread Per Fagrell
Hello, I'm interested in uploading a module to pypi, but with the python wiki down after the hack there's no access to the Cheese shop tutorial. Does anyone have a mirror or reasonable facsimile that could be used until the wiki is back on-line and repopulated? Best regards, Per Fagrell _

[Tutor] Help!

2013-01-25 Thread Carpenter, Steven
To Whom it May Concern, I'm trying to get this code working. Here's my question: Consider a triangle with sides of length 3, 7, and 9. The law of cosines states that given three sides of a triangle (a, b, and c) and angle C between sides a and b: Write Python code to calculate the three angles in

[Tutor] sqlite search

2013-01-25 Thread Roger
Hello, I am very new to python. Wrote a small program to use on my android phone using pickle/shelve to access data. That worked fine but i realised it would be better to use sqlite as a database to more easily modify the data. I havent got a clue about sqlite, have a book but cant find the ans