Re: [Tutor] working with c_byte?

2012-03-23 Thread Dave Angel
On 03/24/2012 01:10 AM, Alex Hall wrote: Thanks, the& (bitwise operator) trick seems to be promising. Should I still mod by 256? If so, could you explain why, since the value cannot exceed 127? Also, how does that work if a possible vlaue is 255, according to the documentation? You top-posted

Re: [Tutor] working with c_byte?

2012-03-23 Thread Alex Hall
Thanks, the & (bitwise operator) trick seems to be promising. Should I still mod by 256? If so, could you explain why, since the value cannot exceed 127? Also, how does that work if a possible vlaue is 255, according to the documentation? On 3/24/12, Dave Angel wrote: > On 03/23/2012 11:51 PM, Al

Re: [Tutor] working with c_byte?

2012-03-23 Thread Dave Angel
On 03/23/2012 11:51 PM, Alex Hall wrote: Hi all, I am trying to read battery information. I found an example that sets up a ctypes structure to get the information from a kernel call, and it works... except that I just realized the values of some fields are added. For instance, a value of 1 means

[Tutor] working with c_byte?

2012-03-23 Thread Alex Hall
Hi all, I am trying to read battery information. I found an example that sets up a ctypes structure to get the information from a kernel call, and it works... except that I just realized the values of some fields are added. For instance, a value of 1 means that the battery is "high", and 8 means it

Re: [Tutor] Library of Module for Analyzing Answer Cards

2012-03-23 Thread Emile van Sebille
On 3/22/2012 11:45 AM Khalid Al-Ghamdi said... Hi All, I work in in academic testing environment and we employ expensive machines to scan answer sheets (the ones where you blacken the letter of the correct multiple choice answer). Anyway, I was thinking if there was a way we could use regular ol

Re: [Tutor] python arthematics

2012-03-23 Thread Prasad, Ramit
Please reply to the list (or at least include it) and not just the person responding. > i have tried upto two varibles but i want it to extend to mny more . I > just need an idea. i have tried like this > a=int(raw_input()) > b=int(raw_input()) > print "please enter operator" > operator=raw_input

Re: [Tutor] python arthematics

2012-03-23 Thread Francesco Loffredo
Sukhpreet Sdhu wrote: i want to write a program that reads simple arithematic epressions and calculates the result. for example input "1*3+2" should generate "5'" as result I'm happy to learn somebody else took the same path that I did to learn Python! First of all, a disclaimer: I'm NOT pre