oop in python
hello over there! I have the following question: Suppose I created a class: class Point: pass then instanciated an instance: new = Point() So now how to get the instance new as a string: like ' new ' ; Is there any built in function or method for eg: class Point: def _func_that_we_want_(self): return ... new._func_that_we_want_() ---> ' new ' -- http://mail.python.org/mailman/listinfo/python-list
Parallel port programming on windows XP/2000?
I'd like to write a simple application that interfaces with the parallel port, and changes the data on it according to keyboard input. I hope I can get it to run under windows xp and / or windows 2000. How can I do this? What do I need to know? It doesn't look like the standard library (the one under my pillow) has that feature. In addition, I've heard that with newer versions of windows don't let you communicate with the port directly, instead requiring interfacing with some driver? I came across this: http://pyserial.sourceforge.net/pyparallel.html but it seems to only be used for direct access (would it work with XP?), and hasn't been updated for a couple of years. In addition, it requires something called "Java Communications" (JavaComm) extension for Java/Jython, doesn't provide a link to it, and when I google it - google returns the page I came from! To add to the confusion, I hope I can provide a py2exe executable of my script instead of forcing a complete installation. --= Posted using GrabIt = --= Binary Usenet downloading made easy =- -= Get GrabIt for free from http://www.shemes.com/ =- -- http://mail.python.org/mailman/listinfo/python-list
Re: Parallel port programming on windows XP / 2000
I'm still stuck... my script is finished and works just fine on win98 using pyparallel, but I still haven't seen any sample code to do access the port in XP / 2000. If I don't make progress soon, I'll need to find a solution in another language, which I don't really want to do. --= Posted using GrabIt = --= Binary Usenet downloading made easy =- -= Get GrabIt for free from http://www.shemes.com/ =- -- http://mail.python.org/mailman/listinfo/python-list
Indexed variables
Hello, being an almost complete Python AND programming neophyte I would like to ask the following - very elementary, as I might suspect - question: How do I do the following flawed things right: a1=a2=0 def f(x): if x == a1: a1 = a1 + 1 elif x == a2: a2 = a2 + 1 Now if I call f with f(a2) only a1, of course, is incremented because the if-clause does only check for the value of the input and the values of a1 and a2 are identical. So how do I define the function such as to discrimate wheter I call it by f(a1) or f(a2) ? Thank you very much, Peter -- Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko! Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner -- http://mail.python.org/mailman/listinfo/python-list
