'Address already in use' ... with TCPServer

2009-01-29 Thread Mabooka-Mabooka Mbe-Mbe
Hi all, I bet everybody knows exactly what I am about to ask about: ''' A server serves for a while, then drops on its knees, tries to restart, but... the port is busy, the TCP says "Address already in use". ''' And, I think I know the answer: setsockopt(REUSEADDR)... The problem is: I a

Re: Swapping values of two variables

2009-01-29 Thread Steven D'Aprano
On Thu, 29 Jan 2009 21:23:48 -0800, Kottiyath wrote: > Is it possible to swap two floats without a variable? In Python? Sure. f = 1.23 g = 2.87 f, g = g, f This idiom is independent of the types of the objects: x = "hello world" y = [1, 2.0, None, "xyz", {}] x, y = y, x In other languages?

Re: is python Object oriented??

2009-01-29 Thread Chris Rebert
On Thu, Jan 29, 2009 at 10:25 PM, alex23 wrote: > On Jan 30, 4:15 pm, Chris Rebert wrote: >> - Python does not support interfaces in the Java sense (although there >> are a few third-party libraries that add such support); neither does >> Smalltalk. Instead, both Smalltalk and Python use duck-typ

Re: Swapping values of two variables

2009-01-29 Thread tony . clarke5
On Jan 30, 3:31 am, Steven D'Aprano wrote: > On Thu, 29 Jan 2009 17:50:04 -0800, tony.clarke5 wrote: > > On Jan 30, 12:29 am, Eric Kang wrote: > >> In python, I set: > > >> x=1 > >> y=3 > > >> z = x > >> x = y > >> y = z > > >> This gave me 3 1, which are the values of x and y swapped. The > >> f

Re: is python Object oriented??

2009-01-29 Thread alex23
On Jan 30, 4:15 pm, Chris Rebert wrote: > - Python does not support interfaces in the Java sense (although there > are a few third-party libraries that add such support); neither does > Smalltalk. Instead, both Smalltalk and Python use duck-typing to > similar effect. Seehttp://en.wikipedia.org/wi

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread r
On Jan 29, 11:53 pm, James Mills wrote: > On Fri, Jan 30, 2009 at 3:38 PM, r wrote: > > This observation leads me to two scientific and common sense synopsis. > > Either nobody here gives a rats pa'toote about Python, and/or they are > > all just a bunch of gutless worms too afraid to stand up to

Re: Rounding to the nearest 5

2009-01-29 Thread Steven D'Aprano
On Fri, 30 Jan 2009 00:24:47 -0500, D'Arcy J.M. Cain wrote: > On Thu, 29 Jan 2009 16:06:09 -0800 > "todp...@hotmail.com" wrote: >> How can you make python round numbers to the nearest 5: >> >> Example: >> >> 3 => 0 >> 8 => 10 >> 23.2 => 20 >> 36 => 35 >> 51.5 => 50 > > That appears to be rou

Re: new.instancemethod questions

2009-01-29 Thread schickb
On Jan 29, 8:51 pm, Brian Allen Vanderburg II wrote: > You can also create a bound method and manually bind it to the > instance.  This is easier > > import types > a.f2 = types.MethodType(f1, a) > > a.f2() # prints object a Ah thanks, that is what I was looking for. I missed that because followi

Re: is python Object oriented??

2009-01-29 Thread Chris Rebert
On Thu, Jan 29, 2009 at 9:56 PM, Hung Vo wrote: > I'm new to Python and also wondering about OOP in Python. > > I want to justify the above question (is Python Object-Oriented?). > Does Python follow the concepts/practices of Encapsulation, > Polymorphism and Interface, which are quite familiar t

Re: is python Object oriented??

2009-01-29 Thread Stephen Hansen
> I'm new to Python and also wondering about OOP in Python. > > I want to justify the above question (is Python Object-Oriented?). > Does Python follow the concepts/practices of Encapsulation, > Polymorphism and Interface, which are quite familiar to Java > programmers? Python does not enforce En

Re: is python Object oriented??

2009-01-29 Thread alex23
On Jan 30, 4:00 pm, Hung Vo wrote: > Does Python follow the concepts/practices of Encapsulation, > Polymorphism and Interface, which are quite familiar to Java > programmers? Well, it has the same _concepts_, but definitely not the same practices/implementations. As they say, Python is not Java

Re: is python Object oriented??

