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

2006-09-07 Thread Tal Einat
Saizan wrote: > I embedded an Rpyc threaded server in a preexistent daemon (an irc > bot), this is actually very simple; > start_threaded_server(port = DEFAULT_PORT) > then I had the necessity to stop the thread which accept() new > connections without killing the whole app, the thread is simply

Re: Question about subclassing and overriding methods

2006-09-07 Thread Frank Millman
Dennis Lee Bieber wrote: > On 7 Sep 2006 01:33:30 -0700, "Frank Millman" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > In my particular case, when I do subclass Test, y is always True. > > Therefore I can rewrite it like this - > > > > class Test2(Test): > > def __in

Re: help with unicode email parse

2006-09-07 Thread neoedmund
john , you can look my code: it downloads email and save to local filesystem(filename and email contains non-english characters) it works now. but i still think python's unicode string is not as straightforward as java's string SHOULD always be unicode. or i'm trouble dealing them when they are in

Re: Random image downloader for newsgroups (first script)

2006-09-07 Thread Patrick Ellis
Kim wrote: > Random image downloader for specified newsgroup. Hi I'm writing a > small script that will download random images from a specified > newsgroup. I've imported yenc into the script but I can't open the > image or save it. This is my first script so be gentle! > > Heres the script > > > #

Re: Negation in regular expressions

2006-09-07 Thread Paddy
Paddy wrote: > George Sakkis wrote: > > It's always striked me as odd that you can express negation of a single > > character in regexps, but not any more complex expression. Is there a > > general way around this shortcoming ? Here's an example to illustrate a > > use case: > > > > >>> import re

Re: Negation in regular expressions

2006-09-07 Thread Paddy
George Sakkis wrote: > It's always striked me as odd that you can express negation of a single > character in regexps, but not any more complex expression. Is there a > general way around this shortcoming ? Here's an example to illustrate a > use case: > > >>> import re > # split with '@' as delim

Re: help with unicode email parse

2006-09-07 Thread John Machin
neoedmund wrote: [top-posting corrected] > John Machin wrote: > > neoedmund wrote: > > > i want to get the subject from email and construct a filename with the > > > subject. > > > but tried a lot, always got error like this: > > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in positi

[ANN] geopy: a Geocoding Toolbox for Python

2006-09-07 Thread Brian Beck
Hello Pythonistas, I'm happy to announce the first (alpha) release of geopy, a geocoding toolbox for Python: http://exogen.case.edu/projects/geopy/ ABOUT geopy includes five geocoders and some methods to make dealing with geocoded data easier (such as parsing numerous latitude & longitude format

Re: Positive lookahead assertion

2006-09-07 Thread Paddy
Paddy wrote: > tobiah wrote: > > >> Posted via a free Usenet account from http://www.teranews.com > > > Its all about context. If you want to match something but only if it > > > precedes something else, then you follow the regular expression for > > > 'something' by the regular expression for 'som

Re: what is java's System.currentTimeMillis() in python

2006-09-07 Thread skip
neoedmund> public static native long currentTimeMillis(); neoedmund> python's time.clock() time.time() return a float, i think neoedmund> it's not as handy as java's currentTimeMillis() any good neoedmund> solution? How about int(time.clock() * 1000) or int(time.ti

Re: IronPython on Mono howto

2006-09-07 Thread skip
>> One thing I did find especially annoying though was that none of the >> editing keys worked. Seo> It is a known problem. It is a Mono bug. (ncurses-based colored Seo> console is not really complete.) There is a workaround. Thanks, it worked perfectly. I guess the white text o

what is java's System.currentTimeMillis() in python

