Re: How to get memory and CPU status of a particular process

2010-02-22 Thread Taskinoor Hasan
On Tue, Feb 23, 2010 at 9:48 AM, R. P. Janaka wrote: > Hi all, > > Is there a way to get system memory consumption and CPU consumption in a > platform independent way, using python...? > > Basically my requirement is, get the memory status and CPU status of a > particular process. If there is a w

Re: How to get memory and CPU status of a particular process

2010-02-22 Thread Chris Rebert
On Mon, Feb 22, 2010 at 11:16 PM, Paul Rudin wrote: > Chris Rebert writes: >>> On Tue, Feb 23, 2010 at 9:18 AM, R. P. Janaka wrote: Is there a way to get system memory consumption and CPU consumption in a platform independent way, using python...? Basically my requirement is,

Re: How to get memory and CPU status of a particular process

2010-02-22 Thread Paul Rudin
Chris Rebert writes: >> On Tue, Feb 23, 2010 at 9:18 AM, R. P. Janaka wrote: >>> Hi all, >>> >>> Is there a way to get system memory consumption and CPU consumption in a >>> platform independent way, using python...? >>> >>> Basically my requirement is, get the memory status and CPU status of a

Now Win a laptop computer from (EZ laptop) free of charge

2010-02-22 Thread Jedady
All you have to do is just click on the link below and register on- site.And you'll know the rest of the steps on your own http://ezlaptop.com/?r=130329 Good luck to all -- http://mail.python.org/mailman/listinfo/python-list

Re: Use eval() safely?

2010-02-22 Thread Steven D'Aprano
On Mon, 22 Feb 2010 11:45:10 -0800, Jonathan Gardner wrote: > Why would you ever run untrusted code on any machine in any language, > let alone Python? Because sometimes you have to run untrusted code, so you want to run it in a sandbox so it can't eat your machine. E.g. viewing PDF files. Or

Re: How to get memory and CPU status of a particular process

2010-02-22 Thread Chris Rebert
> On Tue, Feb 23, 2010 at 9:18 AM, R. P. Janaka wrote: >> Hi all, >> >> Is there a way to get system memory consumption and CPU consumption in a >> platform independent way, using python...? >> >> Basically my requirement is, get the memory status and CPU status of a >> particular process. If ther

Re: Can I make sqlite3 or shelve work reliably on any Win/Linux/Mac?

2010-02-22 Thread Brad Harms
On Mon, 22 Feb 2010 09:10:38 -0800, Alex Quinn wrote: > Is there a way to have some kind of database (i.e. sqlite3, bsddb, dbm, > etc.) that works out of the box on any Win/Linux/Mac machine with Python > 2.6+ or 3.x? It's okay if the file format is different between machines, > but I want my scri

Re: The future of "frozen" types as the number of CPU cores increases

2010-02-22 Thread sjdevn...@yahoo.com
On Feb 22, 9:24 pm, John Nagle wrote: > sjdevn...@yahoo.com wrote: > > On Feb 20, 9:58 pm, John Nagle wrote: > >> sjdevn...@yahoo.com wrote: > >>> On Feb 18, 2:58 pm, John Nagle wrote: >     Multiple processes are not the answer.  That means loading multiple > copies of the same code i

Re: The future of "frozen" types as the number of CPU cores increases

2010-02-22 Thread sjdevn...@yahoo.com
On Feb 22, 9:24 pm, John Nagle wrote: > sjdevn...@yahoo.com wrote: > > On Feb 20, 9:58 pm, John Nagle wrote: > >> sjdevn...@yahoo.com wrote: > >>> On Feb 18, 2:58 pm, John Nagle wrote: >     Multiple processes are not the answer.  That means loading multiple > copies of the same code i

Re: How to get memory and CPU status of a particular process

2010-02-22 Thread R. P. Janaka
Please can anyone help me..?? On Tue, Feb 23, 2010 at 9:18 AM, R. P. Janaka wrote: > Hi all, > > Is there a way to get system memory consumption and CPU consumption in a > platform independent way, using python...? > > Basically my requirement is, get the memory status and CPU status of a > part

ANN: esky v0.4.0 [was Re: Upgrading Py2exe App]

