Re: Any "consumer review generators" available?

2007-03-29 Thread nullified
On 29 Mar 2007 20:34:26 -0700, "Evil Otto" <[EMAIL PROTECTED]> wrote: >On Mar 29, 2:19 pm, [EMAIL PROTECTED] wrote: >> I am looking for a fake consumer review generator that could generate >> realistic looking reviews for any products, kind of like on amazon.com but >> generated by Artificial In

Re: Python 2.5 fails where 2.4 works when running external program

2007-03-29 Thread Heikki Toivonen
Peter Otten wrote: > I think Exception.args always was supposed to be a tuple. Starting with 2.5 > Python enforces that constraint: [...] > http://docs.python.org/tut/node10.html#SECTION001030 > """ > But use of .args is discouraged. Instead, the preferred use is to pass a > single

Remote XML Parsing

2007-03-29 Thread [EMAIL PROTECTED]
How can I parse a remote XML file with Python? And what will I be able to do with this XML file in Python? Sorry if this is a noob-ish question. -- http://mail.python.org/mailman/listinfo/python-list

Game programming for kids: looking for open source 2D game development kit

2007-03-29 Thread Max Kubierschky
Hello, I'm planning to give a game programming course for kids of mixed age. For this, I am looking for an open source 2D game development kit. I am also willing to participate in the development of the development kit. Features I'd like to see - Possibility to construct simple games via drag and

Cheeseshop needs mirrors

2007-03-29 Thread Jon
I'm a frequent helper in the IRC channel for the Pylons web framework. Pylons is installed from eggs using easy_install, and when Cheeseshop is down (or so slow it might as well be down), it gives a bad impression of our framework and Python in general. It took us half an hour to figure out how to

Re: Hpw make lists that are easy to sort.

2007-03-29 Thread Anton Vredegoor
Terry Reedy wrote: > If I understand correctly, you want to multiiply each of m numbers by each > of n numbers, giving m*n products. That is O(m*n) work. Inserting (and > extracting) each of these is a constant size m priority cue takes, I > believe, O(log(m)) work, for a total of m*n*log(m).

Re: What are OOP's Jargons and Complexities

