Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-22 Thread William Dode
On 23-07-2009, Kurt Smith wrote: > On Wed, Jul 22, 2009 at 2:48 AM, Bearophile wrote: >> greg: >>> Posting benchmark times for Pyrex or Cython is pretty >>> meaningless without showing the exact code that was >>> used, since times can vary enormously depending on >>> how much you C-ify things. >> >

Re: python function for retrieving key and encryption

2009-07-22 Thread jayshree
On Jul 21, 8:59 pm, Piet van Oostrum wrote: > > jayshree (j) wrote: > >j> M2Crypto package not showing the 'recipient_public_key.pem' file at > >j> linux terminal .how do i get/connect with recipient public key. > >j> exactly i need to check how can i open this file through linux > >j> comman

Re: logging outgoing HTTP POST message and incoming response message

2009-07-22 Thread Gabriel Genellina
En Wed, 22 Jul 2009 18:18:37 -0300, scriptlear...@gmail.com escribió: On Jul 22, 1:54 pm, "Diez B. Roggisch" wrote: You can use proxy-tools such as tcpmon or sniff traffic using wireshark. Thanks, but I am trying to enable some debug mode to log all outgoing and incoming messages for certain

Re: Help understanding the decisions *behind* python?

2009-07-22 Thread Gabriel Genellina
En Wed, 22 Jul 2009 11:36:51 -0300, Inky 788 escribió: On Jul 22, 2:36 am, Hendrik van Rooyen wrote: The good reason is the immutability, which lets you use a tuple as a dict key.   Thanks for the reply Hendrik (and Steven (other reply)). Perhaps I'm just not sophisticated enough, but I've

MySQLdb for Python 3.1 getting close?

2009-07-22 Thread John Nagle
Is MySQLdb available for Python 3.1 yet? http://sourceforge.net/projects/mysql-python/ says the last supported Python version is 2.5. Any progress in sight? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: JavaScript toolkits (was Re: ANN: Porcupine Web Application Server 0.6 is released!)

2009-07-22 Thread Aahz
In article <1c994086-8c58-488f-b3b3-6161c4b2b...@k30g2000yqf.googlegroups.com>, Paul Boddie wrote: >On 20 Jul, 18:00, a...@pythoncraft.com (Aahz) wrote: >> >> Out of curiosity, are there any JavaScript toolkits that generate code >> that degrades gracefully when JavaScript is disabled? > >You mea

Re: JavaScript toolkits (was Re: ANN: Porcupine Web Application Server 0.6 is released!)

2009-07-22 Thread Aahz
In article , D'Arcy J.M. Cain wrote: >On 20 Jul 2009 17:10:55 -0700 >a...@pythoncraft.com (Aahz) wrote: >>>I understand what you want but I can't see how a toolkit can do that. >>>How do you program "graceful?" It seems pretty application specific. >> >> Presumably the JS toolkit generates both

Re: comments? storing a function in an object

2009-07-22 Thread Aahz
In article , Carl Banks wrote: > >You have to be REALLY REALLY careful not to pass any user-supplied >data to it if this is a server running on your computer, of course. Unless, of course, your users are paying for this service. -- Aahz (a...@pythoncraft.com) <*> http://www.py

Re: Not understanding this documentation

2009-07-22 Thread John Machin
On Jul 23, 2:45 am, "F.O.P." wrote: > On Jul 22, 9:07 am, "Rhodri James" > wrote: > > > > > > > > > On Wed, 22 Jul 2009 15:46:09 +0100, F.O.P.   > > wrote: > > > >http://bugs.python.org/issue5358 > > > I simply installed 3.0 on my ubuntubox brought my project from a > > > windows machine and mad

What is file.encoding convention?

2009-07-22 Thread Naoki INADA
In document : >> The encoding that this file uses. When Unicode strings are written to a file, >> they will be converted to byte strings using this encoding. In addition, >> when the file is connected to a terminal, the attribute gives

Re: Ideas for problem with chat server application!

2009-07-22 Thread alex23
On Jul 22, 6:27 pm, "David Adamo Jr." wrote: > Suggestions are highly appreciated. I haven't used it but I've heard good things about FireDaemon, which can run any script or program as a Windows service. Apparently the Lite version is free: http://www.download-freeware-shareware.com/Freeware-Sys

Re: regex: multiple matching for one string

2009-07-22 Thread rurpy
On Jul 22, 7:45 pm, "scriptlear...@gmail.com" wrote: > For example, I have a string "#a=valuea;b=valueb;c=valuec;", and I > will like to take out the values (valuea, valueb, and valuec). How do > I do that in Python? The group method will only return the matched > part. Thanks. > > p = re.compi