2009-01-29 Thread Hung Vo
On Jan 30, 4:19 am, Michael Torrie wrote: > M Kumar wrote: > > but still I am not clear of the execution of the code, when we write or > > execute a piece of python code without defining class, predefined class > > attributes are available (not all but __name__ and __doc__ are available). > > does

Re: is python Object oriented??

2009-01-29 Thread Hung Vo
On Jan 30, 4:19 am, Michael Torrie wrote: > M Kumar wrote: > > but still I am not clear of the execution of the code, when we write or > > execute a piece of python code without defining class, predefined class > > attributes are available (not all but __name__ and __doc__ are available). > > does

Re: is python Object oriented??

2009-01-29 Thread Hung Vo
On Jan 30, 4:19 am, Michael Torrie wrote: > M Kumar wrote: > > but still I am not clear of the execution of the code, when we write or > > execute a piece of python code without defining class, predefined class > > attributes are available (not all but __name__ and __doc__ are available). > > does

Re: Module/Library That is Able To Use Cookies + Proxies?

2009-01-29 Thread Justin Ezequiel
On Jan 30, 12:06 pm, blackcapsoftw...@gmail.com wrote: > I would like to do is be able to log into a site that uses cookies to > store information about the user when logging in. This works fine and > dandy with ClientCookie. Now, I want to be able to do so with a proxy, urllib2 http://docs.pytho

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread James Mills
On Fri, Jan 30, 2009 at 3:38 PM, r wrote: > This observation leads me to two scientific and common sense synopsis. > Either nobody here gives a rats pa'toote about Python, and/or they are > all just a bunch of gutless worms too afraid to stand up to the 10 or > so Perl/Ruby leeches who's infestati

Re: Rounding to the nearest 5

2009-01-29 Thread Miles
On Thu, Jan 29, 2009 at 7:26 PM, Tim Chase wrote: >> How can you make python round numbers to the nearest 5: >> Example: >> 3 => 0 >> 8 => 10 >> 23.2 => 20 >> 36 => 35 >> 51.5 => 50 > > I'm not sure *any* rounding system will give those results. def bogoround(n): n1 = n / 5.0 return int(

Re: search speed

2009-01-29 Thread alex23
On Jan 30, 2:56 pm, r wrote: > On Jan 29, 5:51 pm, anders wrote: > > > if file.findInFile("LF01"): > > Is there any library like this ?? > > Best Regards > > Anders > > Yea, it's called a for loop! > > for line in file: >     if "string" in line: >         do_this() Which is what the OP is alrea

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread r
On Jan 29, 6:21 pm, r wrote: > Also if anyone dares to mention that Python is a great language or > better in this reguard or that, they get jumped and beat to death by > their "so-called" brothers. This observation leads me to two scientific and common sense synopsis. Either nobody here gives a

Re: Swapping values of two variables

2009-01-29 Thread Grant Edwards
On 2009-01-30, MRAB wrote: >> What is the minimum amount of extra memory required to exchange two >> 32-bit quantities? What would be the pseudocode that achieves this >> minimum? > > x ^= y > y ^= x > x ^= y > > This is really only of use when working in assembly language. And rarely then. ;)

Re: Swapping values of two variables

2009-01-29 Thread Kottiyath
On Jan 30, 8:31 am, Steven D'Aprano wrote: > On Thu, 29 Jan 2009 17:50:04 -0800, tony.clarke5 wrote: > > On Jan 30, 12:29 am, Eric Kang wrote: > >> In python, I set: > > >> x=1 > >> y=3 > > >> z = x > >> x = y > >> y = z > > >> This gave me 3 1, which are the values of x and y swapped. The > >> f

Re: Rounding to the nearest 5

2009-01-29 Thread D'Arcy J.M. Cain
On Thu, 29 Jan 2009 16:06:09 -0800 "todp...@hotmail.com" wrote: > How can you make python round numbers to the nearest 5: > > Example: > > 3 => 0 > 8 => 10 > 23.2 => 20 > 36 => 35 > 51.5 => 50 That appears to be rounding to nearest 10, not 5. Clarify your requirements first. -- D'Arcy J.M.

Re: libsudo ?

2009-01-29 Thread Brian Allen Vanderburg II
linuxguy...@gmail.com wrote: Does anyone know where I would find libsudo ? http://sourceforge.net/projects/libsudo If you had the choice of using pexpect or libsudo, which would you use ? libsudo does all the work for you of executing sudo, checking for the expected responses and all. I

Re: new.instancemethod questions

