Re: Event driven server that wastes CPU when threaded doesn't

2006-11-02 Thread Bryan Olson
Jean-Paul Calderone wrote: > On Tue, 31 Oct 2006 07:33:59 GMT, Bryan Olson <[EMAIL PROTECTED]> > wrote: >> Snor wrote: >>> I'm attempting to create a lobby & game server for a multiplayer game, >>> and have hit a problem early on with the server de

Re: problem at installing phyton on windows

2007-03-26 Thread bryan rasmussen
hear they're gonna make a Phyton Commandant movie. Cheers, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: socket read timeout

2007-04-01 Thread Bryan Olson
rom a blocking-mode socket while another is writing to it? What stops it from being full duplex? -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: service for file monitoring

2007-04-22 Thread bryan rasmussen
coupled then use Python and WMI to do it, using the same method. http://tgolden.sc.sabren.com/python/wmi.html Cheers, Bryan Rasmussen On 4/21/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > well i tried reading that but that way i'll have to make the program > >

Re: working with files and directories

2006-11-27 Thread Bryan Olson
are constantly looking at: http://docs.python.org/lib/lib.html In this case, see 14.1.4, 11.1, and 11.10. Happy hacking. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: MI5 Persecution: Counter-surveillance sweep by Nationwide Investigations Group

2007-01-03 Thread bryan rasmussen
te detective >agency. > Lisp did that 20 years ago. Cheers, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there an obvious way to do this in python?

2006-08-03 Thread Bryan Olson
andard SQL. I bet you'll find your potential customers want it to run against the database they already have. The particular tables your system needs will become part of their larger schema. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows vs. Linux

2006-08-03 Thread Bryan Olson
Do you have anything > strange installed on your system? Tons of strange stuff, yes, but I just tried it on a couple machines on display at BestBuy, and it worked as I showed it. Maybe a recent change. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows vs. Linux

2006-08-03 Thread Bryan Olson
nted out, they use '/' elsewhere on command lines to introduce options, so it could be ambiguous as the first character of a path name. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows vs. Linux

2006-08-04 Thread Bryan Olson
Duncan Booth wrote: > Bryan Olson wrote: > >> Duncan Booth wrote: >>> [EMAIL PROTECTED] wrote: >>> >>>> >From a WinXP command prompt: >>>> >>>> C:\> >>>> C:\>cd /windows/system32 >>>> >&g

Re: Windows vs. Linux

2006-08-04 Thread Bryan Olson
Duncan Booth wrote: > Bryan Olson wrote: > >> Not quite. The first slash is ambiguous and apparently ignored, >> but latter slashes are taken as a path separators. > > I'm not sure ambiguity enters into it. I think perhaps the bad detection of > the option ha

Re: Windows vs. Linux

2006-08-04 Thread Bryan Olson
Duncan Booth wrote: > Bryan Olson wrote: > >> Duncan Booth wrote: >>> Any other Microsoft commands I try all complain about 'invalid >>> switch'. >> >> The first I noticed were their build tools. Their version of >> "make",

Re: Thread Question

2006-08-05 Thread Bryan Olson
flag false.) If more that one thread is waiting to acquire the lock, it may be blocked longer. I think the doc for threading.Lock is good: http://docs.python.org/lib/lock-objects.html -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread Question

2006-08-05 Thread Bryan Olson
ut of the function, so your code might read, in part: ziplock = threading.Lock() def run(request, response, func=copy_first_match): # And so on... -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Advice on a TCP passthru daemon for HTTP proxy rotation

2006-08-10 Thread Bryan Olson
s from what they log, but proxying at the TCP level, you're limited as to what information you can get. May I ask why you need many Squid proxies? Unless you're using them to terminating SSL/TLS connections, just one of them can probably out-run a Python port-forwarder. Squid usually serv

Re: start a multi-sockets server (a socket/per thread) with different ports but same host

2006-08-12 Thread Bryan Olson
e the Queue from the Python library, and call wxPostEvent to tell the GUI go wake up and check the queue. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: NNTPLIB STRANGE ERROR

2006-08-13 Thread Bryan Olson
d it. Does it happen consistently at that point? -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Stopping all threads from other thread

2006-08-19 Thread Bryan Olson
rately does not offer a threadicide method. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: sum and strings