2007-03-29 Thread Mike Schilling
Xah Lee wrote: > So, a simple code like this in normal languages: > > a = "a string"; > b = "another one"; > c = join(a,b); > print c; > > or in lisp style > > (set a "a string") > (set b "another one") > (set c (join a b)) > (print c) > > becomes in Java: > > public class test { > public static

Re: Python 2.5 fails where 2.4 works when running external program

2007-03-29 Thread Peter Otten
Heikki Toivonen wrote: > We have successfully used a script to run external programs for several > years. Now we upgraded our Python to 2.5, and are hitting a mysterious > error. > > The expected output from the sample script (see below) with 2.4 looks > like this: > > ret ['5\n'] > else > *

Re: PyPy for dummies

2007-03-29 Thread Paddy
On Mar 30, 1:10 am, Damjan <[EMAIL PROTECTED]> wrote: > .. like me. > > Ok, this is what I understood why PyPy is important. > > Writing programing languages and implementations (compilers, interpreters, > JITs, etc) is hard. Not many people can do it from scratch and create > something comparable

Re: Modal value of an array

2007-03-29 Thread Paddy
On Mar 30, 2:58 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Paddy <[EMAIL PROTECTED]> wrote: > >... > > > > > > A bit more directly: > > > > >>> foo = ["spam", "eggs", "spam", "spam", "spam", "beans", "eggs"] > > > >>> max(foo, key=foo.count) > > > > 'spam' > > > > Alex > > > This doesn't ca

Python 2.5 fails where 2.4 works when running external program

2007-03-29 Thread Heikki Toivonen
We have successfully used a script to run external programs for several years. Now we upgraded our Python to 2.5, and are hitting a mysterious error. The expected output from the sample script (see below) with 2.4 looks like this: ret ['5\n'] else ExternalCommandErrorWithOutp

Re: Any "consumer review generators" available?

2007-03-29 Thread Evil Otto
On Mar 29, 2:19 pm, [EMAIL PROTECTED] wrote: > I am looking for a fake consumer review generator that could generate > realistic looking reviews for any products, kind of like on amazon.com but > generated by Artificial Intelligence. Is there a package available in your > favorite programing lan

Re: pygtk: how to make a screenlocking window?

2007-03-29 Thread Dave Cook
On 2007-03-28, André Wyrwa <[EMAIL PROTECTED]> wrote: > can anyone please point me to the relevant pygtk window properties i > need to set to make a window > - fullscreen > - stay in front > - grab all input focus > so that i can use it as a screen lock the likes that gksu or > gnome-power-manager

Re: Creating a new data structure while filtering its data origin.

2007-03-29 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Hi everyone. > > I'm trying to work with very simple data structures but I'm stuck in the very > first steps. If someone has the luxury of a few minutes and can give an > advice how to resolve this, I'll really appreciate it. > > 1- I have a list of tuples like this:

Re: how can I clear a dictionary in python

2007-03-29 Thread Alex Martelli
Russ <[EMAIL PROTECTED]> wrote: > This little squabble got me thinking. I normally just use the > myDict={} method of "clearing" a > dictionary when I know there are no other references to it. However, I > wonder how the > efficiency of relying on the garbage collector to clear a dictionary > comp

Re: Modal value of an array

2007-03-29 Thread Alex Martelli
Paddy <[EMAIL PROTECTED]> wrote: ... > > A bit more directly: > > > > >>> foo = ["spam", "eggs", "spam", "spam", "spam", "beans", "eggs"] > > >>> max(foo, key=foo.count) > > > > 'spam' > > > > Alex > > This doesn't call foo.count for duplicate entries by keeping a cache > > >>> foo = ["spam",

Re: Finding a module's sub modules at runtime

2007-03-29 Thread Alex Martelli
Joshua J. Kugler <[EMAIL PROTECTED]> wrote: > On Thursday 29 March 2007 07:33, Alex Martelli wrote: > > > Joshua J. Kugler <[EMAIL PROTECTED]> wrote: > > > >> still be nicely portable. It just seems that since Python is gathering > >> that information anyway, it should make it available without

Re: how can I clear a dictionary in python

2007-03-29 Thread Russ
This little squabble got me thinking. I normally just use the myDict={} method of "clearing" a dictionary when I know there are no other references to it. However, I wonder how the efficiency of relying on the garbage collector to clear a dictionary compares with using the "clear" method. Does anyo

Re: Python automatic testing: mocking an imported module?

2007-03-29 Thread Silfheed
Wow, that works great! Thanks all! On Mar 28, 12:02 am, Ben Finney <[EMAIL PROTECTED]> wrote: > "Silfheed" <[EMAIL PROTECTED]> writes: > = foo.py = > class Bar(object): > def __init__(self): > self.name = "bar" > = > > = dostuff.py = > import foo > > def get_bar()

Re: What are OOP's Jargons and Complexities

2007-03-29 Thread Mirco Wahab
James Stroud wrote: there's a serious bug waiting here > This idiot is a troll. This idiot is a troll. ThThis idiot is a troll. > This idiot is a troll. is idiot is a troll. This idiot is a troll. This Remember, rockets went back to earth on such things (in pieces) ... > idiot is a troll. Thi

PyPy for dummies

2007-03-29 Thread Damjan
.. like me. Ok, this is what I understood why PyPy is important. Writing programing languages and implementations (compilers, interpreters, JITs, etc) is hard. Not many people can do it from scratch and create something comparable to what's available today. But we need people with new aproaches,

Re: What are OOP's Jargons and Complexities

2007-03-29 Thread James Stroud
This idiot is a troll. This idiot is a troll. ThThis idiot is a troll. This idiot is a troll. is idiot is a troll. This idiot is a troll. This idiot is a troll. This idiot is a troll. This idiot is a troll. This idiot is a troll. This idiot is a troll. This idiot is a troll. This idiot is a tro

Re: socket read timeout

2007-03-29 Thread Damjan
>> So set a long timeout when you want to write and short timeout when you >> want to read. >> > > Are sockets full duplex? > > I know Ethernet isn't. Both are full duplex. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Modal value of an array

2007-03-29 Thread Paddy
On Mar 29, 8:49 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > >... > > > That's not the only case though. What do you expect to be returned for > > an input of ["eggs", "beans", "beans", "eggs", "spam"] ? > > > Assuming you want *a* mode value, and any o

Re: What are OOP's Jargons and Complexities

2007-03-29 Thread Lew
Uri Guttman wrote: > please DO NOT EVER followup xah's posts into comp.lang.perl.misc. he is > not wanted there and is considered a troll. he hates perl so why he > crossposts there is a question. if you want to followup, post only in > your own group. keep him and his useless threads out of c.l.p.

Re: Any "consumer review generators" available?

2007-03-29 Thread Paul McGuire
On Mar 29, 3:40 pm, [EMAIL PROTECTED] wrote: > On Mar 29, 9:19 pm, [EMAIL PROTECTED] wrote: > > > I am looking for a fake consumer review generator that could generate > > realistic looking reviews for any products, kind of like on amazon.com but > > generated by Artificial Intelligence. Is there

Re: make RE more cleaver to avoid inappropriate : sre_constants.error: redefinition of group name

2007-03-29 Thread Paddy
On Mar 29, 3:22 pm, "aspineux" <[EMAIL PROTECTED]> wrote: > I want to parse > > '[EMAIL PROTECTED]' or '<[EMAIL PROTECTED]>' and get the email address [EMAIL > PROTECTED] > > the regex is > > r'<[EMAIL PROTECTED]>|[EMAIL PROTECTED]' > > now, I want to give it a name > > r'<(?P[EMAIL PROTECTED])>|(

Re: Any "consumer review generators" available?

2007-03-29 Thread Michael
Paul McGuire wrote: > On Mar 29, 1:19 pm, [EMAIL PROTECTED] wrote: >> I am looking for a fake consumer review generator that could generate >> realistic looking reviews for any products, kind of like on amazon.com >> but generated by Artificial Intelligence. Is there a package available in >> your

King Abdullah Saud, we are for the first time EXTREMELY PROUD of you. 911 INSIDE JOB has finaly WOKEN UP every one - "illegitimate foreign occupation"

2007-03-29 Thread stj911
U.S. Officials React to Saudi Condemnation Abdullah Says Iraq Under "Illigitimate Foreign Occupation" at Arab Summit By SANDRA HERNANDEZ Posted 1 hr. 33 min. ago Riyadh, SAUDI ARABIA: Saudi King Abdullah attends the Arab Summit, 28 March 2007 in Riyadh. Hassan Amar/AFP/Getty Riyadh, SAUDI ARABIA: S

Re: Question about details of __import__

2007-03-29 Thread Mitko Haralanov
On Thu, 29 Mar 2007 16:45:08 -0300 "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > If you think that Python got confused and has two duplicate modules, try > to find them in sys.modules. Perhaps under the names 'log' and 'xxx.log' > Or, using print, try to see *when* your global variable is res

Re: What are OOP's Jargons and Complexities

2007-03-29 Thread Uri Guttman
please DO NOT EVER followup xah's posts into comp.lang.perl.misc. he is not wanted there and is considered a troll. he hates perl so why he crossposts there is a question. if you want to followup, post only in your own group. keep him and his useless threads out of c.l.p.misc. uri -- Uri Guttma

smtplib startls() + quit()

2007-03-29 Thread Greg Donald
When using starttls(), calling quit() throws an exception: -> server.quit() (Pdb) n send: 'quit\r\n' sslerror: (8, 'EOF occurred in violation of protocol') For the moment I and catching it like so: try: # this throws an exception when using tls server.

"A British mother paraded on state TV. Forced to wear the hijab,"

2007-03-29 Thread lemnitzer
As if its worse than a mountain of naked people in the Abu Ghraib or Guantanamo style or with secret prisons according to the WASHINGTON CONVENTIONS and she suddenly transmogrified from a UK marine to a mother ... Brits are truly hilarious !!! http://www.wbir.com/news/national/story.aspx?stor

Re: What are OOP's Jargons and Complexities

2007-03-29 Thread Jon Harrop
Xah Lee wrote: > As part of this new syntax and purity, where everything in a program > is of Classes and Objects and Methods, many complex issues and concept > have arisen in OOP from both the OOP language machinery as well as a > engineering practice. I think the fact that many design patterns f

Re: Any "consumer review generators" available?

2007-03-29 Thread bearophileHUGS
> Python's standard module "ai" has a function called > "generateFakeReview". I believe it does what you want, but I haven't > used it myself. It's nice to have an ai module too in the standard library (A*, CSP, etc), Norvig may help with the Python version of his AIMA sofware ;-] Bye, bearophile

Re: SimpleXMLRPCServer and Threading

2007-03-29 Thread Jeff McNeil
I'd have to go dig into the library code again as I haven't been in there since I did this myself a few months ago, but I believe you're correct. If you inherit from ThreadingMixIn, it will create a new thread for each incoming request. I believe it's the same way the standard ThreadingTCPServer

Re: SimpleXMLRPCServer and Threading

2007-03-29 Thread Laszlo Nagy
Jeff McNeil wrote: > This is off of memory so I apologize if I don't get all of the details right. > > The base SimpleXMLRPCServer uses TCPServer as it's server component > and SimpleXMLXMLRPCRequestHandler as it's handler. The handler is a > subclass of BaseHTTPRequestHandler, which itself doesn't

Question about using cookielib in python 2.4

2007-03-29 Thread Marko . Cain . 23
Hi, I am following the example of Python cookbook (14.7) about using cookielib in python2.4 cj = cookielib.LWPCookieJar() // code to send out the request print "Coookie-" if cj is not None: for index, cookie in enumerate(cj):

Re: File deletion after 72 hours of creation

2007-03-29 Thread [EMAIL PROTECTED]
On Mar 29, 12:02 pm, [EMAIL PROTECTED] wrote: > Alex> I'm looking for a simple method to delete a folder after 72 > Alex> "Business hours" (saturday/sunday doesnt count) since its > Alex> creation. Note that This is on a linux system and I realize that > Alex> it will be the last mo

Re: Any "consumer review generators" available?

2007-03-29 Thread irstas
On Mar 29, 9:19 pm, [EMAIL PROTECTED] wrote: > I am looking for a fake consumer review generator that could generate > realistic looking reviews for any products, kind of like on amazon.com but > generated by Artificial Intelligence. Is there a package available in your > favorite programing lan

Re: Weird gcc behaviour with function pointer types

2007-03-29 Thread Roger Miller
On Mar 29, 3:05 am, greg <[EMAIL PROTECTED]> wrote: > In my quest to eliminate C compiler warnings from > Pyrex output, I've discovered some utterly bizarre > behaviour from gcc 3.3. > > The following code: > >void g(struct foo *x) { >} > >void f(void) { > void (*h)(struct foo *);

Re: How can I get the content of a web site using http library

2007-03-29 Thread irstas
On Mar 29, 10:49 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Thanks. Can you please tell me how can I do a Post form submission > using the urlLib2 library? I look at your link, but i cant find an > example there. > > Thank you. http://www.python.org/doc/current/lib/module-urllib2.html L

python problem: creating subprocess (it kills the parent process)

2007-03-29 Thread John Davis
Hi all, I am using Python 2.4. I am trying to run a C++ program on Red hat linux enterprise edition from Python by using various methods like > Os.system Os.popen Subprocess.popen Os.execvp Os.spawnl In all of these methods the program kills python program also. So, let's say i am in pytho

Re: Any "consumer review generators" available?

2007-03-29 Thread John Davis
Hi all, I am using Python 2.4. I am trying to run a C++ program on Red hat linux enterprise edition from Python by using various methods like > Os.system Os.popen Subprocess.popen Os.execvp Os.spawnl In all of these methods the program kills python program also. So, let's say i am in pytho

Re: How can I get the content of a web site using http library

2007-03-29 Thread kyosohma
On Mar 29, 3:07 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > * [EMAIL PROTECTED] (29 Mar 2007 12:18:19 -0700) > > > I am trying to get the content of a web site like this: > > But my question is how can I do a 'GET' request without putting the '/ > > index.html'' > > import urllib > print urllib

Web21C Python SDK - announce

2007-03-29 Thread Otu Ekanem
The BT Web21C python SDK is a package which abstract the SOAP/WsSecurity stack from end users allowing them to write python code to access BT plethora of webservices directly. You can use it to make phone calls, conference calls, send text messages (SMS) and locate people based on cell of origin

Re: How can I get the content of a web site using http library

2007-03-29 Thread Thorsten Kampe
* [EMAIL PROTECTED] (29 Mar 2007 12:18:19 -0700) > I am trying to get the content of a web site like this: > But my question is how can I do a 'GET' request without putting the '/ > index.html'' import urllib print urllib.urlopen('http://www.yahoo.com/').read() -- http://mail.python.org/mailman/l

Re: How can I get the content of a web site using http library

2007-03-29 Thread [EMAIL PROTECTED]
On Mar 29, 2:34 pm, [EMAIL PROTECTED] wrote: > On Mar 29, 2:18 pm, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > I am trying to get the content of a web site like this: > > But my question is how can I do a 'GET' request without putting the '/ > > index.html'' > > >h = httplib.HTTP

Re: Question about details of __import__

2007-03-29 Thread Gabriel Genellina
En Thu, 29 Mar 2007 15:56:54 -0300, Mitko Haralanov <[EMAIL PROTECTED]> escribió: >> You may check if this is the case, looking at sys.modules > > I did look at sys.modules but I wasn't sure what to look for. There was > a log module in the list but what else should I look for? If you think tha

Re: How can I get the content of a web site using http library

2007-03-29 Thread kyosohma
On Mar 29, 2:18 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I am trying to get the content of a web site like this: > But my question is how can I do a 'GET' request without putting the '/ > index.html'' > >h = httplib.HTTP('www.yahoo.com') > > # it takes 2 arguments here, but

Hellow World:)