2009-01-29 Thread Brian Allen Vanderburg II
schi...@gmail.com wrote: On Jan 29, 7:38 pm, Mel wrote: schickb wrote: I'd like to add bound functions to instances, and found the instancemethod function in the new module. A few questions: 1. Why is instancemethod even needed? Its counter-intuitive (to me at least) that assig

Re: search speed

2009-01-29 Thread r
On Jan 29, 5:51 pm, anders wrote: > if file.findInFile("LF01"): > Is there any library like this ?? > Best Regards > Anders Yea, it's called a for loop! for line in file: if "string" in line: do_this() -- http://mail.python.org/mailman/listinfo/python-list

libsudo ?

2009-01-29 Thread Linuxguy123
Does anyone know where I would find libsudo ? If you had the choice of using pexpect or libsudo, which would you use ? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: error on building 2.6.1. (_ctypes)

2009-01-29 Thread Gabriel Genellina
En Thu, 29 Jan 2009 22:19:18 -0200, Bernard Rankin escribió: I am trying to build python 2.6 on a machine (web server) that I do not have root access to. (has 2.4 installed) Python 2.5 builds fine, but I am getting an error when I run "make" for 2.6.1. ~

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread r
On Jan 29, 9:01 pm, alex23 wrote: > Seriously, how -old- are you? Twelve? Thirteen? Ah, my good friend alex23. Somehow -- when i was writing this post -- i knew you would drop in and i swear i do not have any ESP abilities -- somehow i just knew. While your here why don't we take a walk down mem

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread Ben Finney
alex23 writes: > On Jan 30, 10:21 am, r wrote: > > I been around the list for a while and rubbed sholders with some > > pythonistas(some you would not beleieve if i told you) and i just > > don't see a community spirit here. > > Seriously, how -old- are you? Twelve? Thirteen? Please stop baiti

Module/Library That is Able To Use Cookies + Proxies?

2009-01-29 Thread blackcapsoftware
Hey guys, I have been search the net for a bit now and can't find anything. What I would like to do is be able to log into a site that uses cookies to store information about the user when logging in. This works fine and dandy with ClientCookie. Now, I want to be able to do so with a proxy, does a

Re: Using equals operator without changing reference pointer

2009-01-29 Thread Terry Reedy
Erik Max Francis wrote: mark.sea...@gmail.com wrote: Is there a way to lock down myInst so that it still refers to the original object, and is there some special member that will allow me to override the equals operator in this case? Or is that simply blasphemous against everything Python hold

Re: new.instancemethod questions

2009-01-29 Thread schickb
On Jan 29, 7:38 pm, Mel wrote: > schickb wrote: > > I'd like to add bound functions to instances, and found the > > instancemethod function in the new module. A few questions: > > > 1. Why is instancemethod even needed? Its counter-intuitive (to me at > > least) that assigning a function to a clas

Re: Rounding to the nearest 5

2009-01-29 Thread Steven D'Aprano
On Thu, 29 Jan 2009 18:26:34 -0600, Tim Chase wrote: >> How can you make python round numbers to the nearest 5: >> >> Example: >> >> 3 => 0 >> 8 => 10 >> 23.2 => 20 >> 36 => 35 >> 51.5 => 50 > > I'm not sure *any* rounding system will give those results. Round towards zero. > 3 should roun

Re: is python Object oriented??

2009-01-29 Thread Chris Rebert
On Thu, Jan 29, 2009 at 7:31 PM, Steven D'Aprano wrote: > On Thu, 29 Jan 2009 02:25:57 -0800, Chris Rebert wrote: > >> In addition to methods, Python has functions, which are not associated >> with a class > > Yes they are. > (lambda: None).__class__ > > > The function type itself has a clas

Re: naming and binding (subtle Python 3 change)

2009-01-29 Thread Terry Reedy
Alan G Isaac wrote: The example give at http://docs.python.org/reference/executionmodel.html#naming-and-binding remains unchanged at http://docs.python.org/3.0/reference/executionmodel.html#naming-and-binding but the change to Python 3 list comprehensions now means the example will fail even with

Re: new.instancemethod questions

2009-01-29 Thread Mel
schickb wrote: > I'd like to add bound functions to instances, and found the > instancemethod function in the new module. A few questions: > > 1. Why is instancemethod even needed? Its counter-intuitive (to me at > least) that assigning a function to a class results in bound functions > its insta

Re: is python Object oriented??