2006-08-25 Thread Bryan Olson
n be symmetric an transitive, and classes implementing addition provide an additive identity. > (after all, questions about type errors like "cannot concatenate 'str' > and 'int' objects" and "unsupported operand type(s) for +: 'int' and > 'str'" are a *lot* more common than questions about sum() on string lists.) Right. Duck-typing can work, while sloppy typing is doomed. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: sum and strings

2006-08-25 Thread Bryan Olson
f least astonishment suggests that "sum" should > conconcatenate several strings. Absolutely. > I'm not sure what you mean by addition being symmetric or transitive; > it is not an equivalence relation. Do you mean commutative and > associative? Oops, yes, of course. Posting to

Re: get a line of text from a socket...

2006-08-26 Thread Bryan Olson
k in this case. I've never been willing, nor seen the need, to re-write all code in Twisted's deferred form. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
tion is file locking. Unfortunately, the Python tandard distribution doesn't have a portable file lock, but you can do it on Unix and Win NT or better. See: http://mail.python.org/pipermail/python-win32/2005-February/002957.html and/or http://aspn.activestate.com/ASPN/Cookbook/Python/Re

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
. Other reasonable solutions are to re-name the file, work with the renamed version, then change it back after closing; and to use "lock files", which Wikipedia explains near the bottom of the "File locking" article. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
's CreateFile. You can also lock specific byte ranges in a file. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables in nested functions

2006-08-30 Thread Bryan Olson
[0] > wrapa[0] = "inner" > return inner As of Python 2.2, scopes nest, as per PEP 227. We still need a mutable, but not a default argument: def outer(): a = ["outer"] def inner(): print a[0] a[0] = "inner" return inner -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads and Progress Bar

2006-09-02 Thread Bryan Olson
headers['Content-Length']) > data = open(sFile,'wb') Incidentally, not all HTTP responses with bodies have a 'Content-Length' header. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: disgrating a list

2006-09-02 Thread Bryan Olson
;s not usually what people want. It's not just a string problem. Flattening arbitrary sequences of Foo-like things assumes that no one implements objects that are both Foos and sequences. Duck-typing lets you treat lots of types of things polymorphically, but it breaks the partitioning by kind that flatten() requires. Fortunately there's no real need for a general flatten(). -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: threading support in python

2006-09-05 Thread Bryan Olson
ems. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: threading support in python

2006-09-05 Thread Bryan Olson
sed > normally. I think it's even worse. The standard Python library offers shared memory, but not cross-process locks. Sharing read-write memory looks like an automatic race condition. I guess one could implement one of the primitive spin-lock based mutual exclusion algorithms, but

Re: threading support in python

2006-09-06 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > Bryan Olson wrote: >> I think it's even worse. The standard Python library offers >> shared memory, but not cross-process locks. > > File locks are supported by the standard library (at least on Unix, > I've not tried on Windows).

Re: threading support in python

2006-09-06 Thread Bryan Olson
I wrote: > Ah, O.K. Like Paul, I was unaware how Unix file worked with > mmap. Insert "locking" after "file". -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: mobile phone app

2006-09-08 Thread bryan rasmussen
The S60 series of phones from nokia supports python http://www.google.com/search?hl=en&q=s60+nokia Cheers, Bryan Rasmussen On 9/8/06, Aravind <[EMAIL PROTECTED]> wrote: > hi, > > Can anyone tell me if python can be used for developing mobile phone apps as > Java ? If yes,

Re: mysqldb + multi-threading

2006-09-08 Thread Bryan Olson
portable, and work well on modern MS-Windows. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: mysqldb + multi-threading

2006-09-08 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > Bryan> MySQL has its own process. It doesn't know nor care whether your > Bryan> application makes connections from different processes or > Bryan> different threads in the same process. > > Yes, but on the client side the data

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-08 Thread Bryan Olson
for Large Shared Data Banks." /Communications of the ACM/, Vol. 13, No. 6, June 1970, pp. 377-387. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: mysqldb + multi-threading

2006-09-08 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > Bryan> Go with your gut. Python threads are reasonably portable, and > Bryan> work well on modern MS-Windows. > > >> Maybe ignore your gut and read the documentation. ;-) > > Bryan> What in the documentation do you thi