2007-03-29 Thread void pointer
Hi All ..I am looking for PDF version of " Practical Python" and a language to stick to .Should I find that book ,I wil lconsder this Python :) Thanks - Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Tr

How can I get the content of a web site using http library

2007-03-29 Thread [EMAIL PROTECTED]
I am trying to get the content of a web site like this: But my question is how can I do a 'GET' request without putting the '/ index.html'' h = httplib.HTTP('www.yahoo.com') # it takes 2 arguments here, but I don't know if the site has '/index.html' , how can I leave this out?

Re: PyPy 1.0: JIT compilers for free and more

2007-03-29 Thread [EMAIL PROTECTED]
On Mar 28, 5:36 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Carl Friedrich Bolz napisa³(a): > > > Welcome to the PyPy 1.0 release - a milestone integrating the results > > of four years of research, engineering, management and sprinting > > efforts, concluding the 28 months phase of EU co-funding!

Re: Finding a module's sub modules at runtime

2007-03-29 Thread Joshua J. Kugler
On Thursday 29 March 2007 07:33, Alex Martelli wrote: > Joshua J. Kugler <[EMAIL PROTECTED]> wrote: > >> still be nicely portable. It just seems that since Python is gathering >> that information anyway, it should make it available without me having to >> walk the directory tree. > > Sorry, whe