2009-01-29 Thread Steven D'Aprano
On Thu, 29 Jan 2009 02:25:57 -0800, Chris Rebert wrote: > In addition to methods, Python has functions, which are not associated > with a class Yes they are. >>> (lambda: None).__class__ The function type itself has a class: >>> (lambda: None).__class__.__class__ -- Steven -- http://mail

Re: Swapping values of two variables

2009-01-29 Thread Steven D'Aprano
On Thu, 29 Jan 2009 17:50:04 -0800, tony.clarke5 wrote: > On Jan 30, 12:29 am, Eric Kang wrote: >> In python, I set: >> >> x=1 >> y=3 >> >> z = x >> x = y >> y = z >> >> This gave me 3 1, which are the values of x and y swapped. The >> following would have given me the same result: x, y = y, x >>

Re: Swapping values of two variables

2009-01-29 Thread Steven D'Aprano
On Thu, 29 Jan 2009 16:29:11 -0800, Eric Kang wrote: > In python, I set: > > x=1 > y=3 > > z = x > x = y > y = z > > > This gave me 3 1, which are the values of x and y swapped. The following > would have given me the same result: x, y = y, x Yes. > But could the swapping be done using less

Re: Using equals operator without changing reference pointer

2009-01-29 Thread Erik Max Francis
mark.sea...@gmail.com wrote: Is there a way to lock down myInst so that it still refers to the original object, and is there some special member that will allow me to override the equals operator in this case? Or is that simply blasphemous against everything Python holds sacred? Certainly ther

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread alex23
On Jan 30, 10:21 am, r wrote: > I been around the list for a while and rubbed sholders with some > pythonistas(some you would not beleieve if i told you) and i just > don't see a community spirit here. Seriously, how -old- are you? Twelve? Thirteen? -- http://mail.python.org/mailman/listinfo/pyth

Using equals operator without changing reference pointer

2009-01-29 Thread mark . seagoe
I know this may be asking too much of Python, but you never know unless you ask... So now having a class that can be treated like an int as far as math upon the instance name, and can be treated as in HDL simulators, allowing bitslice and bitselect ops, I was stoked. Also reading back the instanc

new.instancemethod questions

2009-01-29 Thread schickb
I'd like to add bound functions to instances, and found the instancemethod function in the new module. A few questions: 1. Why is instancemethod even needed? Its counter-intuitive (to me at least) that assigning a function to a class results in bound functions its instances, while assigning direct

Re: Swapping values of two variables

2009-01-29 Thread tony . clarke5
On Jan 30, 12:29 am, Eric Kang wrote: > In python, I set: > > x=1 > y=3 > > z = x > x = y > y = z > > This gave me 3 1, which are the values of x and y swapped. > The following would have given me the same result: > x, y = y, x > > But could the swapping be done using less extra memory than this?

Re: Sloooooowwwww WSGI restart

2009-01-29 Thread Graham Dumpleton
On Jan 30, 9:53 am, Ron Garret wrote: > In article <498171a5$0$3681$426a7...@news.free.fr>, >  Bruno Desthuilliers > >  wrote: > > Ron Garret a écrit : > > > In article , > > >  Aleksandar Radulovic wrote: > > (snip) > > >> Secondly, why are you restarting apache after code changes? In normal >

Re: More mod_wsgi weirdness: process restarts on redirect

2009-01-29 Thread Graham Dumpleton
On Jan 30, 11:01 am, Ron Garret wrote: > In article , >  Joshua Kugler wrote: > > > Ron Garret wrote: > > > My question is: is this supposed to be happening?  Or is this an > > > indication that something is wrong, and if so, what? > > > You are probably just hitting a different instance of Apach

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2009-01-29 Thread John Machin
Benjamin Kaplan case.edu> writes: > First of all, you're right that might be confusing. I was thinking of auto-detect as in "check the platform and locale and guess what they usually use". I wasn't thinking of it like the web browsers use it.I think it uses locale.getpreferredencoding(). You're

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread Giampaolo Rodola'
> Where are the community projects supporting Python? -- besides the > core devlopment. http://pypi.python.org/pypi ...which accidentally says "There are currently 5597 packages here." Not bad uh? --- Giampaolo http://code.google.com/p/pyftpdlib -- http://mail.python.org/mailman/listinfo/pytho

Re: Swapping values of two variables

2009-01-29 Thread MRAB
Eric Kang wrote: In python, I set: x=1 y=3 z = x x = y y = z This gave me 3 1, which are the values of x and y swapped. The following would have given me the same result: x, y = y, x But could the swapping be done using less extra memory than this? What is the minimum amount of extra memory

