Re: Attack a sacred Python Cow

2008-07-25 Thread Colin J. Williams
Fuzzyman wrote: On Jul 24, 6:41 am, Jordan <[EMAIL PROTECTED]> wrote: Hi everyone, I'm a big Python fan who used to be involved semi regularly in comp.lang.python (lots of lurking, occasional posting) but kind of trailed off a bit. I just wrote a frustration inspired rant on my blog, and I thou

DBUS/HAL Manager Interface Help

2008-07-25 Thread Casey McGinty
Can someone explain to me why this sample code does not work? I am trying to test if a device exists. dbus_test.py -- import dbus bus = dbus.SystemBus() proxy = bus.get_object( 'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager' ) manager = dbus.Interfa

How to close all python-opened file identifiers?

2008-07-25 Thread BAnderton
Greetings from beautiful Tucson, Arizona. Question: Is there a way in Python to determine what all file identifiers have been opened by Python, and to close them all? Why I ask: I learned Python after cutting my programming teeth on Matlab, where you get a list of all open file identifiers (tha

Porting python to C++

2008-07-25 Thread David York
Hello, I'm a longtime lurker of python-list, python-C++ and a couple of others. I have a commercial project being prototyped in Python, brought to a very fine level of completion and which needs to be ported to C++. I would like to outsource this project - does anybody have any experience with Py

Re: SimpleJson is slow .... is there any C Compiled version ?

2008-07-25 Thread Matt Nordhoff
sanket wrote: > Hello All, > > I have created an API which fetches some data from the database. > I am using simplejson to encode it and return it back. > > Now the problem is that, this API is being called for millions of > times in a sequence. > I ran a profiler and saw that most of the time is

print doesn't respect file inheritance?

2008-07-25 Thread bukzor
I was trying to change the behaviour of print (tee all output to a temp file) by inheriting from file and overwriting sys.stdout, but it looks like print uses C-level stuff to do its writes which bypasses the python object/inhertiance system. It looks like I need to use composition instead of inhe

Re: How to find processes from Python

2008-07-25 Thread Cameron Simpson
On 25Jul2008 11:34, Johny <[EMAIL PROTECTED]> wrote: | Is there a way how to find out running processes?E.g. how many | Appache's processes are running? See the popen function and use the "ps" system command. -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ Whe

Re: Attack a sacred Python Cow

2008-07-25 Thread Jordan
Well this discussion is chugging along merrily now under its own steam, but as the OP I should probably clarify a few things about my own views since people continue to respond to them (and are in some cases misunderstanding me.) I *like* explicit self for instance variable access. There are argum

Re: SimpleJson is slow .... is there any C Compiled version ?

2008-07-25 Thread sanket
On Jul 25, 5:52 pm, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > sanket wrote: > > Hello All, > > > I have created an API which fetches some data from the database. > > I am using simplejson to encode it and return it back. > > > Now the problem is that, this API is being called for millions of > > t

Re: How to find processes from Python

2008-07-25 Thread Gary Josack
Cameron Simpson wrote: On 25Jul2008 11:34, Johny <[EMAIL PROTECTED]> wrote: | Is there a way how to find out running processes?E.g. how many | Appache's processes are running? See the popen function and use the "ps" system command. Use of the popen functions is generally discouraged since be

Re: Attack a sacred Python Cow

2008-07-25 Thread Terry Reedy
Paul Boddie wrote: On 25 Jul, 22:37, Terry Reedy <[EMAIL PROTECTED]> wrote: Kay Schluehr wrote: This isn't the problem Jordan tries to address. It's really just about `self` in the argument signature of f, not about its omission in the body. That is not at all how I read him, so I will let h

binding names doesn't affect the bound objects (was: print doesn't respect file inheritance?)

2008-07-25 Thread Ben Finney
bukzor <[EMAIL PROTECTED]> writes: > I was trying to change the behaviour of print (tee all output to a > temp file) by inheriting from file and overwriting sys.stdout That's not what your code does, though. > def main(): > n = notafile('/dev/stdout', "w") Creates a new instance of the 'not

Re: print doesn't respect file inheritance?

2008-07-25 Thread Terry Reedy
bukzor wrote: I was trying to change the behaviour of print (tee all output to a temp file) by inheriting from file and overwriting sys.stdout, but it looks like print uses C-level stuff to do its writes which bypasses the python object/inhertiance system. It looks like I need to use compositi

Re: 2d graphics - what module to use?

2008-07-25 Thread Matthew Fitzgibbons
sturlamolden wrote: On Jul 25, 8:13 am, Pierre Dagenais <[EMAIL PROTECTED]> wrote: What is the easiest way to draw to a window? I'd like to draw something like sine waves from a mathematical equation. Newbie to python. For mathematica equations, NumPy and matplotlib is probably the best opti

Re: Attack a sacred Python Cow

2008-07-25 Thread Matthew Fitzgibbons
Jordan wrote: Well this discussion is chugging along merrily now under its own steam, but as the OP I should probably clarify a few things about my own views since people continue to respond to them (and are in some cases misunderstanding me.) I *like* explicit self for instance variable access.

xml.dom's weirdness?

2008-07-25 Thread Lie
Why this generates AttributeError, then not? Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import xml >>> xml.dom Traceback (most recent call last): File "", line 1, in At

Re: 2d graphics - what module to use?

2008-07-25 Thread Carl Banks
On Jul 25, 4:10 am, King <[EMAIL PROTECTED]> wrote: > Use python's default GUI tkinter's drawing functions or you can use > wxPython GUI kit or you can use pyopengl. > If you are only interested to draw sin waves or math functions that > you should give try to matlab atwww.mathworks.com If you're

u just click u get some dollars

2008-07-25 Thread abcd
http://www.parttimejobsu.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

<    1   2