Re: Mutable Strings - Any libraries that offer this?

2009-07-22 Thread casebash
Thanks all for your advice. I'm not actually going to use the mutable string right at the moment, but I thought I might in the future and I was just curious if it existed. I suppose a list of characters is close enough for most purposes. On Jul 22, 10:28 am, greg wrote: > Ben Finney wrote: > > My

Re: win32api install problem

2009-07-22 Thread Tim Roberts
Gerry wrote: >I'm running Python 2.6 under XP. > >I've installed Windows 32 extensions for Python 2.6 version 1.4 >(pywin32-214.win32-py2.6.exe). > >But If I try to import win32api, I get: > > File "C:\python_projects\euler\driveletters.py", line 1, in >import win32api >ImportError: DLL loa

Re: Running a Python Service under the LocalService or NetworkService Account

2009-07-22 Thread David Adamo Jr.
On Jul 21, 8:05 pm, "Martin P. Hellwig" wrote: > David Adamo Jr. wrote: > > On Jul 21, 10:40 am, "Martin P. Hellwig" > > wrote: > >> sightseer wrote: > > >> > > >>> Error Installing Service: Access is Denied. (5) > >> > >> Are you trying to do this on windows vista? > > >> -- > >> MPHhttp://blo

Re: trouble with minidom

2009-07-22 Thread Miles Kaufmann
On Jul 21, 2009, at 8:08 PM, Ronn Ross wrote: Hello I'm trying to read an xml file using minidome. The xml looks like: myProj /here/ My code looks like so: from xml.dom.minidom import parse dom = parse("myfile.xml") for node in dom.getElementsByTagName("project'): p

Re: Workflow Libraries (DB vs Code)

2009-07-22 Thread Thomas Guettler
Diez B. Roggisch schrieb: > Thomas Guettler wrote: > >> Hi, >> >> I need to write some simple workflows with web interface. >> >> For the web stuff I will use django, but I am not sure how >> to do the workflow part. > > Did you consider using OpenERP? It comes with a web-frontend > (TG1.0.8-base

Re: Regular exprssion for IRC messages

2009-07-22 Thread Jon Clements
On 22 July, 06:43, "Gabriel Genellina" wrote: > En Fri, 17 Jul 2009 13:59:47 -0300, nohics nohics   > escribió: > > > When an IRC client receive a messages, this message in in a special   > > format > > defined here: Message format in pseudo > > BNF

Ideas for problem with chat server application!

2009-07-22 Thread David Adamo Jr.
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 server system come back on, th

Re: Detect target name in descriptor __set__ method

2009-07-22 Thread Jon Clements
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 any way to obtain the name being   > assigned to? ('foo' in this

Suggestions for Python MapReduce?

2009-07-22 Thread Phillip B Oldham
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, or play nicely with Python but don't require the Java

binary literal

2009-07-22 Thread superpollo
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 -- http://mail.python.org/mailman/listinfo/python-list

Re: binary literal

2009-07-22 Thread Pablo Martí Gamboa
2009/7/22 superpollo > 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) ? (Python 3) >>> bin(45) '0b101101' >>> in

Re: Python

2009-07-22 Thread TNR
Hi, Check the below links.. http://www.tutorialspoint.com/python/ http://www.java2s.com/Tutorial/Python/CatalogPython.htm Hope that helps. Cheers -theajo On Wed, Jul 22, 2009 at 5:42 AM, Prateek wrote: > Chk dis out ... > > http://www.swaroopch.com/notes/Python > > It's gr8 guide for beginn

Re: Fast reading and unpacking of binary data (struct module)

2009-07-22 Thread John Machin
Daniel Platz googlemail.com> writes: > > Hi, > > I have a Python newbie question about reading data from a binary file. > I have an huge binary file from an external program. Please translate "huge" into Mb. Also, how much free real memory do you have? > I want to read > and process the data

Re: binary literal

2009-07-22 Thread Ulrich Eckhardt
superpollo wrote: > 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) ? There are binary number literals since 2.6 and there is th

Re: Mechanize not recognized by py2exe

2009-07-22 Thread Scott David Daniels
OrcaSoul wrote: ...it's too late to name my first born after you, but I did have a cat named Gabriel - she was a great cat! Remember Gabriel in English uses a hard A, as in the horn player, not Gabrielle. I know because when I first read his posts I made the same trick in my head, and hence im

Documentation Problems

2009-07-22 Thread Mark du Preez
Hi Can anyone tell me where to go to suggest changes to the Python documentation? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast reading and unpacking of binary data (struct module)

2009-07-22 Thread Neal Becker
Daniel Platz wrote: > Hi, > > I have a Python newbie question about reading data from a binary file. > I have an huge binary file from an external program. I want to read > and process the data in this file in a reasonable time. It turns out > that the reading of the data itself and the processin

Re: Documentation Problems

2009-07-22 Thread Tim Golden
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, or at least suggested wording rather than vague "I don't think it should say that" -- although that's bett

GTK+ ques

2009-07-22 Thread nipun batra
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 Ground control station of a UAV. H

Re: Documentation Problems

2009-07-22 Thread Diez B. Roggisch
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 already fixed in t

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

2009-07-22 Thread William Dode
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 gcj 2.15s java 2.8s python2.5 + psyco 3.1s unladen-200

Python ctypes on win64

2009-07-22 Thread ulf
Hi, Does anybody know if python includes a win64 version of ctypes? According to the documentation it should be included - at least there's no special remarks for win64, and I haven't found any recent notes saying that it shouldn't work on win64. Yet it looks like both the installer from Python.o

Re: Help understanding the decisions *behind* python?

2009-07-22 Thread Duncan Booth
Steven D'Aprano wrote: > But that's the wrong solution to the problem. The OP wants the largest > (or smallest) item, which he expects to get by sorting, then grabbing > the first element: > > sorted(alist)[0] > > That requires sorting the entire list, only to throw away everything > except th

Re: List insertion cost

2009-07-22 Thread Diez B. Roggisch
Lucas P Melo wrote: > Hello, > I would like to know how much it costs to insert an element into a list > using this operation: > a[2:2] = [ 1 ] > i. e, what is the complexity of the operation above (given that len(a) = > n)? O(n) I'd say. You need to copy nearly the whole list, and sometimes re-a

Re: doted filenames in import statements

2009-07-22 Thread Jean-Michel Pichavant
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 be to add the directory to sy

Re: Re: Changing the private variables content

2009-07-22 Thread Ryniek90
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 class, and decided

Re: Re: Changing the private variables content

2009-07-22 Thread Xavier Ho
On Wed, Jul 22, 2009 at 10:29 PM, Ryniek90 wrote: > Thanks for hint, but looks like i can't do what i want. That's because > > def _SetVar(self, attr, val): > self.attr = val doesn't work as you might think. However, I tried to replace it with: val('self.' + attr + '=\'' + va

Re: Re: Changing the private variables content

2009-07-22 Thread Xavier Ho
> > val('self.' + attr + '=\'' + val + '\'') > Obviously that was eval, not val. Also it doesn't work without the escaped single quotes, either. -- 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 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

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-

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1   2   >