2010-02-22 Thread Ryan Kelly
Hi All, As promised I have made a new release of esky, my auto-update framework for frozen python apps. Details below for those who are interested. Cheers, Ryan --- esky: keep frozen apps fresh Esky is an auto-update framework for frozen Python app

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-22 Thread gorauskas
I installed it on a Windows 7 machine with CPython 2.6.4 and I get the following error: Traceback (most recent call last): File "dreampie.py", line 3, in File "dreampielib\gui\__init__.pyc", line 73, in File "dreampielib\gui\load_pygtk.pyc", line 49, in load_pygtk ImportError: DLL load fai

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Alf P. Steinbach
* Paul Rubin: Steve Howell writes: My gut instinct is that functional programming works well for lots of medium sized problems and it is worth learning. I think it's worth learning because it will make you a better programmer even if you never use it for anything beyond academic exercises. I

Re: What's Going on between Python and win7?

2010-02-22 Thread Alf P. Steinbach
* W. eWatson: On 2/22/2010 8:50 PM, Alf P. Steinbach wrote: * W. eWatson: So what's the bottom line? This link notion is completely at odds with XP, Well, Windows NT has always had *hardlinks*. I found it a bit baffling that that functionality is documented as not implemented for Windows in

Re: Writing an assembler in Python

2010-02-22 Thread Tim Roberts
Paul Rubin wrote: > >Giorgos Tzampanakis writes: >> I'm implementing a CPU that will run on an FPGA. I want to have a >> (dead) simple assembler that will generate the machine code for >> me. I want to use Python for that. Are there any libraries that >> can help me with the parsing of the as

Re: When will Python go mainstream like Java?

2010-02-22 Thread Steve Howell
On Feb 22, 9:45 pm, Chris Rebert wrote: > On Mon, Feb 22, 2010 at 8:36 PM, Jonathan Gardner > > wrote: > > On Mon, Feb 22, 2010 at 1:56 PM, AON LAZIO wrote: > >> That will be superb > > > It already has. > > Indeed. Python is at position 7, just behind C#, in the TIOBE > Index:http://www.tiobe.

Re: When will Python go mainstream like Java?

2010-02-22 Thread Chris Rebert
On Mon, Feb 22, 2010 at 8:36 PM, Jonathan Gardner wrote: > On Mon, Feb 22, 2010 at 1:56 PM, AON LAZIO wrote: >> That will be superb >> > It already has. Indeed. Python is at position 7, just behind C#, in the TIOBE Index: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html Although

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Steve Howell
On Feb 22, 9:06 pm, Paul Rubin wrote: > Steve Howell writes: > > My gut instinct is that functional programming works well for lots of > > medium sized problems and it is worth learning. > > I think it's worth learning because it will make you a better programmer > even if you never use it for an

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Steve Howell
On Feb 22, 9:11 pm, Steve Howell wrote: > On Feb 22, 8:35 pm, Jonathan Gardner > wrote: > > > > > On Mon, Feb 22, 2010 at 12:31 PM, John Bokma wrote: > > > > In my class there where basically 2 groups of people: the ones who got > > > functional programming and the ones who had a hard time with

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Paul Rubin
Steve Howell writes: > My gut instinct is that functional programming works well for lots of > medium sized problems and it is worth learning. I think it's worth learning because it will make you a better programmer even if you never use it for anything beyond academic exercises. It's just like

Re: What's Going on between (Verify) Python and win7?

2010-02-22 Thread W. eWatson
Maybe someone could verify my result? open file read file line print line close file data 1234 Execute it in a folder Create another folder and copy the program to it. put in a new data file as data 4567 Execute the copied program Does it give data1234? -- http://mail.python.org/mailman/lis

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Steve Howell
On Feb 22, 8:35 pm, Jonathan Gardner wrote: > On Mon, Feb 22, 2010 at 12:31 PM, John Bokma wrote: > > > In my class there where basically 2 groups of people: the ones who got > > functional programming and the ones who had a hard time with it. The > > latter group consisted mostly of people who h

Re: MODULE FOR I, P FRAME

2010-02-22 Thread Tim Roberts
DANNY wrote: > >Yes, well beside bieng time-consuming, that is also inappropriate >for me, because I want to have clip that would be streamed across >the network and have the same GoP on the client side as the >original-because I want to see what is the effect of errors on >different GoP sizes.

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 8:50 PM, Alf P. Steinbach wrote: * W. eWatson: So what's the bottom line? This link notion is completely at odds with XP, Well, Windows NT has always had *hardlinks*. I found it a bit baffling that that functionality is documented as not implemented for Windows in the Python sta

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 8:50 PM, Alf P. Steinbach wrote: * W. eWatson: So what's the bottom line? This link notion is completely at odds with XP, Well, Windows NT has always had *hardlinks*. I found it a bit baffling that that functionality is documented as not implemented for Windows in the Python sta