Re: Any "consumer review generators" available?

2007-03-29 Thread Uri Guttman
> "a" == aralsky <[EMAIL PROTECTED]> writes: a> I am looking for a fake consumer review generator that could a> generate realistic looking reviews for any products, kind of like a> on amazon.com but generated by Artificial Intelligence. Is there a a> package available in your favorite

Re: Any "consumer review generators" available?

2007-03-29 Thread Peter Otten
Paul McGuire wrote: > On Mar 29, 1:19 pm, [EMAIL PROTECTED] wrote: >> I am looking for a fake consumer review generator that could generate >> realistic looking reviews for any products, kind of like on amazon.com >> but generated by Artificial Intelligence. Is there a package available in >> your

Re: Question about details of __import__

2007-03-29 Thread Mitko Haralanov
On Thu, 29 Mar 2007 15:43:46 -0300 "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Surely there is a ./resources/__init__.py too? There sure is: ./resources/__init__.py is: __all__ = ['simple', 'other'] > You may check if this is the case, looking at sys.modules I did look at sys.modules but I

Re: Question about details of __import__

2007-03-29 Thread Gabriel Genellina
En Thu, 29 Mar 2007 14:42:33 -0300, Mitko Haralanov <[EMAIL PROTECTED]> escribió: > I have three modules that a comprising the problem: > ./core.py > ./log.py > ./resources/simple/__init__.py Surely there is a ./resources/__init__.py too? > The problem that I am seeing is that 'global_info' in

