Re: Porn Addiction Solutions?

2008-10-08 Thread Aaron "Castironpi" Brady
On Oct 8, 2:07 pm, [EMAIL PROTECTED] wrote: > Help, I'm addicted to porn. I've been spending a lot of time > downloading hardcore porn and masturbating to it. It's ruining my > life. I just found out that one of these sites somehow hacked my card > and rang up $5K in charges which they won't even r

Re: Porn Addiction Solutions?

2008-10-08 Thread Hackamore
[EMAIL PROTECTED] wrote: Help, I'm addicted to porn. I've been spending a lot of time downloading hardcore porn and masturbating to it. It's ruining my life. I just found out that one of these sites somehow hacked my card and rang up $5K in charges which they won't even refund me. Even with that

Re: re : do something in time interval

2008-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Hendrik van Rooyen wrote: > import time > while True: > end_time = time.time() + 5 > while time.time() < end_time: > do_the_in_between_stuff() > do_the_every_five_second_stuff() Maybe I'm dense, but ... where do you stop

Re: Safe eval of insecure strings containing Python data structures?

2008-10-08 Thread James Mills
On Thu, Oct 9, 2008 at 2:26 PM, Warren DeLano <[EMAIL PROTECTED]> wrote: > JSON rocks! Thanks everyone. Yes it does :) > Ben wrote: > >>More generally, you should never execute (via eval, exec, or whatever) >>*any* instruction from an untrusted path; especially not arbitrary >>data from an input

RE: Safe eval of insecure strings containing Python data structures?

2008-10-08 Thread Warren DeLano
JSON rocks! Thanks everyone. Ben wrote: >More generally, you should never execute (via eval, exec, or whatever) >*any* instruction from an untrusted path; especially not arbitrary >data from an input stream. Wow, for the record, I completely disagree with this point of view: Today's web apps

Re: how to get the thighest bit position in big integers?

2008-10-08 Thread Aaron "Castironpi" Brady
On Oct 8, 7:21 pm, greg <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: > > str.find is an historical anomaly that should not be copied.  It > > was(is?) a wrapper for C's string find function.  C routinely uses -1 to > > mean None for functions statically typed to return ints.  The Python > > vers

Re: Porn Addiction Solutions?

2008-10-08 Thread suntzu
[EMAIL PROTECTED] wrote: Help, I'm addicted to porn. I've been spending a lot of time downloading hardcore porn and masturbating to it. It's ruining my life. I just found out that one of these sites somehow hacked my card and rang up $5K in charges which they won't even refund me. Even with that

Re: how to get the thighest bit position in big integers?

2008-10-08 Thread Terry Reedy
greg wrote: Terry Reedy wrote: str.find is an historical anomaly that should not be copied. It was(is?) a wrapper for C's string find function. C routinely uses -1 to mean None for functions statically typed to return ints. The Python version logically should return None and usually does f

Re: Safe eval of insecure strings containing Python data structures?

2008-10-08 Thread Aaron "Castironpi" Brady
On Oct 8, 7:34 pm, "Warren DeLano" <[EMAIL PROTECTED]> wrote: > I would like to parse arbitrary insecure text string containing nested > Python data structures in eval-compatible form:   > ... > # But I know for certain that the above approach is NOT secure since > object attributes can still be ac

Re: Porn Addiction Solutions?

2008-10-08 Thread mattmatical
On Wed, 8 Oct 2008 12:30:09 -0700 (PDT), [EMAIL PROTECTED] wrote: >You can conquer this thing. Let us know how you make out. > >Regards, > >Mike Now I finally know why this thing is called usenet. Most useful post ever. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: MRO inconsistency: why?

2008-10-08 Thread Michele Simionato
On Oct 8, 9:09 pm, Ravi <[EMAIL PROTECTED]> wrote: > Why the following code gives inconsistent method resolution order > error: > If you want to know all the nitty-gritty details about the MRO (including the reason for the error you get) you should read this: http://www.python.org/download/releas

inspect feature

2008-10-08 Thread Aaron "Castironpi" Brady
Hello, The 'inspect' module has this method: inspect.getargvalues(frame) It takes a frame and returns the parameters used to call it, including the locals as defined in the frame, as shown. >>> def f( a, b, d= None, *c, **e ): ... import inspect ... return inspect.getargvalues( inspect.

inspect bug

2008-10-08 Thread Aaron "Castironpi" Brady
Hi all, Found this bug. It's in 2.6, too bad. Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import inspect >>> type( inspect.getargvalues( inspect.currentframe() ) ) Docs say: insp

Re: A question about funcation parameter and self defined object

2008-10-08 Thread Terry Reedy
Wei Guo wrote: Hi Chris, Thanks a lot for reply, you are right. I want to use this method as a static method as: translation = staticmethod( translation ) static methods are mostly useless in Python. Just put the definition of translation outside of any class. -- http://mail.python.org

Re: Array of dict or lists or ....?

2008-10-08 Thread Scott David Daniels
Pat wrote: I can't figure out how to set up a Python data structure to read in data that looks something like this (albeit somewhat simplified and contrived): States Counties Schools Classes Max Allowed Students Current enrolled Students Nebraska, Wabash, New

Re: SMTPlib inside function, extra tab

2008-10-08 Thread Hunter
Thank you Tino. I appreciate the help. Duh! Anything inside """ """ is preformatted text. I have tabs inside my preformatted text (without even thinking because it looks more normal because of the indent). I removed them and voila! def send_mail(fromaddress,tolist,msgsubj,messagebody):

Re: python for *nix system admins

2008-10-08 Thread Erik Southworth
On Sat, Sep 27, 2008 at 4:05 AM, Lars Stavholm <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm new to this list and hoping that this is not off-topic. > If it is, please point me in the right direction. > > I seem to recollect a python module or library for *nix sysadmins, > but I can't for the life o

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Gabriel Genellina
En Wed, 08 Oct 2008 15:24:39 -0300, Samuel A. Falvo II <[EMAIL PROTECTED]> escribió: On Oct 7, 6:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: you set stdin=PIPE - is your java process expecting some input? you're not writing anything to stdin. It does not expect input from stdin.

wxPython binaries for Python 2.6

2008-10-08 Thread Robin Dunn
Hi All, A set of wxPython binaries for Python 2.6 on Win32, Win64 and Mac OS X are now available at http://wxpython.org/download.php What is wxPython? - wxPython is a GUI toolkit for the Python programming language. It allows Python programmers to create programs with a robus

Re: Safe eval of insecure strings containing Python data structures?

2008-10-08 Thread Ben Finney
"Warren DeLano" <[EMAIL PROTECTED]> writes: > I would like to parse arbitrary insecure text string containing > nested Python data structures in eval-compatible form: It sounds like you want the ‘json’ library, new in Python 2.6 http://www.python.org/doc/current/library/json>. It's intended for s

Re: A question about funcation parameter and self defined object

2008-10-08 Thread Wei Guo
Hi Chris, Thanks a lot for reply, you are right. I want to use this method as a static method as: translation = staticmethod( translation ) I think that here the built in function pass None. So we can not pass any self defined object for static method? Best regards, Wei On Wed, Oct 8, 2008 at

Re: Safe eval of insecure strings containing Python data structures?

2008-10-08 Thread George Sakkis
On Oct 8, 8:34 pm, "Warren DeLano" <[EMAIL PROTECTED]> wrote: > I would like to parse arbitrary insecure text string containing nested > Python data structures in eval-compatible form:   > > # For example, given a "config.txt" such as: > > { >   'my_atom' : 1.20, >   'my_dict' : { 2:50 , 'hi':'mom

Re: Porn Addiction Solutions?

2008-10-08 Thread George Sakkis
On Oct 8, 3:07 pm, [EMAIL PROTECTED] wrote: > Help, I'm addicted to porn. I've been spending a lot of time > downloading hardcore porn and masturbating to it. It's ruining my > life. I just found out that one of these sites somehow hacked my card > and rang up $5K in charges which they won't even r

google urls - Free

2008-10-08 Thread kirbytailorml
http://news.meta.ua/redirect.php?url=vids247.cn/zoo-tube-247-com http://news.meta.ua/redirect.php?url=vids247.cn/zootube247-com http://news.meta.ua/redirect.php?url=vids247.cn/www-zootube247 http://news.meta.ua/redirect.php?url=vids247.cn/zooskool http://news.meta.ua/redirect.php?url=vids247.cn/ani

google urls - Free

2008-10-08 Thread wbdismalgoldstein
http://news.meta.ua/redirect.php?url=vids247.cn/zoo tube 365 com http://news.meta.ua/redirect.php?url=vids247.cn/zootube365 com http://news.meta.ua/redirect.php?url=vids247.cn/www zootube365 http://news.meta.ua/redirect.php?url=vids247.cn/zooskool http://news.meta.ua/redirect.php?url=vids247.cn/ani

xtube - Free

2008-10-08 Thread wbdismalgoldstein
xtube . . . ***CLICK HERE http://vids247.cn/xtube * . . . . . . . . . . . . xtube -- http://mail.python.org/mailman/listinfo/python-list

Google Advanced Urls - Free

2008-10-08 Thread wbdismalgoldstein
Hello -- http://mail.python.org/mailman/listinfo/python-list

Re: Safe eval of insecure strings containing Python data structures?

2008-10-08 Thread Chris Rebert
On Wed, Oct 8, 2008 at 5:34 PM, Warren DeLano <[EMAIL PROTECTED]> wrote: > > I would like to parse arbitrary insecure text string containing nested > Python data structures in eval-compatible form: > > # For example, given a "config.txt" such as: > > { > 'my_atom' : 1.20, > 'my_dict' : { 2:50 , '

Re: A question about funcation parameter and self defined object

2008-10-08 Thread Chris Rebert
On Wed, Oct 8, 2008 at 4:36 PM, Wei Guo <[EMAIL PROTECTED]> wrote: > Hi, > > I defined a class called vec3 which contains x, y, z and in another > function, I tried to call a function which takes a vec3 as a parameter, but > it seems that parameter is passed as a generic object and I can not access

Safe eval of insecure strings containing Python data structures?

2008-10-08 Thread Warren DeLano
I would like to parse arbitrary insecure text string containing nested Python data structures in eval-compatible form: # For example, given a "config.txt" such as: { 'my_atom' : 1.20, 'my_dict' : { 2:50 , 'hi':'mom'}, 'my_list' : [ (1,2,3), [4.5,6.9], 'foo', 0 ] } # I would like to do

Re: how to get the thighest bit position in big integers?

2008-10-08 Thread greg
Terry Reedy wrote: str.find is an historical anomaly that should not be copied. It was(is?) a wrapper for C's string find function. C routinely uses -1 to mean None for functions statically typed to return ints. The Python version logically should return None and usually does for other func

Re: distributing apps without the Python source?

2008-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Joe Strout wrote: > We have a client who's paranoid about distributing the Python source > to his commercial app. "Commercial" is not synonymous with "closed source". If he wanted to keep the source closed, Python was a poor choice. You could redo it in C or C++, a

Re: If an OS was to be written in Python, how'w it look?

2008-10-08 Thread Greg Ewing
James Mills wrote: I've just checked out the darcs repository and converted it to Mercurial. I'm going to have a bit of a play wiht it... Anyone interested in this ? I'll be interested to hear of any developments. -- http://mail.python.org/mailman/listinfo/python-list

Re: split a list based on a predicate

2008-10-08 Thread bearophileHUGS
Rajanikanth Jammalamadaka: > Is there a functional way to do this? > I have an array [0,1,2,3,0,1,2,2,3] and I want the first chunk of > non-decreasing values from this array (eg: In this case I want > [0,1,2,3]) In Python sometimes the best way to write the code isn't functional, this is readable

Re: split a list based on a predicate

2008-10-08 Thread Tim Chase
Is there a functional way to do this? I have an array [0,1,2,3,0,1,2,2,3] and I want the first chunk of non-decreasing values from this array (eg: In this case I want [0,1,2,3]) Sounds like a use for a generator wrapper: def monotonic(iterator): i = iter(iterator) prev = i.next()

A question about funcation parameter and self defined object

2008-10-08 Thread Wei Guo
Hi, I defined a class called vec3 which contains x, y, z and in another function, I tried to call a function which takes a vec3 as a parameter, but it seems that parameter is passed as a generic object and I can not access x , y, z in my vec3. Could anyone help me with that? class vec3: def

split a list based on a predicate

2008-10-08 Thread Rajanikanth Jammalamadaka
Hi! Is there a functional way to do this? I have an array [0,1,2,3,0,1,2,2,3] and I want the first chunk of non-decreasing values from this array (eg: In this case I want [0,1,2,3]) Thanks, Rajanikanth -- http://mail.python.org/mailman/listinfo/python-list

Re: ssh problem using paramiko?

2008-10-08 Thread Steve Holden
Diez B. Roggisch wrote: > sa6113 wrote: > >> I couldn't find any good source for download Openssh on the net? >> Would you please introduce a URL for download that? > > http://www.vapor.com/amtelnet/ > > it supports only SSHv1, but I guess that's ok. > No, you really don't want to use SSHv1. Am

Re: utf-8 read/write file

2008-10-08 Thread Kent Johnson
On Oct 8, 5:55 pm, gigs <[EMAIL PROTECTED]> wrote: > Benjamin wrote: > > On Oct 8, 12:49 pm, Bruno <[EMAIL PROTECTED]> wrote: > >> Hi! > > >> I have big .txt file which i want to read, process and write to another > >> .txt file. > >> I have done script for that, but im having problem with croatia

Re: ssh problem using paramiko?

2008-10-08 Thread Steve Holden
sa6113 wrote: > I couldn't find any good source for download Openssh on the net? > Would you please introduce a URL for download that? > http://www.openssh.org/ would be my first port of call. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC htt

Re: utf-8 read/write file

2008-10-08 Thread Aleksandar Radulovic
Hi, What is the encoding of the file1 you're reading from? I just ran tests on my machine (OS X) with both python2.5 and 2.6 and was able to read from a file containing: "život je lep" The file is UTF-8 encoded. >>> data = open("test.txt").read() >>> data '\xc5\xbeivot je lep.' >>> f = open("tes

Re: distributing apps without the Python source?

2008-10-08 Thread Paul Boddie
On 8 Okt, 23:50, "James Mills" <[EMAIL PROTECTED]> wrote: > > I must point out though that if your client > is paranoid for intellectual property reasons > (ie: protecting his assets), then you should > be aware that even if you can decompile > a Python compiled module (or a compiled > java class),

Re: utf-8 read/write file

2008-10-08 Thread gigs
Benjamin wrote: On Oct 8, 12:49 pm, Bruno <[EMAIL PROTECTED]> wrote: Hi! I have big .txt file which i want to read, process and write to another .txt file. I have done script for that, but im having problem with croatian characters (Š,Đ,Ž,Č,Ć). Can you show us what you have so far? How can

Re: Python syntax question

2008-10-08 Thread Diez B. Roggisch
Blubaugh, David A. schrieb: Sir, I was just wondering that the module that you are utilizing (Rpyc) is a remote process call module for python? Is this what you are developing with at this time? Are you internetically challenged? http://www.google.de/search?q=rpyc&ie=utf-8&oe=utf-8&aq=t&rls

Re: distributing apps without the Python source?

2008-10-08 Thread James Mills
On Thu, Oct 9, 2008 at 4:19 AM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Marc 'BlackJack' Rintsch a écrit : >> >> On Wed, 08 Oct 2008 10:59:44 -0500, skip wrote: >>> Though of course there is decompyle to consider, assuming Joe's client >>> is truly paranoid. >> >> Simply don't tell the cli

Re: distributing apps without the Python source?

2008-10-08 Thread Almar Klein
You could encrypt the sensitive pieces of source code. I'm not an expert in that field, but I know Matlab allows encryption of source code files. Almar 2008/10/8 Bruno Desthuilliers <[EMAIL PROTECTED]> > Marc 'BlackJack' Rintsch a écrit : > >> On Wed, 08 Oct 2008 10:59:44 -0500, skip wrote: >> >

Re: Quality control in open source development

2008-10-08 Thread Martin v. Löwis
Matimus wrote: > Others have made some pretty > sound arguments around trademarks and such, but I'm going to simply > argue that Python as a community has its own inertia, and it simply > isn't a practical to be concerned about a dubious fork. It simply > wouldn't take off. I think this is indeed

Re: utf-8 read/write file

2008-10-08 Thread Benjamin
On Oct 8, 12:49 pm, Bruno <[EMAIL PROTECTED]> wrote: > Hi! > > I have big .txt file which i want to read, process and write to another .txt > file. > I have done script for that, but im having problem with croatian characters > (Š,Đ,Ž,Č,Ć). Can you show us what you have so far? > How can I read/

Re: Python pre-release announcements

2008-10-08 Thread Benjamin
On Oct 8, 12:42 am, Ben Finney <[EMAIL PROTECTED]> wrote: > "Martin v. Löwis" <[EMAIL PROTECTED]> writes: > > > > Is there some policy document or release management guide that could > > > be updated for release teams to follow on this without needing to have > > > this discussion every time? > > >

Re: Inefficient summing

2008-10-08 Thread bearophileHUGS
beginner: > I can of course use an old-fashioned loop. This is more readable, but > also more verbose. > What is the best way, I wonder? In such situation the old loop seems the best solution. Short code is good only when it doesn't make the code too much slow/difficult to understand. Keeping the

Re: Porn Addiction Solutions?

2008-10-08 Thread Dotan Cohen
2008/10/8 <[EMAIL PROTECTED]>: >> > I got a solution, cutt it off, and then Kill yourself. >> > >> >> Cut what off? The OP is female. > > Are you sure about that? :) > On the internet, nobody knows you're a dog. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י