Re: What's Going on between Python and win7?

2010-02-22 Thread Alf P. Steinbach
* W. eWatson: So what's the bottom line? This link notion is completely at odds with XP, Well, Windows NT has always had *hardlinks*. I found it a bit baffling that that functionality is documented as not implemented for Windows in the Python standard library. But OK, it was non-trivial to

Re: When will Python go mainstream like Java?

2010-02-22 Thread Jonathan Gardner
On Mon, Feb 22, 2010 at 1:56 PM, AON LAZIO wrote: > That will be superb > It already has. -- Jonathan Gardner jgard...@jonathangardner.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Jonathan Gardner
On Mon, Feb 22, 2010 at 12:31 PM, John Bokma wrote: > > In my class there where basically 2 groups of people: the ones who got > functional programming and the ones who had a hard time with it. The > latter group consisted mostly of people who had been programming in > languages like C and Pascal

Re: Problem creating executable, with PyQwt

2010-02-22 Thread Gib Bogle
David Boddie wrote: I have previously referred people with py2exe/PyQt issues to this page on the PyQt Wiki: http://www.py2exe.org/index.cgi/Py2exeAndPyQt If you can somehow convince py2exe to include the QtSvg module (and presumably the libQtSvg library as well) then perhaps that will solve

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 6:39 PM, David Robinow wrote: On Mon, Feb 22, 2010 at 8:25 PM, W. eWatson wrote: How do I get out of this pickle? I just want to duplicate the program in another folder, and not link to an ancestor. Ask in an appropriate forum. I'm not sure where that is but you might try http://

How to get memory and CPU status of a particular process

2010-02-22 Thread R. P. Janaka
Hi all, Is there a way to get system memory consumption and CPU consumption in a platform independent way, using python...? Basically my requirement is, get the memory status and CPU status of a particular process. If there is a way to get memory info and CPU info by just giving the process ID, t

Re: Writing an assembler in Python

2010-02-22 Thread Ed Keith
> Subject: Re: Writing an assembler in Python > Giorgos > Tzampanakis wrote: > > > I'm implementing a CPU that will run on an FPGA. I > want to have a > > (dead) simple assembler that will generate the machine > code for > > me. > > Let me suggest an alternative approach: use Python itself > as

Re: MySQLdb, blobs, and inserting

2010-02-22 Thread Lawrence D'Oliveiro
In message , Dennis Lee Bieber wrote: > Besides, the approved method of interacting with MySQLdb would use: > > c.execute("insert into items (story) values (%s)", > (file.read(), ) ) > > which lets the adapter properly escape any dangerous characters in the > data, then wrap it with any needed

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Lawrence D'Oliveiro
In message <3aa0205f-1e98-4376-92e4-607f96f13...@k19g2000yqc.googlegroups.com>, Michael Sparks wrote: > [1] This is perhaps more appropriate because '(a b c) is equivalent > to (quote a b c), and quote a b c can be viewed as close to > python's expression "lambda: a b c" You got to be k

Re: Writing an assembler in Python

2010-02-22 Thread Lawrence D'Oliveiro
In message , Giorgos Tzampanakis wrote: > I'm implementing a CPU that will run on an FPGA. I want to have a > (dead) simple assembler that will generate the machine code for > me. Let me suggest an alternative approach: use Python itself as the assembler. Call routines in your library to output

Re: Writing an assembler in Python

2010-02-22 Thread Paul Rubin
Giorgos Tzampanakis writes: > I'm implementing a CPU that will run on an FPGA. I want to have a > (dead) simple assembler that will generate the machine code for > me. I want to use Python for that. Are there any libraries that > can help me with the parsing of the assembly code? One "dead si

Re: What's Going on between Python and win7?

2010-02-22 Thread David Robinow
On Mon, Feb 22, 2010 at 8:25 PM, W. eWatson wrote: > How do I get out of this pickle? I just want to duplicate the  program in > another folder, and not link to an ancestor. Ask in an appropriate forum. I'm not sure where that is but you might try http://www.sevenforums.com/ -- http://mail.python

Re: How to transmit a crash report ?

2010-02-22 Thread MRAB
Stef Mientki wrote: hello, in my python desktop applications, I'ld like to implement a crash reporter. By redirecting the sys.excepthook, I can detect a crash and collect the necessary data. Now I want that my users sends this information to me, and I can't find a good way of doing this. The fo

Writing an assembler in Python