Re: with timeout(...):

2007-03-29 Thread John Nagle
Diez B. Roggisch wrote: > Nick Craig-Wood wrote: > > >>Did anyone write a contextmanager implementing a timeout for >>python2.5? >> >>And have it work reliably and in a cross platform way! > > Cross platform isn't the issue here - reliability though is. To put it > simple: can't be done that way

Re: Any "consumer review generators" available?

2007-03-29 Thread Paul McGuire
On Mar 29, 1:19 pm, [EMAIL PROTECTED] wrote: > I am looking for a fake consumer review generator that could generate > realistic looking reviews for any products, kind of like on amazon.com but > generated by Artificial Intelligence. Is there a package available in your > favorite programing lan

Any "consumer review generators" available?

2007-03-29 Thread aralsky
I am looking for a fake consumer review generator that could generate realistic looking reviews for any products, kind of like on amazon.com but generated by Artificial Intelligence. Is there a package available in your favorite programing language... thx alan -- http://mail.python.org/mailman/

Re: encoding confusions

2007-03-29 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Tim Arnold wrote: > I have the contents of a file that contains French documentation. > I've iterated over it and now I want to write it out to a file. > > I'm running into problems and I don't understand why--I don't get how the > encoding works. > My first attempt was j

Re: Best way to wait for string input

2007-03-29 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, kevinliu23 wrote: > Python newbie here for some expert help. So basically I want to design > a menu system that waits for a string input. I'm not sure what the > best way of going about this is. The current system waits for a single > character input using msvcrt.kbhit( ) a

Re: which methods to use?

2007-03-29 Thread Gabriel Genellina
En Thu, 29 Mar 2007 01:56:15 -0300, Steven D'Aprano <[EMAIL PROTECTED]> escribió: > By the way, "id(obj) == id(another_object)" is just a long way of writing > "obj is another_object". Just as a side note: that's not true, testing by id() only works if both objects are alive at the same time.

