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

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: 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

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: 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: 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

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: 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

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: 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: 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

"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

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.

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

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

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: 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

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 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: 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: 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: 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: 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

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 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

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: 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: 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: 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: 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: 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: 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

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: 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

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: 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: 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: 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).

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

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

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

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

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

<    1   2