2010-02-22 Thread Giorgos Tzampanakis
I'm implementing a CPU that will run on an FPGA. I want to have a (dead) simple assembler that will generate the machine code for me. I want to use Python for that. Are there any libraries that can help me with the parsing of the assembly code? -- http://mail.python.org/mailman/listinfo/python

Re: The future of "frozen" types as the number of CPU cores increases

2010-02-22 Thread John Nagle
sjdevn...@yahoo.com wrote: On Feb 20, 9:58 pm, John Nagle wrote: sjdevn...@yahoo.com wrote: On Feb 18, 2:58 pm, John Nagle wrote: Multiple processes are not the answer. That means loading multiple copies of the same code into different areas of memory. The cache miss rate goes up accor

How to transmit a crash report ?

2010-02-22 Thread Stef Mientki
hello, in my python desktop applications, I'ld like to implement a crash reporter. By redirecting the sys.excepthook, I can detect a crash and collect the necessary data. Now I want that my users sends this information to me, and I can't find a good way of doing this. The following solutions cam

Re: When will Python go mainstream like Java?

2010-02-22 Thread Shawn Milochik
When will Java be popular enough to replace other languages in their own environments, the way Python has done to Java (Jython) and .NET (IronPython)? Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
So what's the bottom line? This link notion is completely at odds with XP, and produces what I would call something of a mess to the unwary Python/W7 user. Is there a simple solution? How do I get out of this pickle? I just want to duplicate the program in another folder, and not link to an a

Re: MODULE FOR I, P FRAME

2010-02-22 Thread Rhodri James
On Mon, 22 Feb 2010 10:48:55 -, DANNY wrote: On Feb 21, 1:54 am, Tim Roberts wrote: DANNY wrote: >If I want to have a MPEG-4/10 coded video and stream it through the >network and than have the same video on the client side, what should I >use and of course I don't want to have raw MPEG

Re: When will Python go mainstream like Java?

2010-02-22 Thread Edward A. Falk
You mean it's not? -- -Ed Falk, f...@despams.r.us.com http://thespamdiaries.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I make sqlite3 or shelve work reliably on any Win/Linux/Mac?

2010-02-22 Thread Alex Quinn
Thanks for the reply, Jonathan, but I was hoping to find a workaround. I don't have root access for these machines so I can't repair the install. Among the 6 Linux servers at 3 separately managed organizations where I do work, the sqlite3 module was broken 100% of the time. It seems to be a c

Re: When will Python go mainstream like Java?

2010-02-22 Thread Phlip
On Feb 22, 3:27 pm, Krister Svanlund wrote: > And when will be as famous as the Beatles? And when will http://mail.python.org/mailman/listinfo/python-list

Re: Efficiently building ordered dict

2010-02-22 Thread John Posner
On 2/22/2010 4:29 PM, Bryan wrote: Sorry about the sorted != ordered mix up. I want to end up with a *sorted* dict from an unordered list. *Sorting the list is not practical in this case.* I am using python 2.5, with an ActiveState recipe for an OrderedDict. Have you looked at this: htt

Re: Efficiently building ordered dict

2010-02-22 Thread Bryan
On Feb 22, 3:00 pm, "Diez B. Roggisch" wrote: > Am 22.02.10 23:48, schrieb Bryan: > > > > > On Feb 22, 2:16 pm, "Diez B. Roggisch"  wrote: > >> Am 22.02.10 22:29, schrieb Bryan: > > >>> On Feb 22, 10:57 am, "Alf P. Steinbach"    wrote: > * Bryan: > > > I am looping through a list and crea

Re: When will Python go mainstream like Java?

2010-02-22 Thread Krister Svanlund
On Mon, Feb 22, 2010 at 10:56 PM, AON LAZIO wrote: > That will be superb > > -- > Passion is my style And when will be as famous as the beatles? -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Paul Rubin
John Bokma writes: > In my class there where basically 2 groups of people: the ones who got > functional programming and the ones who had a hard time with it. The > latter group consisted mostly of people who had been programming in > languages like C and Pascal for years; they had a hard time thi

Re: What's Going on between Python and win7?

2010-02-22 Thread Lawrence D'Oliveiro
In message <873a0tszco@castleamber.com>, John Bokma wrote: > According to http://msdn.microsoft.com/en-us/library/aa365006(VS.85).aspx > > There are three types of file links supported in the NTFS file > system: hard links, junctions, and symbolic links. This topic is an > overvie

Re: Efficiently building ordered dict

