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

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

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

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

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

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

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

Google Advanced Urls - Free

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

xtube - Free

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

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

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

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

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

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

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

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

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.

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

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

<    1   2