Re: How to stop an [Rpyc] server thread?

2006-09-11 Thread Bryan Olson
or the other sockets.. After modest investigation, it looks like a bug in Python's sockets, at least on WinXP. Try inserting the line after accept(): [...] newsock, name = sock.accept() newsock.settimeout(None) [...] -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread Bryan Olson
ed by DFA's. What Python uses is search-and-backtrack. Unfortunately such engines don't have much theory behind them, and it's hard to reason generally about what they do. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the "longest possible" match with Python's RE module?

2006-09-12 Thread Bryan Olson
Tim Peters wrote: > [Bryan Olson] >> Unfortunately, the stuff about NFA's is wrong. Friedl's awful >> book > > Strongly disagree: [...] I know I'm disagreeing with a lot of smart people in panning the book. >> What Python uses is search-and-backtrack

Re: How to get the "longest possible" match with Python's RE module?

2006-09-12 Thread Bryan Olson
in my application I hope to get the longest possible > match, starting from a given point. > > Is there a way to do this in Python? Yes. Here's a way, but it sucks real bad: def longest_match(re_string, text): regexp = re.compile('(?:' + re_string +

Re: How to get the "longest possible" match with Python's RE module?

2006-09-12 Thread Bryan Olson
alone hit its limit). So how general is that? The books just says "certain common expressions". I think the real answer is that one can unroll exactly the true regular expressions. The unrolling is essentially resolving the states of a DFA by hand. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the "longest possible" match with Python's RE module?

2006-09-12 Thread Bryan Olson
s a regexp that efficiently matches the longest of prefix equal to any of the strings. If the application is like the examples, where the target RE is just the or of strings, the method should work well. http://groups.google.com/group/comp.lang.python/msg/a22eb274845653e9 Now I'm thinking of a more general version, that handles all true regular expressions. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-14 Thread Bryan Olson
Ben Sizer wrote: > Bryan Olson wrote: >> Ben Sizer wrote: >>> It's not a crackpot theory. It's a completely reasonable theory. SQL is >>> based on relational algebra, which provides a mathematical set of >>> operators for grouping data that is stored i

Re: Outbound port on sockets

2006-09-14 Thread Bryan Olson
either can't do that nor need it. It's not the issue here, but to specify the outgoing port call bind(('', portnum)) before connect(). -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert a timedelta object to a string?

2006-09-14 Thread Bryan Olson
e.gmtime(delta.seconds)) > '06:20:20' On the other hand: >>> startTime = datetime.timedelta(hours=28) >>> stopTime = datetime.timedelta(hours=4) >>> delta = startTime-stopTime >>> time.strftime("%H:%M:%S",time.gmtime(delta.seconds)) '00:00:00' -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: add without carry

2006-09-15 Thread Bryan Olson
Hugh wrote: > Sorry, here's an example... > > 5+7=12 > > added without carrying, 5+7=2 > > i.e the result is always less than 10 Are you looking for bitwise exclusive or? In Python it's the '^' operator. For example: print 5 ^ 7 -- --Bryan --

Re: add without carry

2006-09-15 Thread Bryan Olson
Bruno Desthuilliers wrote: > Bryan Olson wrote: >> Hugh wrote: >>> Sorry, here's an example... >>> >>> 5+7=12 >>> >>> added without carrying, 5+7=2 >>> >>> i.e the result is always less than 10 >> Are yo

Re: Outbound port on sockets

2006-09-17 Thread Bryan Olson
Grant Edwards wrote: > Diez B. Roggisch wrote: [Bryan Olson had written:] >>> It's not the issue here, but to specify the outgoing port >>> call bind(('', portnum)) before connect(). >> I wasn't aware of that. Cool. > > It's an interesti

Re: Outbound port on sockets

2006-09-17 Thread Bryan Olson
nd to the same interface (*IP address*) > that the inbound request arrived on. That way it's less likely that the > data stream will be routed differently from the control (port 21) stream. That still doesn't explain why they pass 20 as the port number. To specify an IP ad

Re: Yank Bastards KILLED THEIR OWN PEOPLE to stage 911 DRAMA