Re: Porn Addiction Solutions?

2008-10-08 Thread [EMAIL PROTECTED]
On Oct 8, 12:07 pm, [EMAIL PROTECTED] wrote: > Help, I'm addicted to porn. I've been spending a lot of time > downloading hardcore porn and masturbating to it. It's ruining my > life. I just found out that one of these sites somehow hacked my card > and rang up $5K in charges which they won't even

Re: Inefficient summing

2008-10-08 Thread Chris Rebert
I personally would probably do: from collections import defaultdict label2sum = defaultdict(lambda: 0) for r in rec: for key, value in r.iteritems(): label2sum[key] += value ratio = label2sum["F1"] / label2sum["F2"] This iterates through each 'r' only once, and (imho) is pretty read

Re: Inefficient summing

2008-10-08 Thread Bruno Desthuilliers
beginner a écrit : Hi All, I have a list of records like below: rec=[{"F1":1, "F2":2}, {"F1":3, "F2":4} ] Now I want to write code to find out the ratio of the sums of the two fields. One thing I can do is: sum(r["F1"] for r in rec)/sum(r["F2"] for r in rec) But this is slow because I have

RE: Porn Addiction Solutions?

2008-10-08 Thread Michael . Coll-Barth
> From: Dotan Cohen > > 2008/10/8 Support Desk <[EMAIL PROTECTED]>: > > I got a solution, cutt it off, and then Kill yourself. > > > > Cut what off? The OP is female. Are you sure about that? :) The information contained in this message and any attachment may be proprietary, c