2010-02-22 Thread MRAB
Bryan wrote: On Feb 22, 2:16 pm, "Diez B. Roggisch" wrote: Am 22.02.10 22:29, schrieb Bryan: On Feb 22, 10:57 am, "Alf P. Steinbach" wrote: * Bryan: I am looping through a list and creating a regular dictionary. From that dict, I create an ordered dict. I can't think of a way to build

Re: What's Going on between Python and win7?

2010-02-22 Thread Lawrence D'Oliveiro
In message , MRAB wrote: > Not Python-related. Seems to be pretty common with Windows-related complaints in this group. -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Lawrence D'Oliveiro
In message <1ecc71bf-54ab-45e6-a38a-d1861f092...@v25g2000yqk.googlegroups.com>, sjdevn...@yahoo.com wrote: > On Feb 20, 1:30 am, Lawrence D'Oliveiro > wrote: > >> In message , Rhodri James wrote: >> >> > In classic Pascal, a procedure was distinct from a function in that it >> > had no return v

Re: Efficiently building ordered dict

2010-02-22 Thread Diez B. Roggisch
Am 22.02.10 23:48, schrieb Bryan: On Feb 22, 2:16 pm, "Diez B. Roggisch" wrote: Am 22.02.10 22:29, schrieb Bryan: On Feb 22, 10:57 am, "Alf P. Steinbach"wrote: * Bryan: I am looping through a list and creating a regular dictionary. From that dict, I create an ordered dict. I can't

Re: Efficiently building ordered dict

2010-02-22 Thread Bryan
On Feb 22, 2:16 pm, "Diez B. Roggisch" wrote: > Am 22.02.10 22:29, schrieb Bryan: > > > > > On Feb 22, 10:57 am, "Alf P. Steinbach"  wrote: > >> * Bryan: > > >>> I am looping through a list and creating a regular dictionary.  From > >>> that dict, I create an ordered dict.  I can't think of a way

Re: What's Going on between Python and win7?

2010-02-22 Thread Grant Edwards
On 2010-02-22, John Bokma wrote: > Grant Edwards writes: Windows 7 has symbolic links? >>> >>>Symbolic links are designed to aid in migration and application >>>compatibility with UNIX operating systems. Microsoft has implemented >>>its symbolic links to function just like UNIX

Re: Efficiently building ordered dict

2010-02-22 Thread Diez B. Roggisch
Am 22.02.10 22:29, schrieb Bryan: On Feb 22, 10:57 am, "Alf P. Steinbach" wrote: * Bryan: I am looping through a list and creating a regular dictionary. From that dict, I create an ordered dict. I can't think of a way to build the ordered dict while going through the original loop. Is th

Re: What's Going on between Python and win7?

2010-02-22 Thread Gib Bogle
John Bokma wrote: Gib Bogle writes: MRAB wrote: W. eWatson wrote: Last night I copied a program from folder A to folder B. It inspects the contents of files in a folder. When I ran it in B, it gave the results for A! Out of frustration I changed the name in A, and fired up the program in B.

Re: Efficiently building ordered dict

2010-02-22 Thread Arnaud Delobelle
On 22 Feb, 21:29, Bryan wrote: > Sorry about the sorted != ordered mix up.  I want to end up with a > *sorted* dict from an unordered list.  *Sorting the list is not > practical in this case.*  I am using python 2.5, with an ActiveState > recipe for an OrderedDict. Why does the dict need to be so

Re: What's Going on between Python and win7?

2010-02-22 Thread John Bokma
Grant Edwards writes: > On 2010-02-22, John Bokma wrote: >> Gib Bogle writes: >> >>> MRAB wrote: W. eWatson wrote: > Last night I copied a program from folder A to folder B. It > inspects the contents of files in a folder. When I ran it in B, it > gave the results for A! Out of

When will Python go mainstream like Java?

2010-02-22 Thread AON LAZIO
That will be superb -- Passion is my style -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficiently building ordered dict

2010-02-22 Thread Bryan
On Feb 22, 10:57 am, "Alf P. Steinbach" wrote: > * Bryan: > > > > > I am looping through a list and creating a regular dictionary.  From > > that dict, I create an ordered dict.  I can't think of a way to build > > the ordered dict while going through the original loop.  Is there a > > way I can a

Re: What's Going on between Python and win7?

2010-02-22 Thread Grant Edwards
On 2010-02-22, John Bokma wrote: > Gib Bogle writes: > >> MRAB wrote: >>> W. eWatson wrote: Last night I copied a program from folder A to folder B. It inspects the contents of files in a folder. When I ran it in B, it gave the results for A! Out of frustration I changed the name i