Question about details of __import__

2007-03-29 Thread Mitko Haralanov
Hi all, I am going to do my best to describe the issue that I am having and hopefully someone can shed some light on it: I have three modules that a comprising the problem: ./core.py ./log.py ./resources/simple/__init__.py core.py looks something like this (simplified version): import log class

Best way to wait for string input

2007-03-29 Thread kevinliu23
Hi guys, Python newbie here for some expert help. So basically I want to design a menu system that waits for a string input. I'm not sure what the best way of going about this is. The current system waits for a single character input using msvcrt.kbhit( ) and msvcrt.getch( ). Is there something eq

encoding confusions

2007-03-29 Thread Tim Arnold
I have the contents of a file that contains French documentation. I've iterated over it and now I want to write it out to a file. I'm running into problems and I don't understand why--I don't get how the encoding works. My first attempt was just this: < snipped code for classes, etc; fname is str

Re: with timeout(...):

2007-03-29 Thread Jean-Paul Calderone
On Thu, 29 Mar 2007 11:30:04 -0500, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: >Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> > >> > I beleive the convention is when calling an OS function which might >> > block the global interpreter lock is dropped, thus allowing other >> > python bytecode to ru

Re: PyPy 1.0: JIT compilers for free and more

2007-03-29 Thread Carl Friedrich Bolz
Duncan Booth wrote: > Robin Becker <[EMAIL PROTECTED]> wrote: > >> I am hugely encouraged by this >> >> C:\Python\devel\pypy-1.0.0>\python24\python \python\lib\test > \pystone.py >> Pystone(1.1) time for 5 passes = 1.49586 >> This machine benchmarks at 33425.6 pystones/second >> >> C:\Python\d

Re: What is the timeout value of HTTP

2007-03-29 Thread Facundo Batista
ken wrote: > i.e. how long python will wait for a response in the below code? > >h = httplib.HTTP(self.url, 8080) > h.putrequest('GET', '/sample/?url=' + self.url) > h.endheaders() For ever. In Py<=2.5, httplib.HTTP doesn't have a timeout, so you have to do something like:

Re: BeautifulSoup vs. Microsoft

2007-03-29 Thread John Nagle
Duncan Booth wrote: > John Nagle <[EMAIL PROTECTED]> wrote: > > >>Strictly speaking, it's Microsoft's fault. >> >> title="". So all that following stuff is from what >>follows the next "-->" which terminates a comment. > > > It is an attribute value, and unescaped angle brackets are valid

Re: dynamic module does not define init function (initpsycopgmodule)

2007-03-29 Thread Gabriel Genellina
En Wed, 28 Mar 2007 17:16:43 -0300, kickslop <[EMAIL PROTECTED]> escribió: > Clearly I am doing something braindead here with psycopg 1.1.21 > (psycopg2 is not an option). > > Any ideas? I get the same results when I build it with Red Hat's GCC > 3.4.6 setup as well as our in-house GCC 3.3.5 setu

Re: how can I clear a dictionary in python

2007-03-29 Thread Larry Bates
Bruno Desthuilliers wrote: > Larry Bates a écrit : >> Aahz wrote: >>> In article <[EMAIL PROTECTED]>, >>> Larry Bates <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: > I create a dictionary like this > myDict = {} > > and I add entry like this: > myDict['a'] = 1 >

Re: with timeout(...):

2007-03-29 Thread Nick Craig-Wood
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > > > I beleive the convention is when calling an OS function which might > > block the global interpreter lock is dropped, thus allowing other > > python bytecode to run. > > > So what? That doesn't help you, as you are single-threaded here. The >

Re: PyPy 1.0: JIT compilers for free and more

2007-03-29 Thread Bart Ogryczak
On 28 mar, 23:36, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Carl Friedrich Bolz napisa³(a): > > > Welcome to the PyPy 1.0 release - a milestone integrating the results > > of four years of research, engineering, management and sprinting > > efforts, concluding the 28 months phase of EU co-funding! >

Re: Finding User Profile path

2007-03-29 Thread kyosohma
On Mar 29, 10:30 am, Tim Golden <[EMAIL PROTECTED]> wrote: > [resending as the original seems to have got lost; > apologies if it appears as a duplicate] > > At the risk of insulting your intelligence, here's a > rough-and-ready non-AD solution (culled from some code I > had somewhere): > > > impo

Re: File deletion after 72 hours of creation

2007-03-29 Thread skip
Alex> I'm looking for a simple method to delete a folder after 72 Alex> "Business hours" (saturday/sunday doesnt count) since its Alex> creation. Note that This is on a linux system and I realize that Alex> it will be the last modified time. These files wont be modified Alex> s

Re: pattern search

2007-03-29 Thread Fabian Braennstroem
Hi Paul, Paul McGuire schrieb am 03/27/2007 07:19 PM: > On Mar 27, 3:13 pm, Fabian Braennstroem <[EMAIL PROTECTED]> wrote: >> Hi to all, >> >> Wojciech Mu?a schrieb am 03/27/2007 03:34 PM: >> >>> Fabian Braennstroem wrote: Now, I would like to improve it by searching for different 'real'

Re: make RE more cleaver to avoid inappropriate : sre_constants.error: redefinition of group name

2007-03-29 Thread aspineux
On 29 mar, 16:22, "aspineux" <[EMAIL PROTECTED]> wrote: > I want to parse > > '[EMAIL PROTECTED]' or '<[EMAIL PROTECTED]>' and get the email address [EMAIL > PROTECTED] > > the regex is > > r'<[EMAIL PROTECTED]>|[EMAIL PROTECTED]' > > now, if I want to give it a name > > r'<(?P[EMAIL PROTECTED])>|

Re: Weird gcc behaviour with function pointer types

2007-03-29 Thread attn . steven . kuo
On Mar 29, 6:05 am, greg <[EMAIL PROTECTED]> wrote: > In my quest to eliminate C compiler warnings from > Pyrex output, I've discovered some utterly bizarre > behaviour from gcc 3.3. > > The following code: > >void g(struct foo *x) { >} > >void f(void) { > void (*h)(struct foo *);

File deletion after 72 hours of creation

2007-03-29 Thread [EMAIL PROTECTED]
I'm looking for a simple method to delete a folder after 72 "Business hours" (saturday/sunday doesnt count) since its creation. Note that This is on a linux system and I realize that it will be the last modified time. These files wont be modified since their creation. Im very confused on how to wo

Re: manually implementing staticmethod()?

2007-03-29 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: > Hi, > > Can someone show me how to manually implement staticmethod()? Here is Simplest way: class smethod(object): def __init__(self, f): self.f=f def __call__(self, *a, **k): return self.f(*a, **k) Alex -- http://mail.python.org/mailman/listinfo/pytho

Re: A nice way to use regex for complicate parsing

2007-03-29 Thread Paul McGuire
On Mar 29, 9:42 am, Shane Geiger <[EMAIL PROTECTED]> wrote: > It would be worth learning pyparsing to do this. > Thanks to Shane and Steven for the ref to pyparsing. I also was struck by this post, thinking "this is pyparsing written in re's and dicts". The approach you are taking is *very* much

Re: Finding a module's sub modules at runtime

2007-03-29 Thread Alex Martelli
Joshua J. Kugler <[EMAIL PROTECTED]> wrote: > still be nicely portable. It just seems that since Python is gathering > that information anyway, it should make it available without me having to > walk the directory tree. Sorry, where is Python "gathering that information anyway"? Unless I'm mist

Re: What is the timeout value of HTTP

2007-03-29 Thread Alex Martelli
ken <[EMAIL PROTECTED]> wrote: > Can you please tell me what is the timeout value of httplib.HTTP? > > i.e. how long python will wait for a response in the below code? > >h = httplib.HTTP(self.url, 8080) > h.putrequest('GET', '/sample/?url=' + self.url) > h.endheaders() HTTP

Re: Finding User Profile path

2007-03-29 Thread Tim Golden
[resending as the original seems to have got lost; apologies if it appears as a duplicate] At the risk of insulting your intelligence, here's a rough-and-ready non-AD solution (culled from some code I had somewhere): import win32net import win32netcon dc = win32net.NetGetAnyDCName (None, None)

Re: Creating a new data structure while filtering its data origin.

2007-03-29 Thread attn . steven . kuo
On Mar 28, 1:44 pm, <[EMAIL PROTECTED]> wrote: > Hi everyone. > > I'm trying to work with very simple data structures but I'm stuck in the very > first steps. If someone has the luxury of a few minutes and can give an > advice how to resolve this, I'll really appreciate it. > > 1- I have a list o

What is the timeout value of HTTP

2007-03-29 Thread ken
Can you please tell me what is the timeout value of httplib.HTTP? i.e. how long python will wait for a response in the below code? h = httplib.HTTP(self.url, 8080) h.putrequest('GET', '/sample/?url=' + self.url) h.endheaders() Thank you. -- http://mail.python.org/mailman/lis

Re: make RE more cleaver to avoid inappropriate : sre_constants.error: redefinition of group name

2007-03-29 Thread attn . steven . kuo
On Mar 29, 7:22 am, "aspineux" <[EMAIL PROTECTED]> wrote: > I want to parse > > '[EMAIL PROTECTED]' or '<[EMAIL PROTECTED]>' and get the email address [EMAIL > PROTECTED] > > the regex is > > r'<[EMAIL PROTECTED]>|[EMAIL PROTECTED]' > > now, I want to give it a name > > r'<(?P[EMAIL PROTECTED])>|(

inf class (was: gmpy floating point exception)

2007-03-29 Thread Martin Manns
On Thu, 29 Mar 2007 00:57:03 -0700 [EMAIL PROTECTED] (Alex Martelli) wrote: > Martin Manns <[EMAIL PROTECTED]> wrote: > > 2) Is there any inf type around with > > a + inf == inf > > inf > a (as long as a != inf) > > etc. > > that works with any other type? > > You mean something like: > > class

What are OOP's Jargons and Complexities

2007-03-29 Thread Xah Lee
What are OOP's Jargons and Complexities Xah Lee, 20050128 Classes, Methods, Objects In computer languages, often a function definition looks like this: subroutine f (x1, x2, ...) { variables ... do this or that } In advanced languages such as LISP family, it is not uncommon to define funct

Re: XML/encoding/prolog/python hell...

2007-03-29 Thread fscked
Here is what I currently have. Still missing prolog information and namespace info. Encoding is irritating me also. :) import os,sys import csv from elementtree.ElementTree import Element, SubElement, ElementTree, tostring def indent(elem, level=0): i = "\n" + level*" " if len(elem):

Re: Why doesnt __getattr__ with decorator dont call __get_method in decorator

2007-03-29 Thread glomde
> To get python to run the __get__ method I think you have to call > __getattr__ explicitly: > a.__getattr__('test') > > If you do: > a.test > python follows a different routine: it checks for the existence of the > attribute, then check if there is a __getattr__ attribute. Now the > speculative b

Re: A nice way to use regex for complicate parsing

2007-03-29 Thread Shane Geiger
It would be worth learning pyparsing to do this. aspineux wrote: My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests=[ 'MAIL FROM:<[EMAIL PROTECTED]>', 'MA

Re: how can I clear a dictionary in python

2007-03-29 Thread Bruno Desthuilliers
Larry Bates a écrit : > Aahz wrote: >> In article <[EMAIL PROTECTED]>, >> Larry Bates <[EMAIL PROTECTED]> wrote: >>> [EMAIL PROTECTED] wrote: I create a dictionary like this myDict = {} and I add entry like this: myDict['a'] = 1 but how can I empty the whole dictionar

Islam, the Religion of Ease

2007-03-29 Thread moslim
Excuse me!! Would you stop for a moment?! O...man...Haven't you thought-one day- about yourself ? Who has made it? Have you seen a design which hasn't a designer ?! Have you seen a wonderful,delicate work without a worker ?! It's you and the whole universe!.. Who has made them all ?!! You know who

A nice way to use regex for complicate parsing

2007-03-29 Thread aspineux
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests=[ 'MAIL FROM:<[EMAIL PROTECTED]>', 'MAIL FROM:[EMAIL PROTECTED]', 'MAIL FROM:<[EMAIL PROTECTED]> SI

Re: Creating a new data structure while filtering its data origin.

2007-03-29 Thread FlipFish2007
On Mar 28, 4:44 pm, <[EMAIL PROTECTED]> wrote: > Hi everyone. > > I'm trying to work with very simple data structures but I'm stuck in the very > first steps. If someone has the luxury of a few minutes and can give an > advice how to resolve this, I'll really appreciate it. > > 1- I have a list o

make RE more cleaver to avoid inappropriate : sre_constants.error: redefinition of group name

2007-03-29 Thread aspineux
I want to parse '[EMAIL PROTECTED]' or '<[EMAIL PROTECTED]>' and get the email address [EMAIL PROTECTED] the regex is r'<[EMAIL PROTECTED]>|[EMAIL PROTECTED]' now, I want to give it a name r'<(?P[EMAIL PROTECTED])>|(?P[EMAIL PROTECTED])' sre_constants.error: redefinition of group name 'emai

Re: Finding User Profile path

2007-03-29 Thread kyosohma
On Mar 29, 9:05 am, Tim Golden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Mar 29, 8:23 am, Tim Golden <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] wrote: > >>> One of my co-workers thought I could do > >>> something like this: > >>> c = wmi.WMI() > >>> for i in c.Win32_UserAc

  1   2   >