Swapping values of two variables

2009-01-29 Thread Eric Kang
In python, I set: x=1 y=3 z = x x = y y = z This gave me 3 1, which are the values of x and y swapped. The following would have given me the same result: x, y = y, x But could the swapping be done using less extra memory than this? What is the minimum amount of extra memory required to exch

naming and binding (subtle Python 3 change)

2009-01-29 Thread Alan G Isaac
The example give at http://docs.python.org/reference/executionmodel.html#naming-and-binding remains unchanged at http://docs.python.org/3.0/reference/executionmodel.html#naming-and-binding but the change to Python 3 list comprehensions now means the example will fail even with list comprehension s

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread Marc 'BlackJack' Rintsch
On Fri, 30 Jan 2009 00:25:03 +0100, Stef Mientki wrote: > try this: > > class MyRegClass ( int ) : > def __init__ ( self, value ) : > self.Value = value > def __repr__ ( self ) : > line = hex ( self.Value ) > line = line [:2] + line [2:].upper() > return line def __repr__

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread mark . seagoe
On Jan 29, 3:13 pm, Stef Mientki wrote: > mark.sea...@gmail.com wrote: > > Thanks.  So far these solutions will return strings.  So I can't > > really treat it like a variable, yet still perform bitslice on it, > > since I need a special class to do bitslice and bit selection, but as > > soon as I

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread Jervis Whitley
On Fri, Jan 30, 2009 at 9:02 AM, wrote: > I'm trying to make a script environment with datatypes (or classes) > for accessing hardware registers. At the top level, I would like the > ability to bitwise ops if bit slice brackets are used, but if no > brackets are used, I would like it to write/re

Re: slicings: 3 questions

2009-01-29 Thread Alan G Isaac
On 1/29/2009 4:41 PM Robert Kern apparently wrote: It allows (ab)uses like numpy.mgrid: >>> mgrid[0:10:11j] array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]) Ah of course. Obvious now, but I had presumed some deeper magic in that syntax, not recognizing that a legitim

Re: Quickbooks

2009-01-29 Thread viglen
On Jan 28, 1:21 pm, Stephen Chapman wrote: > Has anyone Implemented the Quickbooks  COM object in Python.  If so can > you give me > an Idea of where to begin. > Thanks Have you tried to contact the customer support team? I have used them many times and they are very helpful. They have different

Re: Rounding to the nearest 5

2009-01-29 Thread MRAB
todp...@hotmail.com wrote: How can you make python round numbers to the nearest 5: Example: 3 => 0 8 => 10 23.2 => 20 36 => 35 51.5 => 50 Divide by 5, round the result, then multiply by 5. -- http://mail.python.org/mailman/listinfo/python-list

Re: Rounding to the nearest 5

2009-01-29 Thread Tim Chase
How can you make python round numbers to the nearest 5: Example: 3 => 0 8 => 10 23.2 => 20 36 => 35 51.5 => 50 I'm not sure *any* rounding system will give those results. 3 should round up to 5 (not down to 0) and 23.2 should round up to 25 (not down to 20) in the same way that 8 rounds

Re: self-aware list of objects able to sense constituent member alterations?

2009-01-29 Thread Reckoner
On Jan 28, 10:17 pm, Peter Wang wrote: > On Jan 27, 3:16 pm,Reckoner wrote: > > > > > I'm not sure this is possible, but I would like to have > > a list of  objects > > > A=[a,b,c,d,...,z] > > > where,  in the midst of a lot of processing I might do something like, > > > A[0].do_something_which_c

Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread r
I been around the list for a while and rubbed sholders with some pythonistas(some you would not beleieve if i told you) and i just don't see a community spirit here. Where are the community projects supporting Python? -- besides the core devlopment. Seem s that nobody is interested unless their pa

Re: ImportError in embedded Python Interpreter

2009-01-29 Thread Gabriel Genellina
En Thu, 29 Jan 2009 17:07:01 -0200, escribió: i have a problem. I compiled Python and the socket module so I got this structure. (all on windows) C:\test\dll_files\python25.dll C:\test\my_app C:\test\dll_files\DLLs\ C:\test\dll_files\python.exe If I run python.exe I get the console and I ca

error on building 2.6.1. (_ctypes)

2009-01-29 Thread Bernard Rankin
Hello, I am trying to build python 2.6 on a machine (web server) that I do not have root access to. (has 2.4 installed) Python 2.5 builds fine, but I am getting an error when I run "make" for 2.6.1. Here is the command line I am using: ../configure -prefix=/home/username/local-python/ --enable