RE: Porn Addiction Solutions?

2008-10-08 Thread Support Desk
Oh in that case she can email me, I got lots of porn. -Original Message- From: Dotan Cohen [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 3:15 PM To: Support Desk Cc: [EMAIL PROTECTED]; python-list@python.org Subject: Re: Porn Addiction Solutions? 2008/10/8 Support Desk <[EM

Inefficient summing

2008-10-08 Thread beginner
Hi All, I have a list of records like below: rec=[{"F1":1, "F2":2}, {"F1":3, "F2":4} ] Now I want to write code to find out the ratio of the sums of the two fields. One thing I can do is: sum(r["F1"] for r in rec)/sum(r["F2"] for r in rec) But this is slow because I have to iterate through th

Re: Compiler, ast and forwards/backwards compatibility

2008-10-08 Thread Martin v. Löwis
> My confusion starts with the fact that I'm not sure if all Python 2.4 > code is going to be syntactically valid 2.6 code. That's not so much a matter of confusion, but of careful research. I *think* all code that is syntactically correct in 2.4 is also syntactically correct in 2.6 - but only be

Re: distributing apps without the Python source?

2008-10-08 Thread Bruno Desthuilliers
Marc 'BlackJack' Rintsch a écrit : On Wed, 08 Oct 2008 10:59:44 -0500, skip wrote: Marc> On Wed, 08 Oct 2008 09:18:47 -0600, Joe Strout wrote: >> We have a client who's paranoid about distributing the Python >> source to his commercial app. Is there some way I can distribute >> and

Re: Compiler, ast and forwards/backwards compatibility

2008-10-08 Thread Martin v. Löwis
> The documentation for the ast module states that it "helps to find out > programmatically what the current grammar looks like". I can't find > any reference (even when reading the code) on how you should go about > this, other than checking the sys.version number and reading up on the > changes.

Re: no unbound methods in py3k

2008-10-08 Thread Bruno Desthuilliers
Thomas Heller a écrit : I'm currently using code like this to create unbound methods from functions and stick them into classes: method = new.instancemethod(raw_func, None, cls) setattr(cls, name, method) setattr(cls, name, func) would work better - given that either isinstance(raw_func

Re: Porn Addiction Solutions?

2008-10-08 Thread Dotan Cohen
2008/10/8 Support Desk <[EMAIL PROTECTED]>: > I got a solution, cutt it off, and then Kill yourself. > Cut what off? The OP is female. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ä-ö-ü-ß-Ä-Ö-Ü -- http://mail.python.org/mai

Re: no unbound methods in py3k

2008-10-08 Thread Christian Heimes
Thomas Heller wrote: but this is very ugly, imo. Is there another way? The raw_func instances that I have are not descriptors (they do not implement a __get__() method...) I've written PyInstanceMethod_Type for this use case. It's not (yet) available for Python code. Barry hasn't decided whet

RE: Porn Addiction Solutions?

2008-10-08 Thread Support Desk
I got a solution, cutt it off, and then Kill yourself. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 2:30 PM To: python-list@python.org Subject: Re: Porn Addiction Solutions? On Oct 8, 3:07 pm, [EMAIL PROTECTED] wrote: > Help, I'm

Re: Quality control in open source development

2008-10-08 Thread Matimus
On Oct 8, 8:43 am, Dave <[EMAIL PROTECTED]> wrote: > With the open source licenses that allow redistribution of modified > code, how do you keep someone unaffiliated with the Python community > from creating his or her own version of python, and declaring it to be > Python 2.6, or maybe Python 2.7

no unbound methods in py3k

2008-10-08 Thread Thomas Heller
I'm currently using code like this to create unbound methods from functions and stick them into classes: method = new.instancemethod(raw_func, None, cls) setattr(cls, name, method) Ok, python 2.6, run with the -3 flag, gives a warning that the new module is going away in python 3.0, so the

Re: Job Posting

2008-10-08 Thread Chris Rebert
On Wed, Oct 8, 2008 at 9:20 AM, Capuano, Rebecca <[EMAIL PROTECTED]> wrote: > HI, > > Would you be able to post this on your site? I don't know if you post jobs. > Thanks! This is a general-interest mailinglist about the Python programming language, not a way of directly contacting just the Python

Re: Apache log munging

2008-10-08 Thread Joe Python
I am currently using the following technic to get the info above: all = defaultdict(int) hosts = defaultdict(int) filename = defaultdict(int) for r in log: all[r['host'],r['file']] += 1 hosts[r['host']] += 1 filename[r['file']] = 1 for host in sorted(hosts,key=hosts.get, reverse=True):

Re: MRO inconsistency: why?

2008-10-08 Thread Terry Reedy
Ravi wrote: Why the following code gives inconsistent method resolution order error: class X(object): x = 4 def f(self): print 'f in X' print dir(X) X.g(self) def g(self): print 'g in X' class Y(object, X): def g(self): print 'g in Y' o = Y() o.f() Calculating a linear MRO from a non-tree

config errors

2008-10-08 Thread Kathleen Krause-Thompson
I've recently setup an environment on Unbuntu for Plone 3.0 that includes Python 2.4. I get the errors below when doing various things with apt-get like 'install python'. Is there some configuration that needs to be done as the message suggests? Thanks in advance. dpkg: error processing python-set

Re: Porn Addiction Solutions?

2008-10-08 Thread mikejanse
On Oct 8, 3:07 pm, [EMAIL PROTECTED] wrote: > Help, I'm addicted to porn. I've been spending a lot of time > downloading hardcore porn and masturbating to it. It's ruining my > life. I just found out that one of these sites somehow hacked my card > and rang up $5K in charges which they won't even r

Re: MRO inconsistency: why?

2008-10-08 Thread Christian Heimes
Ravi wrote: Why the following code gives inconsistent method resolution order error: [...] Your problem can be reduced to: >>> class A(object): ... pass ... >>> A.__mro__ (, ) >>> class B(object, A): ... pass ... Traceback (most recent call last): File "", line 1, in TypeError: Erro

RE: Python syntax question

2008-10-08 Thread Blubaugh, David A.
Sir, I was just wondering that the module that you are utilizing (Rpyc) is a remote process call module for python? Is this what you are developing with at this time? Thanks, David Blubaugh -Original Message- From: Daniel [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2

Re: Accessing the message of Outlook inbox

2008-10-08 Thread Mike Driscoll
On Oct 8, 12:50 pm, [EMAIL PROTECTED] wrote: > On Oct 8, 8:53 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > On Oct 8, 9:24 am, [EMAIL PROTECTED] wrote: > > > > Hi all, > > >         How can I access the body of a mail in Outlook Inbox? I tried > > > various options like message.Body or mes

Re: Python syntax question

2008-10-08 Thread Daniel
On Oct 8, 12:07 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 08 Oct 2008 11:02:49 -0700, Daniel wrote: > > Here is one error I get when I try to import it: > > import Rpyc > > Traceback (most recent call last): > >   File "", line 1, in > >   File "C:\Python25\lib\site-pa

MRO inconsistency: why?

2008-10-08 Thread Ravi
Why the following code gives inconsistent method resolution order error: class X(object): x = 4 def f(self): print 'f in X' print dir(X) X.g(self) def g(self): print 'g in X' class Y(object, X): def g(

Re: Quality control in open source development

2008-10-08 Thread Tim Chase
I think it's pretty self-evident that it's not a huge problem, don't you? Do you see lots of low quality python forks cluttering up the internet? hardly any...the best python fork I found: http://www.woopit.com/albums/Australian-snakes/GreenPythonSnake.jpg though they look more like tweezers t

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Sean DiZazzo
On Oct 8, 11:24 am, "Samuel A. Falvo II" <[EMAIL PROTECTED]> wrote: > On Oct 7, 6:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > Is your shell script doing something else, apart from invoking the java   > > process? > > Obviously, yes.  The script is some 150 lines long.  But the hang-

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Samuel A. Falvo II
On Oct 8, 11:31 am, "Samuel A. Falvo II" <[EMAIL PROTECTED]> wrote: > I removed the stdin=PIPE argument, and this works.  Many thanks for > bringing this to my attention. OK, I am confused. After observing a bug where the code works "every other time", like clockwork, I've used strace to figure o

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Samuel A. Falvo II
On Oct 8, 11:24 am, "Samuel A. Falvo II" <[EMAIL PROTECTED]> wrote: > It does not expect input from stdin.  However, this does not affect > any OTHER scripts or commands I run. OK, so, I'm very confused as to why this would matter. I removed the stdin=PIPE argument, and this works. Many thanks f

Re: Quality control in open source development

2008-10-08 Thread Terry Reedy
Dave wrote: With the open source licenses that allow redistribution of modified code, how do you keep someone unaffiliated with the Python community from creating his or her own version of python, and declaring it to be Python 2.6, or maybe Python 2.7 without any approval of anyone at the PSF? Ma

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Samuel A. Falvo II
On Oct 7, 6:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Is your shell script doing something else, apart from invoking the java   > process? Obviously, yes. The script is some 150 lines long. But the hang-up occurs because of the forked Java process, not the other lines. > If not, y

Re: Quality control in open source development

2008-10-08 Thread Samuel A. Falvo II
On Oct 8, 8:43 am, Dave <[EMAIL PROTECTED]> wrote: > With the open source licenses that allow redistribution of modified > code, how do you keep someone unaffiliated with the Python community > from creating his or her own version of python, and declaring it to be > Python 2.6, or maybe Python 2.7

Re: Upgrading an instance to a subclass

2008-10-08 Thread Terry Reedy
Antoon Pardon wrote: I have a subclass of socket. class Mysocket (socket): ... But when I use the python library it will of course just return an instance of socket, like the SocketServer module. So now I was wondering if it is somehow possible to turn this instance into a Mysocket instance

Re: Apache log munging

2008-10-08 Thread Joe Riopel
On Wed, Oct 8, 2008 at 1:55 PM, Joe Python <[EMAIL PROTECTED]> wrote: > I want to find the top '100' hosts (sorted in descending order of total > requests) like follows: > Is there a fast way to this without scanning the log file many times? As you encounter a new "host" add it to a dict (or anoth

Re: Python syntax question

2008-10-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Oct 2008 11:02:49 -0700, Daniel wrote: > Here is one error I get when I try to import it: > import Rpyc > Traceback (most recent call last): > File "", line 1, in > File "C:\Python25\lib\site-packages\Rpyc\__init__.py", line 7, in > > from Rpyc.Lib import rpyc_excepthook

Re: distributing apps without the Python source?

2008-10-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Oct 2008 10:59:44 -0500, skip wrote: > Marc> On Wed, 08 Oct 2008 09:18:47 -0600, Joe Strout wrote: > >> We have a client who's paranoid about distributing the Python > >> source to his commercial app. Is there some way I can distribute > >> and use just the .pyc files, so a

Python syntax question

2008-10-08 Thread Daniel
I hope this question is OK for this list. I've downloaded Rpyc and placed it in my site packages dir. On some machines it works fine, on others not so much. Here is one error I get when I try to import it: >>> import Rpyc Traceback (most recent call last): File "", line 1, in File "C:\Pyth

Re: how to get the thighest bit position in big integers?

2008-10-08 Thread Terry Reedy
MRAB wrote: On Oct 8, 9:56 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: On Oct 7, 5:19 pm, [EMAIL PROTECTED] wrote: but I want to make clear that I think that (0).numbits()==-1 is the natural solution. At least for all square-and-multiply-like algorithms needed in [...] Can you clarify this?

Apache log munging

2008-10-08 Thread Joe Python
I have a written a generator for an apache log which returns two types of information, hostname and the filename requested. The 'log' generator can be 'consumed' like this: for r in log: print r['host'], r['filename'] I want to find the top '100' hosts (sorted in descending order of total requ

Re: Accessing the message of Outlook inbox

2008-10-08 Thread venutaurus539
On Oct 8, 8:53 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Oct 8, 9:24 am, [EMAIL PROTECTED] wrote: > > > Hi all, > >         How can I access the body of a mail in Outlook Inbox? I tried > > various options like message.Body or message.Mesg etc. but didn't > > work. I could get the subject o

utf-8 read/write file

2008-10-08 Thread Bruno
Hi! I have big .txt file which i want to read, process and write to another .txt file. I have done script for that, but im having problem with croatian characters (Š,Đ,Ž,Č,Ć). How can I read/write from/to file in utf-8 encoding? I read file with fileinput.input. thanks -- http://mail.python.o

Re: how to get the thighest bit position in big integers?

2008-10-08 Thread MRAB
On Oct 8, 9:56 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Oct 7, 5:19 pm, [EMAIL PROTECTED] wrote: > > > but I want to make clear that I think that (0).numbits()==-1 > > is the natural solution. At least for all square-and-multiply-like > > algorithms needed in [...] > > Can you clarify thi

Re: Quality control in open source development

2008-10-08 Thread Christian Heimes
Dave wrote: If licensees can redisribute as they like, isn't this a huge problem? Is this dealt with be restricting use of the Python trademarks? Just curious.. From http://www.python.org/psf/summary/ --- The PSF also holds and protects the trademarks behind the Python programming language. T

Job Posting

2008-10-08 Thread Capuano, Rebecca
HI, Would you be able to post this on your site? I don't know if you post jobs. Thanks! Our client in Princeton, NJ is looking for a Python Developer to join its team. Description A small to medium Python project needs a motivated developer to work with the team lead. The position entails des

Re: PIL problem

2008-10-08 Thread J Kenneth King
bfrederi <[EMAIL PROTECTED]> writes: > I am having a problem using PIL. I am trying to crop and image to a > square, starting from the center of the image, but when I try to crop > the image, it won't crop. Here are the relevant code snippets: > > ### Function I am testing ### > def create_square_

Re: Quality control in open source development

2008-10-08 Thread Peter Otten
Dave wrote: > With the open source licenses that allow redistribution of modified > code, how do you keep someone unaffiliated with the Python community > from creating his or her own version of python, and declaring it to be > Python 2.6, or maybe Python 2.7 without any approval of anyone at the

Re: distributing apps without the Python source?

2008-10-08 Thread skip
Marc> On Wed, 08 Oct 2008 09:18:47 -0600, Joe Strout wrote: >> We have a client who's paranoid about distributing the Python source >> to his commercial app. Is there some way I can distribute and use >> just the .pyc files, so as to not give away the source? Marc> Yes. Just

Re: PIL problem

2008-10-08 Thread Peter Otten
bfrederi wrote: >> > image.crop((x1,y1,x2,y2)) >> >> This doesn't change `image` but creates and returns a new cropped image >> which you simply ignore. >> >> > image.save(file_name, "JPEG") >> >> Ciao, >> Marc 'BlackJack' Rintsch > > How do I output it to an actual file then? Or overwrite the ex

Re: PIL problem

2008-10-08 Thread bfrederi
On Oct 8, 10:39 am, bfrederi <[EMAIL PROTECTED]> wrote: > On Oct 8, 10:30 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > > > On Wed, 08 Oct 2008 08:10:02 -0700, bfrederi wrote: > > > I am having a problem using PIL. I am trying to crop and image to a > > > square, starting from the c

  1   2   >