Re: python fast HTML data extraction library

2009-07-22 Thread Paul McGuire
On Jul 22, 5:43 pm, Filip wrote: > > My library, rather than parsing the whole input into a tree, processes > it like a char stream with regular expressions. > Filip - In general, parsing HTML with re's is fraught with easily-overlooked deviations from the norm. But since you have stepped up to

regex: multiple matching for one string

2009-07-22 Thread scriptlear...@gmail.com
For example, I have a string "#a=valuea;b=valueb;c=valuec;", and I will like to take out the values (valuea, valueb, and valuec). How do I do that in Python? The group method will only return the matched part. Thanks. p = re.compile('#a=*;b=*;c=*;') m = p.match(line) if m:

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-22 Thread Kurt Smith
On Wed, Jul 22, 2009 at 2:48 AM, Bearophile wrote: > greg: >> Posting benchmark times for Pyrex or Cython is pretty >> meaningless without showing the exact code that was >> used, since times can vary enormously depending on >> how much you C-ify things. > > Was this link, shown by William, not eno

RPY2 examples?

2009-07-22 Thread Wells Oliver
I am trying to find examples using RPY2 to render R graphs to PNG/PDF/etc. The only things I can find use rpy 1.x. Any references? Thanks! -- Wells Oliver we...@submute.net -- http://mail.python.org/mailman/listinfo/python-list

Re: If Scheme is so good why MIT drops it?

2009-07-22 Thread Paul Rubin
Carl Banks writes: > I don't think your fantasy async-only all-green-thread langauge > implementation is possible anyway. Erlang and GHC both work like that, quite successfully: http://shootout.alioth.debian.org/gp4/benchmark.php?test=threadring&lang=all > How would you wait on a pipe in one

Re: challenging problem for changing to a dedicated non-privileged user within a script.

2009-07-22 Thread Martin P. Hellwig
Krishnakant wrote: I've seen a method before in a MS cmd script (MakeMeAdmin.cmd) for the purpose of temporarily elevating your rights but remaining the same user. There was a need trick in that the script checks itself on what credentials it runs, if it is not the appropriate one it will ca

Re: invoke method on many instances

2009-07-22 Thread Gabriel Genellina
En Wed, 22 Jul 2009 10:14:12 -0300, Alan G Isaac escribió: On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: def apply2(itr, methodname, *args, **kwargs): f = operator.methodcaller(methodname, *args, **kwargs) for item in itr: f(item) On 7/17/2009 3:45 AM Steven D'A

Re: Detect target name in descriptor __set__ method

2009-07-22 Thread Gabriel Genellina
En Wed, 22 Jul 2009 11:01:09 -0300, Rhodri James escribió: On Wed, 22 Jul 2009 06:02:55 +0100, Gabriel Genellina wrote: class X(object): foo = descriptor() x = X() x.foo = "value" Isn't this going to create a brand new instance attribute x.foo that has nothing to do with the descr

Re: Detect target name in descriptor __set__ method