Re: slicings: 3 questions

2009-01-29 Thread Gabriel Genellina
En Thu, 29 Jan 2009 19:41:28 -0200, Robert Kern escribió: On 2009-01-29 15:33, Alan G Isaac wrote: On 1/29/2009 1:37 PM Chris Rebert apparently wrote: Also, more fundamentally, Python is liberal in what it allows for the parts of slices, so unifying slices with ranges would break code. For

Rounding to the nearest 5

2009-01-29 Thread todp...@hotmail.com
How can you make python round numbers to the nearest 5: Example: 3 => 0 8 => 10 23.2 => 20 36 => 35 51.5 => 50 Thanks! _ Twice the fun—Share photos while you chat with Windows Live Messenger. http://www.microsoft.com/windows/w

Re: More mod_wsgi weirdness: process restarts on redirect

2009-01-29 Thread Ron Garret
In article , Joshua Kugler wrote: > Ron Garret wrote: > > My question is: is this supposed to be happening? Or is this an > > indication that something is wrong, and if so, what? > > You are probably just hitting a different instance of Apache, thus the > different process ID. Yep, that's wha

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread MRAB
John Machin wrote: On Jan 30, 9:02 am, mark.sea...@gmail.com wrote: I'm trying to make a script environment with datatypes (or classes) for accessing hardware registers. At the top level, I would like the ability to bitwise ops if bit slice brackets are used, but if no brackets are used, I woul

Re: Weird invisible arguments issues with Windows

2009-01-29 Thread Gabriel Genellina
En Thu, 29 Jan 2009 19:31:08 -0200, Uberman escribió: You all seem to be pointing at the same thing, and on my system, I show: C:\Users\Administrator>ftype python.file python.file="D:\Python26\python.exe" "%1" %* and C:\Users\Administrator>assoc .py .py=Python.File Which all

Re: parsing text from a file

2009-01-29 Thread MRAB
Wes James wrote: If I read a windows registry file with a line like this: "{C15039B5-C47C-47BD-A698-A462F4148F52}"="v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk Targeted Multicast|Edge=FALSE|" with this code: f

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread mark . seagoe
On Jan 29, 3:13 pm, Stef Mientki wrote: > mark.sea...@gmail.com wrote: > > Thanks.  So far these solutions will return strings.  So I can't > > really treat it like a variable, yet still perform bitslice on it, > > since I need a special class to do bitslice and bit selection, but as > > soon as I

Re: receive and react to MIDI input

2009-01-29 Thread elsjaako
On Jan 30, 12:26 am, elsjaako wrote: > On Jan 29, 10:44 pm, elsjaako wrote: > > > On Jan 29, 9:36 pm, r wrote: > > > > On Jan 29, 1:33 pm, elsjaako wrote: > > > > There is a Python MIDI module, i think it is pyMIDI, have you checked > > > it out? > > > Thank you for the responce. Unfortunately,

Re: Get thread pid

2009-01-29 Thread Gabriel Genellina
En Thu, 29 Jan 2009 14:04:49 -0200, Alejandro escribió: I have Python program running under Linux, that create several threads, and I want to now the corresponding PID of the threads. In each of the threads I have def run(self): pid = os.getpid() logger.critical('process ID: %s', pi

Re: More mod_wsgi weirdness: process restarts on redirect

2009-01-29 Thread Ron Garret
In article , Ron Garret wrote: > I'm running mod_wsgi under apache (on Debian etch so it's a somewhat out > of date version, though I doubt that has anything to do with this issue). > > I have a little test page that displays the process ID under which my > app is running, and some global sta

Understanding descriptors

2009-01-29 Thread Brian Allen Vanderburg II
I'm trying to better understand descriptors and I've got a few questions still after reading some sites. Here is what I 'think', but please let me know if any of this is wrong as I'm sure it probably is. First when accessing an attribute on a class or instance it must be found. For an insta

Re: More mod_wsgi weirdness: process restarts on redirect

2009-01-29 Thread Joshua Kugler
Ron Garret wrote: > My question is: is this supposed to be happening? Or is this an > indication that something is wrong, and if so, what? You are probably just hitting a different instance of Apache, thus the different process ID. j -- http://mail.python.org/mailman/listinfo/python-list

Re: Exec woes

2009-01-29 Thread Rhodri James
On Thu, 29 Jan 2009 08:15:57 -, Hendrik van Rooyen wrote: "Rhodri James" wrote: To: Sent: Thursday, January 29, 2009 6:12 AM Subject: Re: Exec woes On Wed, 28 Jan 2009 07:47:00 -, Hendrik van Rooyen wrote: > This is actually not correct - it is the root cause of my trouble.

Re: receive and react to MIDI input

2009-01-29 Thread elsjaako
On Jan 29, 10:44 pm, elsjaako wrote: > On Jan 29, 9:36 pm, r wrote: > > > On Jan 29, 1:33 pm, elsjaako wrote: > > > There is a Python MIDI module, i think it is pyMIDI, have you checked > > it out? > > Thank you for the responce. Unfortunately, that package is for OS X > (it doesn't say that cle

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread Stef Mientki
mark.sea...@gmail.com wrote: Thanks. So far these solutions will return strings. So I can't really treat it like a variable, yet still perform bitslice on it, since I need a special class to do bitslice and bit selection, but as soon as I try to pass it into some other function to check a bit,

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread Stef Mientki
mark.sea...@gmail.com wrote: Thanks. So far these solutions will return strings. So I can't really treat it like a variable, yet still perform bitslice on it, since I need a special class to do bitslice and bit selection, but as soon as I try to pass it into some other function to check a bit,

Re: py2exe + SQLite problem

2009-01-29 Thread Gabriel Genellina
En Thu, 29 Jan 2009 13:05:11 -0200, Armin escribió: I have frozen a running application which is using SQLite with py2exe. When I start the exe file I see in the log file of the exe: Traceback (most recent call last): File "dpconf.py", line 666, in ? File "dpconf.py", line 251, in __init_

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread mark . seagoe
Thanks. So far these solutions will return strings. So I can't really treat it like a variable, yet still perform bitslice on it, since I need a special class to do bitslice and bit selection, but as soon as I try to pass it into some other function to check a bit, I gotta then do another operati

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread John Machin
On Jan 30, 9:55 am, Stef Mientki wrote: >   def __repr__ ( self ) : >     line = hex ( self.Value ) >     line = line [:2] + line [2:].upper() >     return line > > btw, I'm a hardware guy too, and therefor I've never understood why the > hex function returns lowercase ;-) 0xFF?? *Real* hardware

More mod_wsgi weirdness: process restarts on redirect

2009-01-29 Thread Ron Garret
I'm running mod_wsgi under apache (on Debian etch so it's a somewhat out of date version, though I doubt that has anything to do with this issue). I have a little test page that displays the process ID under which my app is running, and some global state, so I can tell when the wsgi app gets re

Re: Sloooooowwwww WSGI restart

2009-01-29 Thread Ron Garret
In article <498170d4$0$23718$426a7...@news.free.fr>, Bruno Desthuilliers wrote: > Ron Garret a écrit : > > I'm running a WSGI app under apache/mod_wsgi and I've noticed that > > whenever I restart the server after making a code change it takes a very > > long time (like a minute) before the

Re: Sloooooowwwww WSGI restart

2009-01-29 Thread Ron Garret
In article <498171a5$0$3681$426a7...@news.free.fr>, Bruno Desthuilliers wrote: > Ron Garret a écrit : > > In article , > > Aleksandar Radulovic wrote: > (snip) > >> Secondly, why are you restarting apache after code changes? In normal > >> circumstances, you shouldn't have to do that. > > >

Re: receive and react to MIDI input

2009-01-29 Thread elsjaako
On Jan 29, 8:33 pm, elsjaako wrote: > I think this means that the following could be said: > > typedef void *HANDLE; > struct HMIDIIN##__ { int unused; }; typedef struct HMIDIIN##__ > *HMIDIIN; > I figured this problem out (I'm sure there will be more...): A handle should just be a c_void_p ... -

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread John Machin
On Jan 30, 9:02 am, mark.sea...@gmail.com wrote: > I'm trying to make a script environment with datatypes (or classes) > for accessing hardware registers.  At the top level, I would like the > ability to bitwise ops if bit slice brackets are used, but if no > brackets are used, I would like it to w

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread Stef Mientki
mark.sea...@gmail.com wrote: I'm trying to make a script environment with datatypes (or classes) for accessing hardware registers. At the top level, I would like the ability to bitwise ops if bit slice brackets are used, but if no brackets are used, I would like it to write/read the whole value.

Re: parsing text from a file