Re: ANN: Python-SIMPL v2.0.0 released

2010-02-22 Thread bobicanprogram
On Feb 22, 9:40 am, bobicanprogram wrote: > The SIMPL project (http://www.icanprogram.com/simpl) aims to bring the > Send/Receive/Reply messaging (first popularized by QNX) to the open > source Linux world. Since its inception more that 10 years ago, the > SIMPL toolkit has grown steadily in fu

Re: What's Going on between Python and win7?

2010-02-22 Thread John Bokma
Gib Bogle writes: > MRAB wrote: >> W. eWatson wrote: >>> Last night I copied a program from folder A to folder B. It >>> inspects the contents of files in a folder. When I ran it in B, it >>> gave the results for A! Out of frustration I changed the name in A, >>> and fired up the program in B. Wi

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread John Bokma
Jonathan Gardner writes: > On Sun, Feb 21, 2010 at 10:22 AM, John Bokma wrote: >> Jonathan Gardner writes: >>> On Fri, Feb 19, 2010 at 11:16 PM, Lie Ryan wrote: Now, why don't we start a PEP to make python a fully-functional language then? >>> >>> Because people don't think the

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Paul Rubin
Jonathan Gardner writes: > I won't deny that really smart people enjoy the challenge of > programming in a functional style, and some even find it easier to > work with. However, when it comes to readability and maintenance, I > appreciate the statement-based programming style, simply because it's

Re: What's Going on between Python and win7?

2010-02-22 Thread Gib Bogle
MRAB wrote: W. eWatson wrote: Last night I copied a program from folder A to folder B. It inspects the contents of files in a folder. When I ran it in B, it gave the results for A! Out of frustration I changed the name in A, and fired up the program in B. Win7 went into search mode for the fil

GUI app on Windows for WMI digging

2010-02-22 Thread Ravi Kumar
Hi, I am working on an application, which retrieves Windows system info (Hardware / Software / Drivers / OS) and write to an xml. For the GUI, I selected PyQT4, and for system info using WMI, I am using WMI Package (http://timgolden.me.uk/python/wmi/index.html) and popular pywin32. To package the

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-22 Thread Jonathan Gardner
On Sun, Feb 21, 2010 at 10:22 AM, John Bokma wrote: > Jonathan Gardner writes: >> On Fri, Feb 19, 2010 at 11:16 PM, Lie Ryan wrote: >>> >>> Now, why don't we start a PEP to make python a fully-functional language >>> then? >> >> Because people don't think the same way that programs are written i

Re: Use eval() safely?

2010-02-22 Thread Jonathan Gardner
On Sun, Feb 21, 2010 at 1:25 PM, W. Martin Borgert wrote: > > I know that this issue has been discussed before, but most of > the time using only one argument to eval(). > > Is it possible to use the following code, e.g. run as part of a > web application, to break in and if so, how? > > import ma

Re: Can I make sqlite3 or shelve work reliably on any Win/Linux/Mac?

2010-02-22 Thread Jonathan Gardner
On Mon, Feb 22, 2010 at 9:10 AM, Alex Quinn wrote: > > * Sqlite3 should fill the void now.  However, in my experience, nearly every > Linux Python install I encounter has a broken sqlite3 module ("ImportError: > No module named _sqlite3"). It's a well-documented issue, but it the solution > gen

Re: formatting a number as percentage

2010-02-22 Thread Hans Mulder
Günther Dietrich wrote: vsoler wrote: I'm trying to print .7 as 70% I've tried: print format(.7,'%%') .7.format('%%') but neither works. I don't know what the syntax is... Did you try this: print('%d%%' % (0.7 * 100)) 70% That method will always round down; TomF's method will round to

Re: Efficiently building ordered dict

2010-02-22 Thread Alf P. Steinbach
* Bryan: I am looping through a list and creating a regular dictionary. From that dict, I create an ordered dict. I can't think of a way to build the ordered dict while going through the original loop. Is there a way I can avoid creating the first unordered dict just to get the ordered dict?

Re: Python won't run

2010-02-22 Thread Sridhar Ratnakumar
Have you tried using http://dependencywalker.com/ ? -srid On 2010-02-18, at 1:00 PM, Nardin, Cory L. wrote: > Quickly, I have a Mac Intel with Windows XP installed. Tried installing > Python 2.6.4 from the binary and also ActivePython 2.6.4.10. Both > installations acted the same. There see

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 8:29 AM, Grant Edwards wrote: On 2010-02-22, W. eWatson wrote: Last night I copied a program from folder A to folder B. [tail of various windows breakages elided] Comments? Switch to Linux? Or at least install Cygwin? Yes, definitely not related, but maybe some W7 user has

Re: Efficiently building ordered dict

2010-02-22 Thread Mark Lawrence
Bryan wrote: On Feb 22, 9:19 am, MRAB wrote: Bryan wrote: I am looping through a list and creating a regular dictionary. From that dict, I create an ordered dict. I can't think of a way to build the ordered dict while going through the original loop. Is there a way I can avoid creating the

Re: Efficiently building ordered dict

2010-02-22 Thread Arnaud Delobelle
Bryan writes: > I am looping through a list and creating a regular dictionary. From > that dict, I create an ordered dict. I can't think of a way to build > the ordered dict while going through the original loop. Is there a > way I can avoid creating the first unordered dict just to get the >

Re: Efficiently building ordered dict

2010-02-22 Thread MRAB
Bryan wrote: On Feb 22, 9:19 am, MRAB wrote: Bryan wrote: I am looping through a list and creating a regular dictionary. From that dict, I create an ordered dict. I can't think of a way to build the ordered dict while going through the original loop. Is there a way I can avoid creating the

Re: Starting with Classes - basic problem

2010-02-22 Thread barryjogorman
On Feb 22, 5:33 pm, Bernard Czenkusz wrote: > On Mon, 22 Feb 2010 09:26:18 -0800, barryjogorman wrote: > >HAVE THE FOLLOWING VERY BASIC PROGRAM: > > >class Person: > >    def _init_(self,name, job=None, pay=0): > >        self.name=name > >        self.job=job > >        self.pay=pay > > >bob = Pe

Re: How to measure elapsed time under Windows?

2010-02-22 Thread Grant Edwards
On 2010-02-22, Albert van der Horst wrote: > In article <87404349-5d3a-4396-aeff-60edc14a5...@f8g2000yqn.googlegroups.com>, >>Gabriel Genellina reports that time.clock() uses Windows' >>QueryPerformanceCounter() API, which has much higher resolution >>than the task switcher's 15ms. QueryPerforma

Re: Starting with Classes - basic problem

2010-02-22 Thread MRAB
barryjogorman wrote: HAVE THE FOLLOWING VERY BASIC PROGRAM: class Person: def _init_(self,name, job=None, pay=0): self.name=name self.job=job self.pay=pay bob = Person('Bob Smith') sue = Person('Sue Jones', job='dev', pay = 10) print(bob.name, bob.pay) print(sue.

Re: Starting with Classes - basic problem

2010-02-22 Thread alex goretoy
you need to define init with two underscores, I've made that mistake myself long long time ago :) def __init__ not def _init_ -Alex Goretoy -- http://mail.python.org/mailman/listinfo/python-list

Re: Starting with Classes - basic problem

2010-02-22 Thread Bernard Czenkusz
On Mon, 22 Feb 2010 09:26:18 -0800, barryjogorman wrote: > HAVE THE FOLLOWING VERY BASIC PROGRAM: > > class Person: > def _init_(self,name, job=None, pay=0): > self.name=name > self.job=job > self.pay=pay > > bob = Person('Bob Smith') > sue = Person('Sue Jones', job='

Re: Bizarre arithmetic results

2010-02-22 Thread Albert van der Horst
In article , Terrence Cole wrote: >Can someone explain to me what python is doing here? > >Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47) >[GCC 4.3.4] on linux2 >Type "help", "copyright", "credits" or "license" for more information. -0.1 ** 0.1 Python 4.0 Warning: misleading blank space,

Re: How to measure elapsed time under Windows?

2010-02-22 Thread Albert van der Horst
In article <87404349-5d3a-4396-aeff-60edc14a5...@f8g2000yqn.googlegroups.com>, Paul McGuire wrote: >On Feb 10, 2:24=A0am, Dennis Lee Bieber wrote: >> On Tue, 9 Feb 2010 21:45:38 + (UTC), Grant Edwards >> declaimed the following in >> gmane.comp.python.general: >> >> > Doesn't work. =A0datet

Re: Efficiently building ordered dict

2010-02-22 Thread Bryan
On Feb 22, 9:19 am, MRAB wrote: > Bryan wrote: > > I am looping through a list and creating a regular dictionary.  From > > that dict, I create an ordered dict.  I can't think of a way to build > > the ordered dict while going through the original loop.  Is there a > > way I can avoid creating the

Starting with Classes - basic problem

2010-02-22 Thread barryjogorman
HAVE THE FOLLOWING VERY BASIC PROGRAM: class Person: def _init_(self,name, job=None, pay=0): self.name=name self.job=job self.pay=pay bob = Person('Bob Smith') sue = Person('Sue Jones', job='dev', pay = 10) print(bob.name, bob.pay) print(sue.name, sue.pay) I am ge

Re: Efficiently building ordered dict

2010-02-22 Thread MRAB
Bryan wrote: I am looping through a list and creating a regular dictionary. From that dict, I create an ordered dict. I can't think of a way to build the ordered dict while going through the original loop. Is there a way I can avoid creating the first unordered dict just to get the ordered dic

Re: Reading a large bz2 textfile exits early

2010-02-22 Thread Stefan Behnel
Lie Ryan, 22.02.2010 14:29: > On 02/22/10 19:43, Norman Rieß wrote: >> Am 02/22/10 09:02, schrieb Steven D'Aprano: >>> On Mon, 22 Feb 2010 07:49:51 +0100, Norman Rieß wrote: >>> >>> This is the actual code: source_file = bz2.BZ2File(file, "r") for line in source_file:

Re: Files required for porting python

2010-02-22 Thread Kiran K
I will try to provide the API's on windows that my RTOS provides ex. If my RTOS has "fosCreateSemaphore" to create a semaphore I will implement the same API [ same function prototype] on windows using win32 CreateSemaphore. Similarly I will write a wrapper functions for accesing file system, task m

Can I make sqlite3 or shelve work reliably on any Win/Linux/Mac?

2010-02-22 Thread Alex Quinn
Is there a way to have some kind of database (i.e. sqlite3, bsddb, dbm, etc.) that works out of the box on any Win/Linux/Mac machine with Python 2.6+ or 3.x? It's okay if the file format is different between machines, but I want my script to work without having to install anything. Problems wit

Re: Efficiently building ordered dict

2010-02-22 Thread Daniel Stutzbach
On Mon, Feb 22, 2010 at 10:32 AM, Bryan wrote: > unorderedDict = {} > for thing in unorderedList: >if thing.id in unorderedDict: >UpdateExistingValue(unorderedDict[thing.id]) >else: >CreateNewValue(unorderedDict[thing.id]) > > orderedDict = OrderedD

Re: Files required for porting python

2010-02-22 Thread Shashwat Anand
what do you exactly mean by "port python on to windows" ? Are you talking about your application or python itself :-/ ~l0nwlf On Mon, Feb 22, 2010 at 10:23 PM, KIRAN wrote: > Hi ALL, > > I am newbie to python and wanted to port python on to some RTOS. The > RTOS I am trying to port python is no

Re: Efficiently building ordered dict

2010-02-22 Thread Shashwat Anand
OrderedDict is a class in collection module in python 2.7a3+. Perhaps you can use it from there. >>> dir(collections) ['Callable', 'Container', 'Counter', 'Hashable', 'ItemsView', 'Iterable', 'Iterator', 'KeysView', 'Mapping', 'MappingView', 'MutableMapping', 'MutableSequence', 'MutableSet', 'Orde

Files required for porting python

2010-02-22 Thread KIRAN
Hi ALL, I am newbie to python and wanted to port python on to some RTOS. The RTOS I am trying to port python is not posix compliant. First, I decided to port python on to windows and later I will port the same to my target system. [ This is just to minimize the effort being put port, debug and to

Re: What's Going on between Python and win7?

2010-02-22 Thread Shashwat Anand
Programming is most fruiful in *nix environment. On Mon, Feb 22, 2010 at 9:59 PM, Grant Edwards wrote: > On 2010-02-22, W. eWatson wrote: > > > Last night I copied a program from folder A to folder B. > > [tail of various windows breakages elided] > > > Comments? > > Switch to Linux? > > Or at l

Re: A tool for find dependencies relationships behind Python projects

2010-02-22 Thread Shashwat Anand
Same issue here, easy_install fails here is traceback, Shashwat-Anands-MacBook-Pro:Downloads l0nwlf$ easy_install gluttony Searching for gluttony Reading http://pypi.python.org/simple/gluttony/ Reading http://code.google.com/p/python-gluttony/ Best match: Gluttony 0.3 Downloading http://pypi.pytho

  1   2   >