2007-01-27 Thread bryan rasmussen
See, if the python list mail server was written in Lisp Paul Graham would already have been able to write up a spam filter to ban this guy. Seriously though, shouldn't Thermate be banned by now. Cheers, Bryan Rasmussen On 26 Jan 2007 10:56:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED

Re: BYU Physics Prof Finds Thermate in WTC Physical Samples, Building Collapses an Inside Job

2007-01-31 Thread bryan rasmussen
the WTC and been killed. This would explain why trolling duties have been recently taken up by [EMAIL PROTECTED] on this list. Cheers, Bryan Rasmussen On 1/31/07, soutjhyDin <[EMAIL PROTECTED]> wrote: > > <[EMAIL PROTECTED]> wrote in message > news:[EMAI

starship.python.net is down

2007-02-16 Thread Tom Bryan
One of the system administrators had to reboot starship.python.net last night, but it appears that the machine did not come back up properly. starship.python.net is currently down while we investigate. ---Tom -- http://mail.python.org/mailman/listinfo/python-list

string.find returns -1 when string evidently in source file

2007-02-18 Thread bryan rasmussen
p 49 "Page Up" 4b Left 4d Right 4f End 50 Down 51 "Page Down" 52 Insert 53 Delete 54 <00> 56 Help 5b "Left Windows" 5c "Right Windows" 5d Application KEYNAME_DEAD 00b4"ACUTE ACCENT" 00a8"DIAERESIS" 007e"TILDE" 00b0"DEGREE SIGN" ENDKBD the encoding of the file is Unicode, I am able to return instances of individual characters but not whole words. Cheers, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: starship.python.net is down

2007-02-26 Thread Tom Bryan
[EMAIL PROTECTED] wrote: > Any news on starship.python.net? It still seems to be down. Yes. Unfortunately, there may be a hardware problem. Stefan, the admin who owns the hosted machine, is working with the host company to determine what's going on. I think that they are still in the "inve

Help Deciphering Code

2007-03-05 Thread Bryan Leber
Good Morning, I am learning python and I am having to make some changes on an existing python script. What happens is that one scripts creates an xml document that looks like this: http://www.fischerinternational.com> [EMAIL PROTECTED] Cell:(239)963-5267 Secu

Re: multithreading concept

2007-03-08 Thread Bryan Olson
in the area. Microsoft's Win32 threads can claim to get as close as anything. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Slightly OT: Why all the spam?

2007-05-22 Thread bryan rasmussen
anybody has any good filters worked up that will work in Gmail for reading python-list. Cheers, Bryan Rasmussen On 5/22/07, Joel Hedlund <[EMAIL PROTECTED]> wrote: > Does anyone know why we get so much spam to this group? It's starting to > get embarrasing to read at work an

crawlers in python with graphing?

2006-06-19 Thread bryan rasmussen
nload the pages but just follow the links, and output graphs. Cheers Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: crawlers in python with graphing?

2006-06-20 Thread bryan rasmussen
Hi, Sorry, was imprecise, I meant not save the downloaded page locally. There probably isn't one though, so I should build one myself. Probably just need a good crawler that can be set to dump all links into dataset that I can analyse with R. Cheers, Bryan Rasmussen On 6/19/06, Marc '

CD insert/eject detection

2007-03-13 Thread Mark Bryan Yu
Hi, I'm trying to make a Audio CD ripper using python. is there a way (library, module, etc) to detect when a CD was inserted or ejected? -- http://mail.python.org/mailman/listinfo/python-list

Re: CD insert/eject detection

2007-03-13 Thread Mark Bryan Yu
On Mar 13, 11:07 am, Larry Bates <[EMAIL PROTECTED]> wrote: > Mark Bryan Yu wrote: > > Hi, > > > I'm trying to make a Audio CD ripper using python. > > > is there a way (library, module, etc) to detect when a CD was inserted > > or ejected? > >

Punit v 0.1 - Python CD ripper

2007-03-20 Thread Mark Bryan Yu
Here's the initial release of my personal open source project to create a Python CD ripper in Linux. Punit is a Audio CD ripper for Linux using cdparanoia, LAME and CDDB.py (http://cddb-py.sourceforge.net/) http://www.programmingmind.com/bryan/punit.html -- http://mail.python.org/ma

<    1   2   3   4