2009-07-22 Thread Gabriel Genellina
En Wed, 22 Jul 2009 05:31:13 -0300, Jon Clements escribió: On 22 July, 06:02, "Gabriel Genellina" wrote: I have a class attribute 'foo' which is a data descriptor. I create an   instance of such class. When I say instance.foo = value, the descriptor   __set__ method is called. Is there a

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-22 Thread Brian
On Wed, Jul 22, 2009 at 11:55 AM, William Dode wrote: > On 22-07-2009, William Dode wrote: > > > c 1.65s > > gcj 1.9s > > java 2.4s > > python2.5 + psyco 2.9s > > shedskin 3.4s > > with -bw i have 2.6s > > > unladen-2009Q2 125s (2m05) > > Jython 2.2.1 on java1.6.0_12 176s (without array, like she

Re: Python-list Digest, Vol 70, Issue 282

2009-07-22 Thread Piet van Oostrum
> Ryniek90 (R) wrote: >R> " >R> Didn't worked, so i wil reuse your class, and modify it later. Now i see >R> that working on private objects complex. No it's not complex. *You* make it complex. -- Piet van Oostrum URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] Private email: p...@va

Re: Changing the private variables content

2009-07-22 Thread Piet van Oostrum
> Ryniek90 (R) wrote: >R> It looks like private variable have specific naure, that prevent from >R> traditional editing them. >R> Still searching for some tuts about private methods and variables. Why do you stubbornly keep saying that, while you have been told that it is not the case. Inste

Re: Documentation Problems

2009-07-22 Thread Ben Finney
Inky 788 writes: > Could you please provide brief instructions on exactly how to go about > creating a suitable patch file? I mean, starting from the beginning > (as in, "check out code from {here} using {this command}", "cd to > {this} directory", "edit the file in place", "run {this} command to

python fast HTML data extraction library

2009-07-22 Thread Filip
Hello, Sometime ago I was searching for a library that would simplify mass data scraping/extraction from webpages. Python XPath implementation seemed like the way to go. The problem was that most of the HTML on the net doesn't conform to XML standards, even the XHTML (those advertised as valid XHT

Re: challenging problem for changing to a dedicated non-privileged user within a script.

2009-07-22 Thread Piet van Oostrum
> Krishnakant (K) wrote: >K> hello all, >K> This is a real challenge and I don't know if a solution even exists for >K> this or not. >K> I am writing an application which I run as my usual user on ubuntu. >K> the usernake is let's say kk and it has sudo permission (meaning the >K> user is in

Re: If Scheme is so good why MIT drops it?

2009-07-22 Thread Carl Banks
On Jul 22, 1:53 pm, Jean-Paul Calderone wrote: > On Wed, 22 Jul 2009 12:35:52 -0700 (PDT), Carl Banks > wrote: > >On Jul 22, 12:04 pm, Paul Rubin wrote: > >> Carl Banks writes: > >> > > Why is that such an advantage?  Green threads work fine if you just > >> > > o

Re: Issue combining gzip and subprocess

2009-07-22 Thread Piet van Oostrum
> Scott David Daniels (SDD) schreef: >SDD> Piet van Oostrum wrote: >>> ... >>> f = gzip.open(filename, 'w') >>> proc = subprocess.Popen(['ls','-la'], stdout=subprocess.PIPE) >>> while True: >>> line = proc.stdout.readline() >>> if not line: break >>> f.write(line) >>> f.close() >SDD> Or even

Re: time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-22 Thread Piet van Oostrum
> davidj411 (d) wrote: >d> i never heard of the logging module, but this function seemed simple >d> enough. >d> i assume this link is what you refering to: >d> http://docs.python.org/library/logging.html >d> thanks for the helpful info. i think "Piet van Oostrum" has resolved >d> my issue.

Re: logging outgoing HTTP POST message and incoming response message

2009-07-22 Thread scriptlear...@gmail.com
On Jul 22, 1:54 pm, "Diez B. Roggisch" wrote: > You can use proxy-tools such as tcpmon or sniff traffic using wireshark. > > Diez Thanks, but I am trying to enable some debug mode to log all outgoing and incoming messages for certain period of time, and running another proxy-tool is not very idea

Re: logging outgoing HTTP POST message and incoming response message

2009-07-22 Thread Diez B. Roggisch
scriptlear...@gmail.com schrieb: I am sending a HTTP POST by using the following codes: opener = urllib2.build_opener(proxyHandler, MultipartPostHandler) params = { "audio" : "http://sample.com/my.wav";, "data" : open(file, "rb") } print opener.open(myURL, params).read() How do I log or print o

logging outgoing HTTP POST message and incoming response message

2009-07-22 Thread scriptlear...@gmail.com
I am sending a HTTP POST by using the following codes: opener = urllib2.build_opener(proxyHandler, MultipartPostHandler) params = { "audio" : "http://sample.com/my.wav";, "data" : open(file, "rb") } print opener.open(myURL, params).read() How do I log or print out the actual POST message (includi

Re: If Scheme is so good why MIT drops it?

2009-07-22 Thread Jean-Paul Calderone
On Wed, 22 Jul 2009 12:35:52 -0700 (PDT), Carl Banks wrote: On Jul 22, 12:04 pm, Paul Rubin wrote: Carl Banks writes: > > Why is that such an advantage?  Green threads work fine if you just > > organize the i/o system to never block. > Because then I don't have

Re: Python

2009-07-22 Thread Mark Lawrence
khanh le wrote: do you have any materials about Python? can you show me the link of Python or some books? thanks a lots! -- Regard! Khanh This comes highly recommeended http://diveintopython.org/ Regards. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-22 Thread George Sakkis
On Jul 22, 12:45 pm, William Dode wrote: > On 22-07-2009, George Sakkis wrote: > > > > > On Jul 22, 7:38 am, William Dode wrote: > > >> I updated the script (python, c and java) with your unrolled version > >> + somes litle thinks. > > >> I also tried with python3.1, unladen Q2, ironpython1.1.1 >

Re: GTK+ ques

2009-07-22 Thread Michael Torrie
nipun batra wrote: > I need to develop a GUI preferably in GTK using c or PYGTK.I have little > idea about Python. > Following are requiremnts of the application: > should be GUI > Sould be real time > Should interface serial port > should display moving maps,like google earth > It is basically for

Re: clean way prepend an element to a numpy array

2009-07-22 Thread Robert Kern
On 2009-07-22 01:51, greg wrote: bdb112 wrote: I saw this interest syntax on this site x[:0]=0 I guess that is cute, but could be confusing(and doesn't work) It does if you use an array of the appropriate type on the right hand side: a[:0] = array('i', [0]) Not when 'a' is a numpy arr

Re: If Scheme is so good why MIT drops it?

2009-07-22 Thread Carl Banks
On Jul 22, 12:04 pm, Paul Rubin wrote: > Carl Banks writes: > > > Why is that such an advantage?  Green threads work fine if you just > > > organize the i/o system to never block.   > > > Because then I don't have to organize the I/O system never to block. > > We're

Re: Einstein summation notation

2009-07-22 Thread Ethan Furman
Paul Rubin wrote: Ethan Furman writes: Or if any(p for p in [header, body, footer, whatever, ...]) No need for the genexp: if any([header, body, footer, whatever, ...]) But, you are using the built-in bool cast either way. Right you are -- and if any([header, body, footer, whateve

Re: list of 'magic methods' or builtin class methods... want to exclude those from dir output

2009-07-22 Thread Terry Reedy
DG wrote: There is probably a better way to do this (please enlighten me, if you know), but what I want to do is get a list of a class' attributes minus whatever the 'builtin' methods are. I would also like to do this for instances of classes as well. I don't want to use __dict__ because I want

Re: If Scheme is so good why MIT drops it?

2009-07-22 Thread Paul Rubin
Carl Banks writes: > > Why is that such an advantage?  Green threads work fine if you just > > organize the i/o system to never block.   > > Because then I don't have to organize the I/O system never to block. We're talking about what a language implementation does behind the scenes, I thought.

Re: If Scheme is so good why MIT drops it?

2009-07-22 Thread Grant Edwards
On 2009-07-22, Ron Garret wrote: > In article , > Neil Hodgson wrote: > >> milanj: >> >> > and all of them use native threads (python still use green threads ?) >> >>Python uses native threads. > > But then it adds the global interpreter lock, which completely > undermines the utility of

Re: list of 'magic methods' or builtin class methods... want to exclude those from dir output

2009-07-22 Thread DG
On Jul 22, 12:24 pm, DG wrote: > On Jul 22, 12:15 pm, DG wrote: > > > > > There is probably a better way to do this (please enlighten me, if you > > know), but what I want to do is get a list of a class' attributes > > minus whatever the 'builtin' methods are.  I would also like to do > > this fo

Re: list of 'magic methods' or builtin class methods... want to exclude those from dir output

2009-07-22 Thread DG
On Jul 22, 12:15 pm, DG wrote: > There is probably a better way to do this (please enlighten me, if you > know), but what I want to do is get a list of a class' attributes > minus whatever the 'builtin' methods are.  I would also like to do > this for instances of classes as well.  I don't want to

list of 'magic methods' or builtin class methods... want to exclude those from dir output

2009-07-22 Thread DG
There is probably a better way to do this (please enlighten me, if you know), but what I want to do is get a list of a class' attributes minus whatever the 'builtin' methods are. I would also like to do this for instances of classes as well. I don't want to use __dict__ because I want to get all

Re: time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-22 Thread davidj411
i never heard of the logging module, but this function seemed simple enough. i assume this link is what you refering to: http://docs.python.org/library/logging.html thanks for the helpful info. i think "Piet van Oostrum" has resolved my issue. good eyes! -- http://mail.python.org/mailman/listinf

Re: If Scheme is so good why MIT drops it?

2009-07-22 Thread Carl Banks
On Jul 22, 10:20 am, Paul Rubin wrote: > Carl Banks writes: > > Wrong.  It only partially undermines the utility of native threads, > > not completely.  Native threading allows some threads to run while > > others are blocked in a system call (as well as in a few oth

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-22 Thread William Dode
On 22-07-2009, William Dode wrote: > c 1.65s > gcj 1.9s > java 2.4s > python2.5 + psyco 2.9s > shedskin 3.4s with -bw i have 2.6s > unladen-2009Q2 125s (2m05) > Jython 2.2.1 on java1.6.0_12 176s (without array, like shedskin) > Jython 2.2.1 on java1.6.0_12 334s (with array) > python2.5 215s (3m3

Re: Suggestions for Python MapReduce?

2009-07-22 Thread Phillip B Oldham
On Jul 22, 5:55 pm, Paul Rubin wrote: > Phillip B Oldham writes: > I usually just spew ssh tasks across whatever computing nodes I can > get my hands on.  It's less organized than something like mapreduce, > but I tend to run one-off tasks that I have to keep an eye

Re: How to document Python code properly for Pydoc

2009-07-22 Thread Lie Ryan
jorma kala wrote: > Hi, > Do you know where I can find the rules for documenting Python code, so > that automatic document generation with Pydoc makes the most of the > comments inserted in the code? > I know about documenting class and method through triple quote just > under the class definition.

Re: Pyserial and pyQt

2009-07-22 Thread Seth
On Jul 21, 7:24 pm, David Boddie wrote: > On Tuesday 21 July 2009 21:37, Seth wrote: > > > I have used pyserial in the past but this is my first experience with > > pyQt.  I am using the Python xy package for windows current but might > > move to linux.  I have a small device that is outputting a

Re: If Scheme is so good why MIT drops it?

2009-07-22 Thread Paul Rubin
Carl Banks writes: > Wrong. It only partially undermines the utility of native threads, > not completely. Native threading allows some threads to run while > others are blocked in a system call (as well as in a few other minor > cases), which can't be done with green threads. Why is that such a

Re: Documentation Problems

2009-07-22 Thread Lie Ryan
Inky 788 wrote: > On Jul 22, 7:15 am, Tim Golden wrote: >> Mark du Preez wrote: >>> Hi >>> Can anyone tell me where to go to suggest changes to the Python >>> documentation? >> Drop an entry in the tracker: >> >> http://bugs.python.org >> >> Patches are always welcome, > > Could you please provi

Re: If Scheme is so good why MIT drops it?

2009-07-22 Thread Carl Banks
On Jul 22, 9:36 am, Ron Garret wrote: > In article , >  Neil Hodgson wrote: > > > milanj: > > > > and all of them use native threads (python still use green threads ?) > > >    Python uses native threads. > > But then it adds the global interpreter lock, which completely > undermines the utility

Re: Suggestions for Python MapReduce?

2009-07-22 Thread Paul Rubin
Phillip B Oldham writes: > Implementations like BashReduce mapreduce-bash-script> are perfect for such scenarios. I'm simply > wondering if there's another simpler/smaller implementation of > MapReduce that plays nicely with Python but doesn't require the setup/

Re: Not understanding this documentation

2009-07-22 Thread Terry Reedy
F.O.P. wrote: Your subject line should have been about "SyntaxError message" http://bugs.python.org/issue5358 Why reference this? Unless you added zero-width joiners in the move, this is irrelevant noise. I simply installed 3.0 on my ubuntubox Upgrade to 3.1 as soon as you can. Works b

Re: Finding all cycles within an undirected graph

2009-07-22 Thread Terry Reedy
disappearedng wrote: Hey everyone, I am interested to find out all the cycles within an undirected graph. I think you have to qualify that as 'minimal cycles' to have a well-defined problem. -- http://mail.python.org/mailman/listinfo/python-list

Re: Not understanding this documentation

2009-07-22 Thread F.O.P.
On Jul 22, 9:07 am, "Rhodri James" wrote: > On Wed, 22 Jul 2009 15:46:09 +0100, F.O.P.   > wrote: > > >http://bugs.python.org/issue5358 > > I simply installed 3.0 on my ubuntubox brought my project from a > > windows machine and made necessary changes to what I had used from os > > and os.path.  

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-22 Thread William Dode
On 22-07-2009, George Sakkis wrote: > On Jul 22, 7:38 am, William Dode wrote: > >> I updated the script (python, c and java) with your unrolled version >> + somes litle thinks. >> >> I also tried with python3.1, unladen Q2, ironpython1.1.1 >> >> Unfortunately it doesn't work more with shedskin, i'

Re: doted filenames in import statements

2009-07-22 Thread Terry Reedy
Jean-Michel Pichavant wrote: Piet van Oostrum wrote: [snip] JP> file = "/home/dsp/4.6.0.0/test.py" JP> test = __import__(file) JP> => no module name blalalal found. JP> Any suggestion ? I tried multiple escape technics without any success. Rightly so. I think the best would

Re: Not understanding this documentation

2009-07-22 Thread John Machin
On Jul 23, 12:46 am, "F.O.P." wrote: > http://bugs.python.org/issue5358 > I simply installed 3.0 on my ubuntubox brought my project from a > windows machine and made necessary changes to what I had used from os > and os.path.  I have an error at the end of this line: > for k in range(I): > and the

Re: If Scheme is so good why MIT drops it?

2009-07-22 Thread Ron Garret
In article , Neil Hodgson wrote: > milanj: > > > and all of them use native threads (python still use green threads ?) > >Python uses native threads. But then it adds the global interpreter lock, which completely undermines the utility of native threads. So yes, it uses native threads,

Re: Documentation Problems

2009-07-22 Thread Terry Reedy
Diez B. Roggisch wrote: Mark du Preez wrote: Hi Can anyone tell me where to go to suggest changes to the Python documentation? Thanks. http://docs.python.org/ has a "bugs"-section that leads to http://docs.python.org/bugs.html You can file doc-bugs in the tracker, and check if they are al

Re: binary literal

2009-07-22 Thread Terry Reedy
superpollo wrote: hello clp. i can insert a hex value for a character literal in a string: >>> stuff = "\x45" >>> print stuff E >>> can i do something like the above, but using a *binary* number? (e.g. 00101101 instead of 45) ? Language Ref 2.4. Literals -- http://mail.python.org/mailma

Copy/paste through LAN

2009-07-22 Thread Jun
Hello, I've a client/server application which uses Pyro to communicate each other. Now i try to implement copy/paste through LAN between server controlled filesystem to my local windows machine (I could list files in client's window). How can i pass the url information through Pyro ? Thank you in

Re: Python-list Digest, Vol 70, Issue 282

2009-07-22 Thread Ryniek90
When i use this class in Python IDLE, i've got this error: " ... Traceback (most recent call last): File "", line 1, in mod.print_module('socket') File "", line 48, in print_module module_open = open(self._this_module, 'rb') IOError: [Errno 2] No such file or directory: ''

Re: Changing the private variables content

2009-07-22 Thread Jean-Michel Pichavant
Steven D'Aprano wrote: On Wed, 22 Jul 2009 14:29:20 +0200, Ryniek90 wrote: When i use this class in Python IDLE, i've got this error: " ... Traceback (most recent call last): File "", line 1, in mod.print_module('socket') File "", line 48, in print_module module_open =

Re: Suggestions for Python MapReduce?

2009-07-22 Thread python
Phillip, We've had great success writing simple, project specific algorithms to split content into chunks appropriate for ETL type, Python based processing in a hosted cloud environment like Amazon EC2 or the recently launched Rackspace Cloud Servers. Since we're purchasing our cloud hosting time

Re: Changing the private variables content

2009-07-22 Thread Dave Angel
Ryniek90 wrote: It looks like private variable have specific naure, that prevent from traditional editing them. Still searching for some tuts about private methods and variables. There's no tutorial on private variables for good reason: Private variables have no special characteristics.

challenging problem for changing to a dedicated non-privileged user within a script.

2009-07-22 Thread Krishnakant
hello all, This is a real challenge and I don't know if a solution even exists for this or not. I am writing an application which I run as my usual user on ubuntu. the usernake is let's say kk and it has sudo permission (meaning the user is in the sudoers list ). now when i do python myscript.py

Re: binary literal

2009-07-22 Thread Dave Angel
superpollo wrote: hello clp. i can insert a hex value for a character literal in a string: >>> stuff = "\x45" >>> print stuff E >>> can i do something like the above, but using a *binary* number? (e.g. 00101101 instead of 45) ? bye There's no way to get a binary value directly into a lit

Re: Suggestions for Python MapReduce?

2009-07-22 Thread Phillip B Oldham
On Jul 22, 2:23 pm, Casey Webster wrote: > I can't answer your question, but I would like to better understand > the > problem you are trying to solve.  The Apache Hadoop/MapReduce java > application isn't really that "large" by modern standards, although it > is generally run with large heap size

Re: Not understanding this documentation

2009-07-22 Thread Rhodri James
On Wed, 22 Jul 2009 15:46:09 +0100, F.O.P. wrote: http://bugs.python.org/issue5358 I simply installed 3.0 on my ubuntubox brought my project from a windows machine and made necessary changes to what I had used from os and os.path. I have an error at the end of this line: for k in range(I): a

Re: Help understanding the decisions *behind* python?

2009-07-22 Thread Luis Alberto Zarrabeitia Gomez
Quoting Inky 788 : > > The good reason is the immutability, which lets you use > > a tuple as a dict key.   > > Thanks for the reply Hendrik (and Steven (other reply)). Perhaps I'm > just not sophisticated enough, but I've never wanted to use a list/ > tuple as a dict key. This sounds like obscu

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-22 Thread George Sakkis
On Jul 22, 7:38 am, William Dode wrote: > I updated the script (python, c and java) with your unrolled version > + somes litle thinks. > > I also tried with python3.1, unladen Q2, ironpython1.1.1 > > Unfortunately it doesn't work more with shedskin, i'll see on the > shedskin group... > > c 1.85s

Not understanding this documentation

2009-07-22 Thread F.O.P.
http://bugs.python.org/issue5358 I simply installed 3.0 on my ubuntubox brought my project from a windows machine and made necessary changes to what I had used from os and os.path. I have an error at the end of this line: for k in range(I): and the error: SyntaxError: invalid character in identifi

Re: Documentation Problems

2009-07-22 Thread Inky 788
On Jul 22, 7:15 am, Tim Golden wrote: > Mark du Preez wrote: > > Hi > > > Can anyone tell me where to go to suggest changes to the Python > > documentation? > > Drop an entry in the tracker: > >  http://bugs.python.org > > Patches are always welcome, Could you please provide brief instructions on

Re: Help understanding the decisions *behind* python?

2009-07-22 Thread Inky 788
On Jul 22, 2:36 am, Hendrik van Rooyen wrote: > On Tuesday 21 July 2009 15:49:59 Inky 788 wrote: > > > On Jul 20, 12:27 pm, Phillip B Oldham > > > wrote: > > > [snip] We > > > understand that lists are mutable and tuples are not, but we're a > > > little lost as to why the two were kept separate

Re: Ideas for problem with chat server application!

2009-07-22 Thread Dave Angel
David Adamo Jr. wrote: I developed a chat application with an attendant chat server. Everything is working fine. The issue now is the fact that whenever the chat server goes down (for instance, the server system shuts down as a result of power failure or some other problem), by the time the serve

Re: Finding all cycles within an undirected graph (disappearedng)

2009-07-22 Thread disappearedng
Actually, I have realized that using the bit vector XOR method by http://www.me.utexas.edu/~bard/IP/Handouts/cycles.pdf gives some possibility of doing so. However this method is still experimental and doesn't really have a definitive end to the algorithm (the base number of vectors can change). A

Re: plotting graph from another file

2009-07-22 Thread Grant Edwards
On 2009-07-22, jhinak sen wrote: > i want to plot a distribution graph for following data: [...] > can it be done using matplotlib ? > > if yes , please give me the code for plotting the importing > the text file and plotting the graph. As soon as you're done cleaning my house, washing my car,

Re: Issue combining gzip and subprocess

2009-07-22 Thread Scott David Daniels
Piet van Oostrum wrote: ... f = gzip.open(filename, 'w') proc = subprocess.Popen(['ls','-la'], stdout=subprocess.PIPE) while True: line = proc.stdout.readline() if not line: break f.write(line) f.close() Or even: proc = subprocess.Popen(['ls','-la'], stdout=subprocess.PIPE)

Re: Changing the private variables content

2009-07-22 Thread Ryniek90
Got it: exec('self.' + attr + '=\'' + val + '\'') That worked. I think it'll do what you want now ;) Ching-Yun "Xavier" Ho, Technical Artist Contact Information Mobile: (+61) 04 3335 4748 Skype ID: SpaXe85 Email: cont...@xavierho.com Website: http://xavierho.com/

Re: Detect target name in descriptor __set__ method

2009-07-22 Thread Rhodri James
On Wed, 22 Jul 2009 06:02:55 +0100, Gabriel Genellina wrote: class X(object): foo = descriptor() x = X() x.foo = "value" Isn't this going to create a brand new instance attribute x.foo that has nothing to do with the descriptor anyway? -- Rhodri James *-* Wildebeest Herder to the M

Re: Multiple versions of python

2009-07-22 Thread Scott David Daniels
CCW wrote: On 21 July, 15:19, Dave Angel wrote: The other thing you may want to do in a batch file is to change the file associations so that you can run the .py file directly, without typing "python" or "pythonw" in front of it. The relevant Windows commands are: assoc and ftype And

How to document Python code properly for Pydoc

2009-07-22 Thread jorma kala
Hi, Do you know where I can find the rules for documenting Python code, so that automatic document generation with Pydoc makes the most of the comments inserted in the code? I know about documenting class and method through triple quote just under the class definition. But how do you comment a spec

Re: Finding all cycles within an undirected graph

2009-07-22 Thread Robin Becker
disappearedng wrote: Hey everyone, I am interested to find out all the cycles within an undirected graph. I don't have a particular implementation of nodes and vertices yet, so would someone kindly point out a good graph library for this ( I looked at pygraph and python-graph, but not really sati

Re: Changing the private variables content

2009-07-22 Thread Steven D'Aprano
On Wed, 22 Jul 2009 14:29:20 +0200, Ryniek90 wrote: > When i use this class in Python IDLE, i've got this error: " ... > Traceback (most recent call last): > File "", line 1, in > mod.print_module('socket') > File "", line 48, in print_module > module_open = open(self._this_module, 'r

Getting cookie "expires" value

2009-07-22 Thread Brendon Wickham
Hi there, My web application uses a cookie to set/get a session id. This is working fine. However, I'm unable to work out how to get the cookie "expires" value. Below is test code that replicates the problem. It creates a simple web page and shows a cookie value if it's found, or creates a new on

Re: Suggestions for Python MapReduce?

2009-07-22 Thread Casey Webster
On Jul 22, 5:27 am, Phillip B Oldham wrote: > I understand that there are a number of MapReduce frameworks/tools > that play nicely with Python (Disco, Dumbo/Hadoop), however these have > "large" dependencies (Erlang/Java). Are there any MapReduce frameworks/ > tools which are either pure-Python,

Re: Changing the private variables content

2009-07-22 Thread Xavier Ho
> What is the point of the _SetVar method? > > So you can set any variable in that class, I guess? -- http://mail.python.org/mailman/listinfo/python-list

Re: invoke method on many instances

2009-07-22 Thread Alan G Isaac
>>> On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: def apply2(itr, methodname, *args, **kwargs): f = operator.methodcaller(methodname, *args, **kwargs) for item in itr: f(item) >> On 7/17/2009 3:45 AM Steven D'Aprano apparently wrote: >>> for obj in ob

Re: Changing the private variables content

2009-07-22 Thread MRAB
Ryniek90 wrote: Temat: Re: Changing the private variables content Od: Gary Herron Data: Tue, 21 Jul 2009 14:14:44 -0700 Do: Ryniek90 Do: Ryniek90 Kopia: python-list@python.org Ryniek90 wrote: Hi. I'm writing some cl

Re: Multiple versions of python

2009-07-22 Thread Dave Angel
CCW wrote: On 21 July, 15:19, Dave Angel wrote: ChrisW wrote: Hi, I have installed 2 versions of python on my Windows XP computer - I originally had 3.0.1, but then found that the MySQL module only supported 2.*, so I've now installed that. I have found that if I change the Wi

Python-URL! - weekly Python news and links (Jul 22)

2009-07-22 Thread Gabriel Genellina
QOTW: "If programming is symbol manipulation, then you should remember that the user interface is also symbol manipulation, and it is a MUCH harder problem than databases, sorting, searching, and all the other problems you learn about in academia. The user interface has to communicate over a rich

Re: Re: Changing the private variables content

2009-07-22 Thread Xavier Ho
Got it: exec('self.' + attr + '=\'' + val + '\'') That worked. I think it'll do what you want now ;) Ching-Yun "Xavier" Ho, Technical Artist Contact Information Mobile: (+61) 04 3335 4748 Skype ID: SpaXe85 Email: cont...@xavierho.com Website: http://xavierho.com/ -- http://mail.python.org/mail

Finding all cycles within an undirected graph

2009-07-22 Thread disappearedng
Hey everyone, I am interested to find out all the cycles within an undirected graph. I don't have a particular implementation of nodes and vertices yet, so would someone kindly point out a good graph library for this ( I looked at pygraph and python-graph, but not really satisfied ), in addition to

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-22 Thread William Dode
On 22-07-2009, srepmub wrote: > > please send any program that doesn't work with shedskin (it still is > experimental after all) to me, or create an issue at > shedskin.googlecode.com, and I will have a look at the problem. I did it, on the discussion group http://groups.google.com/group/shedskin-

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-22 Thread srepmub
please send any program that doesn't work with shedskin (it still is experimental after all) to me, or create an issue at shedskin.googlecode.com, and I will have a look at the problem. thanks, mark. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >