Re: why does getpass() show the input?

2006-08-10 Thread Robin Haswell
[EMAIL PROTECTED]:~$ python Python 2.4.2 (#2, Sep 30 2005, 21:19:01) [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 Type help, copyright, credits or license for more information. # The cause of this problem is because you're using the console ... # to test getpass.

Advice on a TCP passthru daemon for HTTP proxy rotation

2006-08-10 Thread Robin Haswell
Hey there Soon we will have many squid proxies on many seperate connections for use by our services. I want to make them available to users via a single HTTP proxy - however, I want fine-grained control over how the squid proxies are selected for each connection. This is so I can collect

Re: why does getpass() show the input?

2006-08-10 Thread Robin Haswell
Please look again at the OP's post. Here is the relevant part, with my annotations: You're right, my bad. It's still first thing in the morning here :'( -Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Quickie: converting r\x2019 to int

2006-04-07 Thread Robin Haswell
On Thu, 06 Apr 2006 20:00:13 +0200, Just wrote: In article [EMAIL PROTECTED], Kent Johnson [EMAIL PROTECTED] wrote: Robin Haswell wrote: Is this what you mean? In [9]: int(r'\x2019'[2:], 16) Out[9]: 8217 or maybe you meant this: In [6]: ord(u'\u2019') Out[6]: 8217 Or even

Re: Quickie: converting r\x2019 to int

2006-04-07 Thread Robin Haswell
Therefore r'\x2019' is left unchanged, and cannot be converted to an int. Rob, this explains *why* you are getting the above error. It does not explain how to achieve your objective, as you have not specified what it is. If you give more information, one of the resident gurus may be able

UnicodeDecodeError help please?

2006-04-07 Thread Robin Haswell
Okay I'm getting really frustrated with Python's Unicode handling, I'm trying everything I can think of an I can't escape Unicode(En|De)codeError no matter what I try. Could someone explain to me what I'm doing wrong here, so I can hope to throw light on the myriad of similar problems I'm having?

Cleaning the current environment after a fork

2006-04-06 Thread Robin Haswell
Hey guys I want to fork a process, but my scope has lots of stuff that the child won't need. Is it possible to clean the current environment of cruft so it is collected and freed? Basically I want it to go something like this. This is my first forking Python app, by the way: # {{{ My app import

Re: Cleaning the current environment after a fork

2006-04-06 Thread Robin Haswell
On Thu, 06 Apr 2006 12:47:25 +0200, Diez B. Roggisch wrote: And even if that wasn't the case: I think as long as you don't run into memory-troubles, don't do it. Its complex, flaky and thus an unnecessary source of failure. Yeah that sounds fair enough. Actually I ran in to threading problems

Quickie: converting r\x2019 to int

2006-04-06 Thread Robin Haswell
Hey guys. This should just be a quickie: I can't figure out how to convert r\x2019 to an int - could someone give me a hand please? Cheers -Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Determing whether two ranges overlap

2006-02-17 Thread Robin Haswell
Thanks guys, you've all been very helpful :-) -Rob -- http://mail.python.org/mailman/listinfo/python-list

Determing whether two ranges overlap

2006-02-16 Thread Robin Haswell
Hey guys I was wondering if you could give me a hand with something. If I have two tuples that define a range, eg: (10, 20), (15, 30), I need to determine whether the ranges overlap each other. The algo needs to catch: (10, 20) (15, 25) (15, 25) (10, 20) (10, 25) (15, 20) and (15, 20) (10, 25)

Python threading, and processes

2006-02-08 Thread Robin Haswell
Hey there I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and Debian machines, and I've noticed that if I open a lot of threads (say, 50), I get lots of python processes with individual PIDs, which consume a disproportionate amount of CPU. Does this mean that Python is using

Re: Python threading, and processes

2006-02-08 Thread Robin Haswell
On Wed, 08 Feb 2006 14:24:38 +0100, Diez B. Roggisch wrote: Robin Haswell wrote: Hey there I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and Debian machines, and I've noticed that if I open a lot of threads (say, 50), I get lots of python processes with individual

Re: Dictionary inserts into MySQL (each key in its own field)

2006-01-27 Thread Robin Haswell
On Fri, 27 Jan 2006 00:03:30 -0800, Derick van Niekerk wrote: I have found many posts that deal with writing a dictionary to MySQL in a blob field - which I can't imagine why anybody would want to do it. I want to write each element of a dictionary onto a db table. The keys would match the

Re: Dictionary inserts into MySQL (each key in its own field)

2006-01-27 Thread Robin Haswell
On Fri, 27 Jan 2006 00:03:30 -0800, Derick van Niekerk wrote: I have found many posts that deal with writing a dictionary to MySQL in a blob field - which I can't imagine why anybody would want to do it. I want to write each element of a dictionary onto a db table. The keys would match the

xHTML/XML to Unicode (and back)

2006-01-24 Thread Robin Haswell
Hey guys I'm currently screenscraping some Swedish site, and i need a method to convert XML entities (amp; etc, plus #100; etc) to Unicode characters. I'm sure one of python's myriad of XML processors can do this but I can't find which one. Can anyone make any suggestions? Thanks -Rob --

Re: xHTML/XML to Unicode (and back)

2006-01-24 Thread Robin Haswell
On Tue, 24 Jan 2006 14:46:46 +0100, Fredrik Lundh wrote: Robin Haswell wrote: I'm currently screenscraping some Swedish site, and i need a method to convert XML entities (amp; etc, plus #100; etc) to Unicode characters. I'm sure one of python's myriad of XML processors can do this but I

DB API and thread safety

2006-01-20 Thread Robin Haswell
Hey guys I've been reading http://www.python.org/peps/pep-0249.html and I don't quite get what level of thread safety I need for my DB connections. If I call db = FOOdb::connect() at the start of my app, and then every thread does it's own c = db.cursor() at the top, what level of thread safety

Multiple modules with database access + general app design?

2006-01-19 Thread Robin Haswell
though $class-$method($args); ? And $class-$method() just does global $db; $db-query(...);. Any advice would be greatly appreciated! Cheers -Robin Haswell -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple modules with database access + general app design?

2006-01-19 Thread Robin Haswell
On Thu, 19 Jan 2006 12:23:12 +, Paul McGuire wrote: Robin Haswell [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hey people I'm an experience PHP programmer who's been writing python for a couple of weeks now. I'm writing quite a large application which I've decided to break

Re: Multiple modules with database access + general app design?

2006-01-19 Thread Robin Haswell
On Thu, 19 Jan 2006 14:37:34 +0100, Daniel Dittmar wrote: Robin Haswell wrote: cursor for every class instance. This application runs in a very simple threaded socket server - every time a new thread is created, we create a new db.cursor (m = getattr(modules, module)\n m.c = db.cursor

Re: Multiple modules with database access + general app design?

2006-01-19 Thread Robin Haswell
On Thu, 19 Jan 2006 15:43:58 +0100, Daniel Dittmar wrote: Robin Haswell wrote: On Thu, 19 Jan 2006 14:37:34 +0100, Daniel Dittmar wrote: If you use a threading server, you can't put the connection object into the module. Modules and hence module variables are shared across threads. You could

Re: Multiple modules with database access + general app design?

2006-01-19 Thread Robin Haswell
On Thu, 19 Jan 2006 06:38:39 -0800, Frank Millman wrote: Robin Haswell wrote: Hey people I'm an experience PHP programmer who's been writing python for a couple of weeks now. I'm writing quite a large application which I've decided to break down in to lots of modules (replacement