2009-01-29 Thread Tim Chase
if s.find('LANDesk') <0: is True for a line which doesn't contain "LANDesk"; if you want the opposite, try if s.find('LANDesk') >-1: Or more pythonically, just use if 'LANDesk' in s: -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing text from a file

2009-01-29 Thread John Machin
On Jan 30, 8:54 am, Wes James wrote: > If I read a windows registry file with a line like this: > > "{C15039B5-C47C-47BD-A698-A462F4148F52}"="v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program > Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk Targeted > Multicast|Edge

Re: Can't understand what python wants from me

2009-01-29 Thread mark . seagoe
On Jan 29, 1:50 pm, Oleksiy Khilkevich wrote: > Hello, everyone, > This may be a totally noob question, but since I am one, so here is it. For the input function, python is expecting you to input a number or a string. If you enter 'asd' without the '' then it thinks you are entering some variabl

Re: Can't understand what python wants from me

2009-01-29 Thread Chris Hulan
On Jan 29, 4:50 pm, Oleksiy Khilkevich wrote: > Hello, everyone, > This may be a totally noob question, but since I am one, so here is it. > > I have the following code (not something much > of):http://paste.debian.net/27204 > The current code runs well, but the problem is with input > value:htt

Re: Can't understand what python wants from me

2009-01-29 Thread Chris Rebert
On Thu, Jan 29, 2009 at 1:50 PM, Oleksiy Khilkevich wrote: > Hello, everyone, > This may be a totally noob question, but since I am one, so here is it. > > I have the following code (not something much of): > http://paste.debian.net/27204 > The current code runs well, but the problem is with input

Can't understand what python wants from me

2009-01-29 Thread Oleksiy Khilkevich
Hello, everyone, This may be a totally noob question, but since I am one, so here is it. I have the following code (not something much of): http://paste.debian.net/27204 The current code runs well, but the problem is with input value: http://paste.debian.net/27205 Аs you can see, the numbers ar

Re: pygccxml xml output file

2009-01-29 Thread Roman
On Jan 24, 3:25 pm, whatazor wrote: > Hi all, > I start to use this module in order to produce xml( and the make other > things), but differently from gccxml I don't find the variable that > set the name of the xml output file after the parsing (in gccxml is - > fxml), so it creates temporary file

Re: pyAA for Python2.5

2009-01-29 Thread Rob Williscroft
Kottiyath wrote in news:d86a0c1d-e158-4aa1-a47f-e2149948bdc3 @p2g2000prf.googlegroups.com in comp.lang.python: > On Jan 29, 1:51 am, Rob Williscroft wrote: >> Kottiyath wrote in news:6a594643-f6a2-4d8d-aab3-27eb16cb2fb8 >> @b38g2000prf.googlegroups.com in comp.lang.python: >> >> > I have mingw32

Re: parsing text from a file

2009-01-29 Thread Vlastimil Brom
2009/1/29 Wes James : > If I read a windows registry file with a line like this: > ... > > with this code: > > f=open('fwrules.reg2.txt') > > for s in f: > if s.find('LANDesk') <0: >print s, > > > LANDesk is not found. > > how do I find LANDesk in a string like this. is the "\\" messing thing

Re: is python Object oriented??

2009-01-29 Thread Ben Finney
MC writes: > Hi! > > Il se trouve que Chris Rebert a formulé : > > Python has functions, which are not associated with a class > > functions are methods of builtin... No, because ‘builtin’ is not a class. -- \ “The shortest distance between two points is under | `\

verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread mark . seagoe
I'm trying to make a script environment with datatypes (or classes) for accessing hardware registers. At the top level, I would like the ability to bitwise ops if bit slice brackets are used, but if no brackets are used, I would like it to write/read the whole value. For example, if I have someth

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2009-01-29 Thread Benjamin Kaplan
On Thu, Jan 29, 2009 at 4:19 PM, John Machin wrote: > Benjamin Kaplan case.edu> writes: > > > > > > > On Thu, Jan 29, 2009 at 12:09 PM, Anjanesh Lekshminarayanan > anjanesh.net> wrote: > > > It does auto-detect it as cp1252- look at the files in the traceback > and > > > you'll see lib\encoding

Re: Why doesn't eval of generator expression work with locals?

2009-01-29 Thread Gabriel Genellina
En Wed, 28 Jan 2009 18:06:01 -0200, Peter Otten <__pete...@web.de> escribió: Gabriel Genellina wrote: (I think this has to do with free variables in the "right side" (after the "in" keyword) of a generator expression; they appear to be evaluated when the expression is *defined*, not when is is

  1   2   >