2006-09-07 Thread neoedmund
/** * Returns the current time in milliseconds. Note that * while the unit of time of the return value is a millisecond, * the granularity of the value depends on the underlying * operating system and may be larger. For example, many * operating systems measure time

Re: help with unicode email parse

2006-09-07 Thread neoedmund
thank you John and Diez. i found fn = "%s/%s-%s.mail"%("d:/mail", "12345", '\xe6\xb5\x8b\xe8\xaf\x95' ) is ok fn = "%s/%s-%s.mail"%(u"d:/mail", "12345", '\xe6\xb5\x8b\xe8\xaf\x95' ) results: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128) So "str"%(

Re: Positive lookahead assertion

2006-09-07 Thread Carl Banks
tobiah wrote: > Sorry, I should have tried harder. I see that the text > of the match is simply not consumed, so that: > > m = re.search('(?=foo)fo', 'food') > > succeeds, while > > m = re.search('(?=fox)fo', 'food') > > does not. They are more commonly used, and generally more useful

Re: Positive lookahead assertion

2006-09-07 Thread Paddy
tobiah wrote: > >> Posted via a free Usenet account from http://www.teranews.com > > Its all about context. If you want to match something but only if it > > precedes something else, then you follow the regular expression for > > 'something' by the regular expression for 'something else' where > >

Re: IronPython on Mono howto

2006-09-07 Thread sanxiyn
[EMAIL PROTECTED] wrote: > One thing I did find especially annoying though was that none of the editing > keys worked. DELETE, BACKSPACE, Ctrl-U. All just inserted themselves. > Ctrl-D didn't exit. (I had to "raise SystemExit" to exit.) > > Is this a known problem? Is it a Mono thing or an Iron

Re: Secure Postgres access

2006-09-07 Thread Paul Rubin
Paul Rubin writes: > You'd use SCM_CREDENTIALS to > authenticate the user ID, then send the Postgres client's originating > TCP port number over the Unix socket, and that would tell the SSH > client that it could then start forwarding the TCP packets. Yucch, > this is me

Best Middle Tier Architechure?

2006-09-07 Thread Butternut Squash
What do you guys recommend for doing middle tier in python. I want to hide the database from the application and have it just use business logic. right now we are using c# and .net remoting in a way that just is not efficient. I want to rewrite a lot of what we do in python. I have seen XML-RPC a

Request for tips on my first python script.

2006-09-07 Thread Lex Hider
Hi, Apologies if this is against etiquette. I've just got my first python app up and running. It is a podcast aggregator depending on feedparser. I've really only learnt enough to get this up and running. Any tips on the code quality and use of python would be appreciated. I've got a feeling th

Re: Secure Postgres access

2006-09-07 Thread Paul Rubin
Reid Priedhorsky <[EMAIL PROTECTED]> writes: > > Wouldn't they need a database password? > > Well, right now, no. I have Postgres configured to trust the OS on who is > who. You trust the OS on the client machine, but not the client machine's users? Does it run identd? Maybe you could use that

PILGraph Upgrade or Alternative Suggestion

2006-09-07 Thread Roger
Anyone have an updated version of PILGraph beyond 0.1a7 or a suggestion for a light-weight alternative? By light-weight I mean something that doesn't require many/any packages other than PIL and will create plain old round pie-chart PNG graphics with titles and legends. I do need multi-platfor

Re: Secure Postgres access

2006-09-07 Thread Reid Priedhorsky
On Wed, 06 Sep 2006 09:29:59 -0700, Paul Rubin wrote: > Reid Priedhorsky <[EMAIL PROTECTED]> writes: >> I know how to forward ports using SSH, but I don't like doing this because >> then anyone who knows the port number can connect to Postgres over the >> same tunnel. (I'm not the only user on the

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread George Sakkis
Francach wrote: > Hi, > > I'm trying to use the Beautiful Soup package to parse through the > "bookmarks.html" file which Firefox exports all your bookmarks into. > I've been struggling with the documentation trying to figure out how to > extract all the urls. Has anybody got a couple of longer exa

Re: IronPython 1.0 released today!

2006-09-07 Thread Felipe Almeida Lessa
7 Sep 2006 16:34:56 -0700, Luis M. González <[EMAIL PROTECTED]>: > People are already porting some of these libraries. > Those that are written in pure python don't need to be ported, but > those that rely on c extensions can be rewritten in c# or any other > .NET language. Or in C that is P/Invok

Re: split string problems

2006-09-07 Thread John McMonagle
On Thu, 2006-09-07 at 16:21 -0700, Tempo wrote: > [ > $14.99 > , > $27.99 > , > $66.99 >

Re: the same strings, different utf-8 repr values?

2006-09-07 Thread Slowness Chen
got it. thanks. John Machin 写道: > [EMAIL PROTECTED] wrote: > > I have two files: > > > > test.py: > > -- > > # -*- encoding : utf8 -*- > > print 'in this file', repr('中文') > > > > # tt.txt is saved as utf8 encoding > > f = file('tt.txt') > > line1 =

Re: wxPython

2006-09-07 Thread [EMAIL PROTECTED]
I'm on Fedora Core 4, that's Linux. Thanks anyways. [EMAIL PROTECTED] wrote: > I suspect that your version for 2.4 is later than the one I installed a > couple weeks ago. That one was 2.6.1.0 You could possibly have the > one for python 2.5. I had trouble downloading that and pywin for the > p.

Re: wxPython: StaticText Event

2006-09-07 Thread John McMonagle
> Hovering mouse over the StaticText Control should generate an > EVT_ENTER_WINDOW event like the TextCtrl Control, but it does not happen. > > How can I make the StaticText event working? > According to the book "wxPython In Action", page 186: "One feature that you cannot see from just the fi

Re: wxPython: StaticText Event

2006-09-07 Thread Amaury Forgeot d'Arc
David a écrit : > Plaese look at this simple class. (...code...) > Hovering mouse over the StaticText Control should generate an > EVT_ENTER_WINDOW event like the TextCtrl Control, but it does not happen. > > How can I make the StaticText event working? I quick Google search found the following t

Negation in regular expressions

2006-09-07 Thread George Sakkis
It's always striked me as odd that you can express negation of a single character in regexps, but not any more complex expression. Is there a general way around this shortcoming ? Here's an example to illustrate a use case: >>> import re # split with '@' as delimiter >>> [g.group() for g in re.fin

Re: Extracting text from a string

2006-09-07 Thread Paul Rubin
"Tim Williams" <[EMAIL PROTECTED]> writes: > or even more terse, > >>> print '\n'.join([i for i in s.splitlines ()[1::2]]) I think it's more robust to use a regexp. prices = re.findall('\$\d+\.\d\d', s) print '\n'.join(prices) -- http://mail.python.org/mailman/listinfo/python-list

wxPython: StaticText Event

2006-09-07 Thread David
Plaese look at this simple class. import wx class MyFrame(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, "Hide test", size=(160,160)) # create widgets self.pnl = wx.Panel(self) self.st = wx.StaticText(self.p

Re: Extracting text from a string

2006-09-07 Thread Tim Williams
On 08/09/06, Tim Williams <[EMAIL PROTECTED]> wrote: > >>> print '\n'.join([i for i in s.splitlines() if i[0] == '$']) > $14.99 > $27.99 > $66.99 > $129.99 > $254.99 > or even more terse, >>> print '\n'.join([i for i in s.splitlines ()[1::2]]) $14.99 $27.99 $66.99 $129.99 $254.99 -- http://mail

Re: Extracting text from a string

2006-09-07 Thread Tim Williams
On 07/09/06, Anthra Norell <[EMAIL PROTECTED]> wrote: > s = ''' > $14.99 > , > $27.99 > , > $66.99 > , > $129.99 > , > $254.99 >''' > > >>> for line in [l.strip () for l in s.splitlines ()]: > if line [0] == '$': print line > > $14.99 > $27

Re: split string problems

2006-09-07 Thread Andy Terrel
try str(p).split()[2] your class is using the __str__ attribute to print and I am guessing that is what you are seeing. Tempo wrote: > Hey. I am trying to grab the prices from the string below but I get a > few errors when I try to do it: Take a look at the code and error > messages below for me

Re: wxPython

2006-09-07 Thread [EMAIL PROTECTED]
I suspect that your version for 2.4 is later than the one I installed a couple weeks ago. That one was 2.6.1.0 You could possibly have the one for python 2.5. I had trouble downloading that and pywin for the p.c. If you don't care about pywin you can consider python 2.5. Even if it is evident

the first arg to super() must be a type, not a class obj?

2006-09-07 Thread metaperl
On p.282 of "Python Cookbook" and in the Python docs on calling super: http://www.python.org/download/releases/2.2.3/descrintro/#cooperation it is clear that the first argument to super is a class and not a type. However, for the code below, I am getting an error when attempting to provide a class

Re: IronPython 1.0 released today!

2006-09-07 Thread Luis M. González
Chris wrote: > Diez B. Roggisch wrote: > > Chris wrote: > > > >> Jim Hugunin wrote: > >>> I'm extremely happy to announce that we have released IronPython 1.0 > >>> today! > >>> http://www.codeplex.com/IronPython > >> > >> > >> I'm no code guru but it sounds interesting. So can I import numpy, >

Specifying a custom formatter in logging config file

2006-09-07 Thread Gardner Pomper
I have been wanting to have my logging messages indented based on the level in the call stack. I found a recipe online for defining such a formatter ( Stack-based indentation of formatted logging) but I can't figure out how to specify that formatter in the file that I read using logging.fileConfig.

split string problems

2006-09-07 Thread Tempo
Hey. I am trying to grab the prices from the string below but I get a few errors when I try to do it: Take a look at the code and error messages below for me and thanks you in advanced to all that help. Thank you. Here's the code & error messages: >>> p [ $1

Re: should urlparse return user and pass in separate components?

2006-09-07 Thread Larry Bates
Oops, sorry missed something converting from a method to a function: Here is a function that I wrote to do that. It doesn't do exactly what you want, but might save you some time. def spliturl(url): ''' spliturl - method to split composite url into its component parts ftp:

Re: Add NTLM proxy authentication to urllib2

2006-09-07 Thread John J. Lee
Jarek Zgoda <[EMAIL PROTECTED]> writes: > looping napisał(a): > > > I have to make internet connections through an ISA proxy server that > > use NTLM or Kerberos authorization method. > > I've found a program in python called ntlmaps that act like a proxy and > > could make the NTLM authenticatio

Re: Testing a website with HTTPS login and cookies

2006-09-07 Thread John J. Lee
Hari Sekhon <[EMAIL PROTECTED]> writes: > I want to create a test that will do a proper login test to a web site > but I need some pointers. > > I need to login to the website by accessing an https url and posting > to that, which should return a very small 302 reply with the address > of the int

Re: Refactor a buffered class...

2006-09-07 Thread George Sakkis
Michael Spencer wrote: > I think the two versions below each give the 'correct' output wrt to the OP's > single test case. I measure chunkerMS2 to be faster than chunkerGS2 across > all > chunk sizes, but this is all about the joins. > > I conclude that chunkerGS's deque beats chunkerMS's list f

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

2006-09-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Bruno Desthuilliers wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Probably just me. I've only been using Access and SQL Server >>>for 12 years, so I'm sure my opinions don't count for anything. >>> >> >>SQLite never pretended to be a full-blown RDBMS - just a lightweight >>s

Re: Unicode string handling problem

2006-09-07 Thread John Machin
Richard Schulman wrote: > It turns out that the Unicode input files I was working with (from MS > Word and MS Notepad) were indeed creating eol sequences of \r\n, not > \n\n as I had originally thought. The file reading statement that I > was using, with unpredictable results, was > > #in_file = >

Re: Two ethernet cards/networks (still)

2006-09-07 Thread Steve Holden
Bob Greschke wrote: > There is a lot to stuff that seems to skirt around this issue (most of which > has to do with finding your IP address), but I can't find anything that > explains how to write a client that (in my case) needs to collect some > information from some equipment on a private net

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread Tim Williams
On 7 Sep 2006 14:30:25 -0700, Adam Jones <[EMAIL PROTECTED]> wrote: > > Francach wrote: > > Hi, > > > > I'm trying to use the Beautiful Soup package to parse through the > > "bookmarks.html" file which Firefox exports all your bookmarks into. > > I've been struggling with the documentation trying t

Re: Testing a website with HTTPS login and cookies

2006-09-07 Thread John J. Lee
"Sandra-24" <[EMAIL PROTECTED]> writes: > Hari Sekhon wrote: > > If anybody knows how to do this could they please give me a quick > > pointer and tell me what libraries I need to go read up on? > > > > One word. Selenium. Didn't sound like a good fit for Selenium to me. Selenium's great, but

Re: [ANN] IronPython 1.0 released today!

2006-09-07 Thread John J. Lee
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: [...re Scipy on IronPython...] > No, you can't. I'm not sure if there are any bridging attempts being made, > but in this respect IronPython is the same as Jython - a completely > different runtime which executes its own byte-code. Haven't heard re S

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

2006-09-07 Thread [EMAIL PROTECTED]
Bruno Desthuilliers wrote: > [EMAIL PROTECTED] wrote: > > Probably just me. I've only been using Access and SQL Server > > for 12 years, so I'm sure my opinions don't count for anything. > > > > SQLite never pretended to be a full-blown RDBMS - just a lightweight > simple embedded database as SQL-c

Re: Automate Web Configuration

2006-09-07 Thread John J. Lee
Steve Holden <[EMAIL PROTECTED]> writes: > D wrote: > > I would like to write a program that will automate the configuation of > > a firewall or router via HTTPS. So, I need to import the applicable > > certificate, and be able to configure the unit as if I was > > typing/selecting the appropriat

Re: change property after inheritance

2006-09-07 Thread Steven Bethard
George Sakkis wrote: > Steven Bethard wrote: > >> David Isaac wrote: >>> Le mercredi 06 septembre 2006 16:33, Alan Isaac a écrit : > Suppose a class has properties and I want to change the > setter in a derived class. If the base class is mine, I can do this: > http://www.kylev.com/20

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread Adam Jones
Francach wrote: > Hi, > > I'm trying to use the Beautiful Soup package to parse through the > "bookmarks.html" file which Firefox exports all your bookmarks into. > I've been struggling with the documentation trying to figure out how to > extract all the urls. Has anybody got a couple of longer ex

Extracting text from a string

2006-09-07 Thread Anthra Norell
s = ''' $14.99 , $27.99 , $66.99 , $129.99 , $254.99 ''' >>> for line in [l.strip () for l in s.splitlines ()]: if line [0] == '$': print line $14.99 $27.99 $66.99 $129.99 $254.99 Why parse? Why regular expressions? Frederic -- http:

Re: How to build extensions on Windows?

2006-09-07 Thread Filip Wasilewski
Jarek Zgoda wrote: > Filip Wasilewski napisa³(a): > > > There is an easy way to build Python extensions on Windows with MinGW > > and it works fine for me. Just follow these steps: > > It was brougt to my attention that mingw-compiled extensions for Python > 2.4 use other malloc() that Python 2.4,

Re: [ANN] IronPython 1.0 released today!

2006-09-07 Thread Diez B. Roggisch
Duncan Booth schrieb: > [EMAIL PROTECTED] (Lawrence Oluyede) wrote: > >> Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote: >>> Does IronPython runs Twisted? >> I really don't think so. They don't have many needed modules, like >> select :-) >> > > So? IronPython has a select module although it does

Re: should urlparse return user and pass in separate components?

2006-09-07 Thread skip
metaperl> I personally would prefer that it be broken down a bit metaperl> further. What are existing opinions on this? I believe there have been noises made in this direction, and not that long ago. If a backward-compatible way of solving this problem could be worked out, I imagine this

Re: Looking for the Perfect Editor

2006-09-07 Thread Claudio Grondi
Omar wrote: > I'd love the perfect editor that would be: > > a) free > > b) enable me to drag and drop code snippets from a sort of browser into > the code > > c) can run programs right from within > > d) can edit > - PYTHON > - Javascript > - HTML > - actionscript (sinc

Re: [ANN] IronPython 1.0 released today!

2006-09-07 Thread Lawrence Oluyede
Duncan Booth <[EMAIL PROTECTED]> wrote: > So? IronPython has a select module although it doesn't seem to be complete > yet. The IronPython mailing list has discussions about getting CherryPy to > run, and it sounds as though it isn't quite there yet, but it is getting > there. I don't think my ans

Re: [ANN] IronPython 1.0 released today!

2006-09-07 Thread Duncan Booth
[EMAIL PROTECTED] (Lawrence Oluyede) wrote: > Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote: >> Does IronPython runs Twisted? > > I really don't think so. They don't have many needed modules, like > select :-) > So? IronPython has a select module although it doesn't seem to be complete yet. T

Re: xmingw and f2py

2006-09-07 Thread Flavio
Flavio wrote: > Hi, > > has anyone tried to build extensions for win32 on Linux using xmingw? > > I need to use f2py to compile code for the win32 platform and I want to > do this in Linux. I googled aroung but could not find any documentation > on this. > > For those who dont know xmingw is a por

should urlparse return user and pass in separate components?

2006-09-07 Thread metaperl
The urlparse with Python 2.4.3 includes the user and pass in the site aspect of its parse: >>> scheme, site, path, parms, query, fid = >>> urlparse.urlparse("http://bill:[EMAIL PROTECTED]/lib/module-urlparse.html") >>> site 'bill:[EMAIL PROTECTED]' I personally would prefer that it be broken d

Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread Anthra Norell
> Hi, > > I'm trying to use the Beautiful Soup package to parse through the > "bookmarks.html" file which Firefox exports all your bookmarks into. > 've been struggling with the documentation trying to figure out how to > extract all the urls. Has anybody got a couple of longer examples using > Bea

Re: Positive lookahead assertion

2006-09-07 Thread tobiah
>> Posted via a free Usenet account from http://www.teranews.com > Its all about context. If you want to match something but only if it > precedes something else, then you follow the regular expression for > 'something' by the regular expression for 'something else' where > `something else` is enc

Re: How to build extensions on Windows?

2006-09-07 Thread Jarek Zgoda
Filip Wasilewski napisał(a): > There is an easy way to build Python extensions on Windows with MinGW > and it works fine for me. Just follow these steps: It was brougt to my attention that mingw-compiled extensions for Python 2.4 use other malloc() that Python 2.4, is it true? Can this have any i

Re: Positive lookahead assertion

2006-09-07 Thread Neil Cerutti
On 2006-09-07, Paddy <[EMAIL PROTECTED]> wrote: > tobiah wrote: >> (?=...) >> Positive lookahead assertion. This succeeds if the contained >> regular expression, represented here by ..., successfully >> matches at the current location, and fails otherwise. But, >> once the contained expression has

Re: Extracting text from a string

2006-09-07 Thread Claudio Grondi
Tempo wrote: > This is the output I get: > > > > prices > > [ > $14.99 > , > $27.99 > , > $66.99 >

Re: Positive lookahead assertion

2006-09-07 Thread Paddy
tobiah wrote: > (?=...) > Positive lookahead assertion. This succeeds if the contained > regular expression, represented here by ..., successfully > matches at the current location, and fails otherwise. > But, once the contained expression has been tried, the > matching engine doesn't advance at a

Re: Automate Web Configuration

2006-09-07 Thread expert-services
It is not FREE and not python, but you can try automation software like Automation Anywhere http://www.tethyssolutions.com/automation-software.htm to automate this task and more. Just record your actions in web browser and it will replay it back accurately. You can also try Workspace Macro Pro, ht

Looking for the Perfect Editor

2006-09-07 Thread Omar
I'd love the perfect editor that would be: a) free b) enable me to drag and drop code snippets from a sort of browser into the code c) can run programs right from within d) can edit - PYTHON - Javascript - HTML - actionscript (since I'm also learning flash) e) easy to l

Re: Positive lookahead assertion

2006-09-07 Thread tobiah
Sorry, I should have tried harder. I see that the text of the match is simply not consumed, so that: m = re.search('(?=foo)fo', 'food') succeeds, while m = re.search('(?=fox)fo', 'food') does not. tobiah wrote: > (?=...) > Positive lookahead assertion. This succeeds if the c

wxPython

2006-09-07 Thread [EMAIL PROTECTED]
Hello everyone, I'm new at this so please be gentle. I have Python 2.4 on fc4. I installed easy_install and Python in my home directory since I don't have root permissions. It works fine. Now I want to install wxPython. I downloaded wxPython-src2.6.3.3.tar.bz2 from the site and now I'm trying thi

Positive lookahead assertion

2006-09-07 Thread tobiah
(?=...) Positive lookahead assertion. This succeeds if the contained regular expression, represented here by ..., successfully matches at the current location, and fails otherwise. But, once the contained expression has been tried, the matching engine doesn't advance at all; the rest of the pa

How to stop an [Rpyc] server thread?

2006-09-07 Thread Saizan
I embedded an Rpyc threaded server in a preexistent daemon (an irc bot), this is actually very simple; start_threaded_server(port = DEFAULT_PORT) then I had the necessity to stop the thread which accept() new connections without killing the whole app, the thread is simply a while True that spawn

Re: Refactor a buffered class...

2006-09-07 Thread Michael Spencer
George Sakkis wrote: > Michael Spencer wrote: >> George Sakkis wrote: >>> Michael Spencer wrote: >>> def chunker(s, chunk_size=3, sentry=".", keep_first = False, keep_last = False): buffer=[] >> ... >>> And here's a (probably) more efficient version, using a deque as a >>> buff

Re: How to build extensions on Windows?

2006-09-07 Thread casevh
> 1. Get MinGW gcc and/or g++, preferably via MinGW installer from [1]. > You may have to restart your computer or manually edit PATH system > environment variable to include MinGW's bin directory (default is > c:\mingw\bin). Then check if it is there by typing `path` in the cmd > window. 1a. [Opt

Re: Extracting text from a string + note

2006-09-07 Thread samir
Saluton! Tempo wrote: > I am having a little trouble extracting text from a string. The > string that I am dealing with is pasted below, and I want to > extract the prices that are contained in the string below. This string is absolutely an XML chunk. Just use xmllib. Adiaux Samir -- htt

Re: python extension modules within packages not loading

2006-09-07 Thread Matthew Woodcraft
tyler <[EMAIL PROTECTED]> wrote: > I've written a small python extension but I'm having difficulty loading > it at runtime. The source for my extension is a module which is a > member of a package is organized as follows. > > test/setup.py > test/myutils/__init__.py > test/myutils/netmodule.c [..

Re: Printing Documents

2006-09-07 Thread Tim Golden
defcon8 wrote: > How can I print html documents in Python on Windows? Hopefully this technique will work: http://timgolden.me.uk/python/win32_how_do_i/print.html#shellexecute TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting text from a string + note

2006-09-07 Thread bearophileHUGS
Tempo: > I am having a little trouble extracting text from a string. The > string that I am dealing with is pasted below, and I want to > extract the prices that are contained in the string below. This may help: >>> import re >>> reg = r"(?<= \$ ) (?: \d* \.? \d* )" >>> prices = re.compile(r

Re: How to build extensions on Windows?

2006-09-07 Thread Lawrence Oluyede
Jason <[EMAIL PROTECTED]> wrote: > I don't know about MinGW, but you can get the Microsoft compilers by > installing Visual C++ 2005 Express. I'm guessing the old toolkit is > deprecated. While you must register each Visual Studio Express module > that you download, I don't think the actual comma

Re: How to build extensions on Windows?

2006-09-07 Thread Filip Wasilewski
Kevin D. Smith wrote: > I've written a simple Python extension for UNIX, but I need to get it > working on Windows now. I'm having some difficulties figuring out how > to do this. I've seen web pages that say that MS Visual Studio is > required, and other that say that's not true, that MinGW will

Re: 3 Simple Questions About Python/IDLE

2006-09-07 Thread Steve Holden
Dennis Lee Bieber wrote: > On 7 Sep 2006 06:53:44 -0700, "Omar" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>1) why don't python / idle use numbered lines in their scripting, like >>basic? how do you keep track of large batches of code without them? >> > > Beca

Re: Automate Web Configuration

2006-09-07 Thread Steve Holden
D wrote: > I would like to write a program that will automate the configuation of > a firewall or router via HTTPS. So, I need to import the applicable > certificate, and be able to configure the unit as if I was > typing/selecting the appropriate fields manually using a web browser. > If there is

Re: Random image downloader for newsgroups (first script)

2006-09-07 Thread utabintarbo
Skip Montanaro wrote: > > > SERVER = "news.server.co.uk" #Insert news server here > > > GROUP = "alt.binaries.pictures.blah" #newsgroup will go here > > > > Just why do I imagine there will be an adult newsgroup in the end? > > I can see the freshmeat announcement now: "Random Boob Visualizer

Re: Printing Documents

2006-09-07 Thread defcon8
Claudio Grondi wrote: > defcon8 wrote: > > How can I print html documents in Python on Windows? > > > ;-) > > 1. You start the Microsoft Internet Explorer and make some space on the > Desktop for a Python shell window. > 2. You start the Python shell and position it within the prepared space > 3.

Re: Extracting text from a string

2006-09-07 Thread Tempo
This is the output I get: >>> prices [ $14.99 , $27.99 , $66.99 ,

Re: Method resolution for super(Class, obj).

2006-09-07 Thread Steve Holden
ddtl wrote: > On 7 Sep 2006 10:42:54 -0700, in comp.lang.python you wrote: > > >>Let's examine what the mro order is for class D: >> >D.mro() >> >>[, , , >>>n__.A'>, ] >> >>When you call d.met(), the call dispatches to the D.met() method. >>After printing out 'D.met', you use super() to get t

Re: Extracting text from a string

2006-09-07 Thread Claudio Grondi
Tempo wrote: > Okay, so it sounds like I am in the right direction. However, I am not > sure that the text is in a string or some other format becasue the > string is enclosed in "[" and "]", not in ' '. > In case you have it like ['the string'], the actual string will be: ['the string'][0]. Just

Re: 3 Simple Questions About Python/IDLE

2006-09-07 Thread Neil Cerutti
On 2006-09-07, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 7 Sep 2006 06:53:44 -0700, "Omar" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: >> 1) why don't python / idle use numbered lines in their >> scripting, like basic? how do you keep track of large batches >> of cod

Re: Extracting text from a string

2006-09-07 Thread Tempo
Okay, so it sounds like I am in the right direction. However, I am not sure that the text is in a string or some other format becasue the string is enclosed in "[" and "]", not in ' '. -- http://mail.python.org/mailman/listinfo/python-list

Extracting text from a string

2006-09-07 Thread Tempo
Hello. I am having a little trouble extracting text from a string. The string that I am dealing with is pasted below, and I want to extract the prices that are contained in the string below. Thanks in advanced for any and all help. Thank you. $14.99

Re: Extracting text from a string

2006-09-07 Thread Claudio Grondi
Tempo wrote: > Hello. I am having a little trouble extracting text from a string. The > string that I am dealing with is pasted below, and I want to extract > the prices that are contained in the string below. Thanks in advanced > for any and all help. Thank you. > > > > >

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread Diez B. Roggisch
waylan schrieb: > Diez B. Roggisch wrote: >> suppose it is well-formed, most probably even xml. > > Maybe not. Otherwise, why would there be a script like this one[1]? > Anyway, I found that and other scripts that work with firefox > bookmarks.html files with a quick search [2]. Perhaps you will f

Re: Random image downloader for newsgroups (first script)

2006-09-07 Thread Skip Montanaro
> > SERVER = "news.server.co.uk" #Insert news server here > > GROUP = "alt.binaries.pictures.blah" #newsgroup will go here > > Just why do I imagine there will be an adult newsgroup in the end? I can see the freshmeat announcement now: "Random Boob Visualizer 1.0"... Skip -- http://mail.

Re: Printing Documents

2006-09-07 Thread Claudio Grondi
defcon8 wrote: > How can I print html documents in Python on Windows? > ;-) 1. You start the Microsoft Internet Explorer and make some space on the Desktop for a Python shell window. 2. You start the Python shell and position it within the prepared space 3. Still looking at the Python shell you

Re: Scientific computing and data visualization.

2006-09-07 Thread [EMAIL PROTECTED]
A commonly used data analysis framework is root (http://root.cern.ch). It offers a object oriented C++ framework with all kind of things one needs for plotting and data visualization. It comes along with PyRoot, an interface making the root objects available to Python. Take a look at the root manua

Re: Random image downloader for newsgroups (first script)

2006-09-07 Thread Diez B. Roggisch
Kim schrieb: > SERVER = "news.server.co.uk" #Insert news server here > GROUP = "alt.binaries.pictures.blah" #newsgroup will go here Just why do I imagine there will be an adult newsgroup in the end? SCNR, Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread Claudio Grondi
Diez B. Roggisch wrote: > Francach schrieb: > >> Hi, >> >> I'm trying to use the Beautiful Soup package to parse through the >> "bookmarks.html" file which Firefox exports all your bookmarks into. >> I've been struggling with the documentation trying to figure out how to >> extract all the urls. H

  1   2   3   >