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

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

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

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

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

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

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

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

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

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

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

tcp socket problem

2008-07-25 Thread jm . carp
I'm writing a tcp client that grabs data from a server at 32hz. But the connection drops exactly one minute after it's opened. I can get data from the server fine for the first 60s, and then the connection goes dead. What's going on? -- http://mail.python.org/mailman/listinfo/python-list

Re: Function editing with Vim throws IndentError

2008-07-25 Thread Matimus
On Jul 24, 9:32 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, Matimus > wrote: > > > On Jul 24, 2:54 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] > > central.gen.new_zealand> wrote: > >> In message > >> <[EMAIL PROTECTED]>, > > >> Matim

An Attempt to download and install traits - to a Windows XP

2008-07-25 Thread Colin J. Williams
Using >easy_install -v -f http://code.enthought.com/enstaller/eggs/source enthought.traits The result is: ... many lines ... copying enthought\traits\ui\tests\shell_editor_test.py -> build\lib.win32-2.5\enthought\traits\ui\tests copying enthought\traits\ui\tests\table_editor_color_test.

Re: Attack a sacred Python Cow

2008-07-25 Thread Paul Boddie
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 him r

Re: Histogram of floating point values.

2008-07-25 Thread Kurt Smith
On Fri, Jul 25, 2008 at 5:02 PM, aditya shukla <[EMAIL PROTECTED]> wrote: > Hello folks, > > I have a list say > > data=[0.99,0.98,0.98,0.98,0.97,0.93,0.92,0.92,0.83,0.66,0.50,0.50] > > i am trying to plot histogram of these values > > i have installed numpy and matplotlib and this is what i am do

Re: Histogram of floating point values.

2008-07-25 Thread Terry Reedy
aditya shukla wrote: Hello folks, I have a list say data=[0.99,0.98,0.98,0.98,0.97,0.93,0.92,0.92,0.83,0.66,0.50,0.50] i am trying to plot histogram of these values i have installed numpy and matplotlib and this is what i am doing* import numpy import pylab from numpy import * from pyl

Re: Attack a sacred Python Cow

2008-07-25 Thread Fuzzyman
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 thought it w

Re: Quesion on class.attributes assignment

2008-07-25 Thread Terry Reedy
John Hanks wrote: Hi, I am reading a python program now but I just cannot understand how the values of class attributes are assigned and changed. Here is the original code url: http://agolb.blogspot.com/2006/01/sudoku-solver-in-python.html Here I am concerned is how attribute matrix.rows is

Histogram of floating point values.

2008-07-25 Thread aditya shukla
Hello folks, I have a list say data=[0.99,0.98,0.98,0.98,0.97,0.93,0.92,0.92,0.83,0.66,0.50,0.50] i am trying to plot histogram of these values i have installed numpy and matplotlib and this is what i am doing* import numpy import pylab from numpy import * from pylab import * input_hist=a

Re: Calling external program from within python

2008-07-25 Thread Terry Reedy
Michael Tobis wrote: For some reason os.popen is deprecated in favor of the more verbose subprocess.Popen, but this will work for a while. As explained in http://www.python.org/dev/peps/pep-0324/ subprocess consolidated replaced several modules and functions (popen*, system, spawn*, ???)wit

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

2008-07-25 Thread sanket
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 consumed in encoding my datab

Easier way to get the "here" path?

2008-07-25 Thread bukzor
I have to go into these convulsions to get the directory that the script is in whenever I need to use relative paths. I was wondering if you guys have a better way: from os.path import dirname, realpath, abspath here = dirname(realpath(abspath(__file__.rstrip("c" In particular, this takes car

Re: Execution speed question

2008-07-25 Thread Terry Reedy
Suresh Pillai wrote: I am performing simulations on networks (graphs). I have a question on speed of execution (assuming very ample memory for now). I simplify the details of my simulation below, as the question I ask applies more generally than my specific case. I would greatly appreciate

Re: Attack a sacred Python Cow

2008-07-25 Thread Terry Reedy
Nikolaus Rath wrote: Terry Reedy <[EMAIL PROTECTED]> writes: Torsten Bronger wrote: Hallöchen! > And why does this make the implicit insertion of "self" difficult? I could easily write a preprocessor which does it after all. class C(): def f(): a = 3 Inserting self into the arg lis

Re: Attack a sacred Python Cow

2008-07-25 Thread Terry Reedy
Kay Schluehr wrote: On 25 Jul., 03:01, Terry Reedy <[EMAIL PROTECTED]> wrote: Inserting self into the arg list is trivial. Mindlessly deciding correctly whether or not to insert 'self.' before 'a' is impossible when 'a' could ambiguously be either an attribute of self or a local variable of f

Re: 2d graphics - what module to use?

2008-07-25 Thread sturlamolden
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 option. I prefer to em

Re: Python program as daemon?

2008-07-25 Thread sturlamolden
On Jul 25, 8:37 pm, Johny <[EMAIL PROTECTED]> wrote: > Is it possible to run a Python program as daemon? > Thanks Here is an example on how to run a Python script as a Unix daemon: http://svn.plone.org/svn/collective/bda.daemon/trunk/bda/daemon/daemon.py Basically it forks twice and redirects op

Re: How to figure out if the platform is 32bit or 64bit?

2008-07-25 Thread Trent Mick
norseman wrote: > > I need to know if I'm running on 32bit or 64bit ... so far I haven't > > come up with how to get this info via python. sys.platform returns > > what python was built on ... but not what the current system is. > > > > I thought platform.uname() or just platform.processor(

Re: Python program as daemon?

2008-07-25 Thread Brett g Porter
Johny wrote: Is it possible to run a Python program as daemon? Sure -- see http://code.activestate.com/recipes/66012/ for an example (and some useful stuff in the comments.) -- http://mail.python.org/mailman/listinfo/python-list

Quesion on class.attributes assignment

2008-07-25 Thread John Hanks
Hi, I am reading a python program now but I just cannot understand how the values of class attributes are assigned and changed. Here is the original code url: http://agolb.blogspot.com/2006/01/sudoku-solver-in-python.html Here I am concerned is how attribute matrix.rows is changed. Through pdb deb

Re: Python program as daemon?

2008-07-25 Thread Sebastian "lunar" Wiesner
Johny <[EMAIL PROTECTED]>: > Is it possible to run a Python program as daemon? You can write daemons in basically any language out there. -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailman/listinfo/python-list

Histogram and \lambda parameter of the laplacian curve.

2008-07-25 Thread aditya shukla
Thanks everyone for your earlier help. I have to plot a histogram of values lets say [0.5,0.6,0.8,0.9].I guess the histogram would show an exponential decay ie, the laplacian curve. I need to find the \lambda parameter of this curve . So please tell me if it be done through http://matplotlib.so

Python program as daemon?

2008-07-25 Thread Johny
Is it possible to run a Python program as daemon? Thanks -- http://mail.python.org/mailman/listinfo/python-list

How to find processes from Python

2008-07-25 Thread Johny
Is there a way how to find out running processes?E.g. how many Appache's processes are running? Thanks for help. BB. -- http://mail.python.org/mailman/listinfo/python-list

Re: interpreter vs. compiled

2008-07-25 Thread John Nagle
Tim Roberts wrote: And I'm saying you are wrong. There is NOTHING inherent in Python that dictates that it be either compiled or interpreted. That is simply an implementation decision. The CPython implementation happens to interpret. The IronPython implementation compiles the intermediate lang

Re: calling source command within python

2008-07-25 Thread Glenn Hutchings
Jie <[EMAIL PROTECTED]> writes: > i'm having trouble executing os.system('source .bashrc') command > within python, it always says that source not found and stuff. Any > clue? There's no 'source' program; it's a shell builtin. Even if there was, it almost certainly wouldn't do what you want. The

Re: POP3 - Using poplib only shows the first few hundred messages in the mailbox

2008-07-25 Thread MRAB
On Jul 25, 1:18 pm, SteveC <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to use POP3_SSL class of the poplib module to read email > from my gmail account.  I can connect just fine using the example > herehttp://www.python.org/doc/lib/pop3-example.html > > import getpass, poplib > > M = popli

Re: object persistency, store instances relationship externally

2008-07-25 Thread King
Thanks Fredrik, It helped a lot and this is really an amazing this I have discovered today. :-)) -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling external program from within python

2008-07-25 Thread Grant Edwards
On 2008-07-25, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Because usually if a program *prompts* the user to enter input (and that > was what I read from the OP's post), one has to deal with pseudo > terminals, not with stdin/out. > >>> If interaction is required, the OP might consider using

Trouble with rpdb2 and winpdb debuggers in embedded Python script

2008-07-25 Thread Matthew Severin
Having some trouble getting rpdb2 and winpdb running properly with Python embedded in a C++ project. Our implementation has a number of C++ classes associated with Python classes. I am able to attach to the embedded script with the debugger and the program freezes and waits. However, when I step

Re: POP3 - Using poplib only shows the first few hundred messages in the mailbox

2008-07-25 Thread Timothy Grant
On Fri, Jul 25, 2008 at 5:18 AM, SteveC <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to use POP3_SSL class of the poplib module to read email > from my gmail account. I can connect just fine using the example here > http://www.python.org/doc/lib/pop3-example.html > > import getpass, poplib

Re: Calling external program from within python

2008-07-25 Thread Michael Tobis
These answers are too elaborate and abstract for the question. Emmanouil, Here is a program "myprog" which takes input and writes output to a file. It happens to be python but it could be anything. # #!/usr/bin/env python a = int(raw_input("enter thing 1 ")) b = int(raw_input("enter thing 2

Re: Question Regarding XML

2008-07-25 Thread Diez B. Roggisch
SUBHABRATA schrieb: Dear Group, I have some queries regarding XML conversion of some .txt/.doc files. I am thinking to use Satine. Is it OK? But it seems to support Python2.3 but does it support 2.5, too? If any one can kindly let me know. I think it's pretty dead, given the project news dating

Re: Calling external program from within python

2008-07-25 Thread Diez B. Roggisch
Mike Driscoll schrieb: On Jul 25, 9:28 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: Mike Driscoll schrieb: On Jul 25, 7:56 am, Emmanouil Angelakis <[EMAIL PROTECTED]> wrote: Hi, I am tryiong to do something obviously trivial such as: I have a c program called "tsys2list" that when it is

Re: Execution speed question

2008-07-25 Thread Matthew Fitzgibbons
Iain King wrote: On Jul 25, 4:22 pm, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: It seems like the probability calculation applies to all three equally, and can therefore be ignored for the simulations. The probability affects (1) more. My reasoning for this being: as probability gets low

Re: Execution speed question

2008-07-25 Thread Vlastimil Brom
2008/7/25 Suresh Pillai <[EMAIL PROTECTED]>: > ... > I naturally started coding with (2), but couldn't decide on the best data > structure for python. A set seemed ideal for speedy removal, but then I > can't iterate through them with out popping. An ordered list? Some > creative solution wi

Re: Python base distribution come with a validating XML parser?

2008-07-25 Thread R�diger Werner
> Hi, > > Basic XML questions, > > I have a .xml file I want to validate against a .xsd file... > > Does the Python base distribution come with a validating XML parser? > > I want to make sure the elements in my xml file vs. the elements > defined in my xsd are a match. > > I could parse both XML a

Re: Calling external program from within python

2008-07-25 Thread Mike Driscoll
On Jul 25, 9:28 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Mike Driscoll schrieb: > > > On Jul 25, 7:56 am, Emmanouil Angelakis <[EMAIL PROTECTED]> > > wrote: > >> Hi, > > >> I am tryiong to do something obviously trivial such as: > >> I have a c program called "tsys2list" that when it is

Question Regarding XML

2008-07-25 Thread SUBHABRATA
Dear Group, I have some queries regarding XML conversion of some .txt/.doc files. I am thinking to use Satine. Is it OK? But it seems to support Python2.3 but does it support 2.5, too? If any one can kindly let me know. Best Regards, Subhabrata. -- http://mail.python.org/mailman/listinfo/python-lis

Re: repr(string)

2008-07-25 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, MRAB <[EMAIL PROTECTED]> wrote: > On Jul 23, 4:04 pm, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > > I've been saving data in a file with one line per field. > > Now some of the fields may become multi-line strings... > > > > I was about to start escaping and u

Re: Execution speed question

2008-07-25 Thread Iain King
On Jul 25, 4:22 pm, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: > It seems like the probability calculation applies to all three equally, > and can therefore be ignored for the simulations. The probability affects (1) more. My reasoning for this being: as probability gets lower the number of

RE: Questions on 64 bit versions of Python

2008-07-25 Thread Dino Viehland
The end result of that is on a 32-bit machine IronPython runs in a 32-bit process and on a 64-bit machine it runs in a 64-bit process. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Driscoll Sent: Friday, July 25, 2008 5:58 AM To: python-list@python

Re: Calling external program from within python

2008-07-25 Thread Marc 'BlackJack' Rintsch
On Fri, 25 Jul 2008 08:13:55 -0700, oj wrote: > On Jul 25, 3:44 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Because usually if a program *prompts* the user to enter input (and that >> was what I read from the OP's post), one has to deal with pseudo >> terminals, not with stdin/out. > > H

Re: Calling external program from within python

2008-07-25 Thread Diez B. Roggisch
oj schrieb: On Jul 25, 3:44 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: Because usually if a program *prompts* the user to enter input (and that was what I read from the OP's post), one has to deal with pseudo terminals, not with stdin/out. How does the program writing some text before t

Re: Execution speed question

2008-07-25 Thread Matthew Fitzgibbons
Suresh Pillai wrote: That's a good comparison for the general question I posed. Thanks. Although I do believe lists are less than ideal here and a different data structure should be used. To be more specific to my case: As mentioned in my original post, I also have the specific condition tha

Re: Calling external program from within python

2008-07-25 Thread oj
On Jul 25, 3:44 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Because usually if a program *prompts* the user to enter input (and that > was what I read from the OP's post), one has to deal with pseudo > terminals, not with stdin/out. How does the program writing some text before taking inpu

Re: Execution speed question

2008-07-25 Thread Iain King
On Jul 25, 3:39 pm, Suresh Pillai <[EMAIL PROTECTED]> wrote: > That's a good comparison for the general question I posed. Thanks. > Although I do believe lists are less than ideal here and a different data > structure should be used. > > To be more specific to my case: > As mentioned in my origina

Re: ctypes and reading value under pointer passed as param of a callback

2008-07-25 Thread Mark Tolonen
"waldek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Jul 24, 5:01 pm, Thomas Heller <[EMAIL PROTECTED]> wrote: waldekschrieb: > Hi, > I'm using C dll with py module and wanna read value (buffer of bytes) > returned in py callback as parameter passed to dll function. The c

Re: Execution speed question

2008-07-25 Thread Suresh Pillai
On Fri, 25 Jul 2008 16:51:42 +0200, Fredrik Lundh wrote: > Unless I'm missing something, your example keeps going until it's > flagged *all* nodes as "on", which, obviously, kills performance for the > first version as the probability goes down. The OP's question was about > a single pass (but he

Re: Execution speed question

2008-07-25 Thread Fredrik Lundh
Iain King wrote: I think (2)'s poor performance is being amplified by how python handles lists and list deletions; the effect may be stymied in other languages Delete is O(n) (or "O(n/2) on average", if you prefer), while append is amortized O(1). Unless I'm missing something, your example

Re: Calling external program from within python

2008-07-25 Thread Diez B. Roggisch
Grant Edwards schrieb: On 2008-07-25, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: There are probably many ways to do this. I would recommend checking out the subprocess module and see if it does what you want. This will only work if the program can be fully controlled by commandline arguments.

Re: Attack a sacred Python Cow

2008-07-25 Thread alex23
On Jul 25, 9:49 pm, Lie <[EMAIL PROTECTED]> wrote: > These two statements contradicts each other, > implying an implicit Zen: "Foolish consistency is the hobgoblin's > little minds", it is OK to break the rules sometimes. "A foolish consistency is _the_ hobgoblin of little minds." (Ralph Waldo Eme

Re: Execution speed question

2008-07-25 Thread Suresh Pillai
That's a good comparison for the general question I posed. Thanks. Although I do believe lists are less than ideal here and a different data structure should be used. To be more specific to my case: As mentioned in my original post, I also have the specific condition that one does not know wh

Re: Execution speed question

2008-07-25 Thread alex23
On Jul 25, 9:54 pm, Jeff <[EMAIL PROTECTED]> wrote: > Look at using reduce().  You can collect information about all of the > nodes without necessarily building a large, intermediate list in the > process. >From the OP's description, I assumed there'd be a list of all nodes, from which he wishes t

Re: Calling external program from within python

2008-07-25 Thread Grant Edwards
On 2008-07-25, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> There are probably many ways to do this. I would recommend >> checking out the subprocess module and see if it does what you >> want. > > This will only work if the program can be fully controlled by > commandline arguments. Why do yo

Re: Calling external program from within python

2008-07-25 Thread Diez B. Roggisch
Mike Driscoll schrieb: On Jul 25, 7:56 am, Emmanouil Angelakis <[EMAIL PROTECTED]> wrote: Hi, I am tryiong to do something obviously trivial such as: I have a c program called "tsys2list" that when it is ran it asks the user to give the value of "tcal" which is a variable. I want to call the

Re: PyOpenGL Tutorial?

2008-07-25 Thread sturlamolden
On Jul 23, 10:07 pm, Clay Hobbs <[EMAIL PROTECTED]> wrote: > I need a tutorial for PyOpenGL (specifically, to be used with wxPython). > I searched with Google and didn't find one.  Does anybody know where one > is? PyOpenGL is just a wrapper for OpenGL. The API is identical. Do you need an OpenGL

Re: 2d graphics - what module to use?

2008-07-25 Thread Boris Borcic
Pierre Dagenais 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. -- http://mail.python.org/mailman/listinfo/python-list For very simple things, the standard module turtle might be your best bet. BB

Re: Execution speed question

2008-07-25 Thread Iain King
On Jul 25, 1:46 pm, Iain King <[EMAIL PROTECTED]> wrote: > On Jul 25, 10:57 am, Suresh Pillai <[EMAIL PROTECTED]> wrote: > > > > > I am performing simulations on networks (graphs). I have a question on > > speed of execution (assuming very ample memory for now). I simplify the > > details of my s

Python base distribution come with a validating XML parser?

2008-07-25 Thread goldtech
Hi, Basic XML questions, I have a .xml file I want to validate against a .xsd file... Does the Python base distribution come with a validating XML parser? I want to make sure the elements in my xml file vs. the elements defined in my xsd are a match. I could parse both XML and xsd elements to

Re: Calling external program from within python

2008-07-25 Thread Mike Driscoll
On Jul 25, 7:56 am, Emmanouil Angelakis <[EMAIL PROTECTED]> wrote: > Hi, > > I am tryiong to do something obviously trivial such as: > I have a c program called "tsys2list" that when it is ran it asks the user to > give the value of "tcal" which is a variable. I want to call the  "tsys2list" > fr

Re: Working with ctypes and char** data type

2008-07-25 Thread Philluminati
On Jul 24, 4:03 pm, Thomas Heller <[EMAIL PROTECTED]> wrote: > Philluminati schrieb: > > > > > I'm a bit of a python newbie and I need to wrap a C library. > > > I can initialise the library using CDLL('mcclient.so') > > > and I can call functions correctly inside the library but I need to > > invo

Calling external program from within python

2008-07-25 Thread Emmanouil Angelakis
Hi, I am tryiong to do something obviously trivial such as: I have a c program called "tsys2list" that when it is ran it asks the user to give the value of "tcal" which is a variable. I want to call the "tsys2list" from within a pyrthon script lets call it "gamma.py" >>>but<<< I want to pass the

Re: Questions on 64 bit versions of Python

2008-07-25 Thread Mike Driscoll
On Jul 25, 5:52 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > M.-A. Lemburg wrote: > >> 4. Is there a stable version of IronPython compiled under a 64 bit > >> version of .NET? Anyone have experience with such a beast? > > > Can't comment on that one. > > Should that matter?  Isn't IronPython pure

Re: Execution speed question

2008-07-25 Thread Iain King
On Jul 25, 10:57 am, Suresh Pillai <[EMAIL PROTECTED]> wrote: > I am performing simulations on networks (graphs). I have a question on > speed of execution (assuming very ample memory for now). I simplify the > details of my simulation below, as the question I ask applies more > generally than my

POP3 - Using poplib only shows the first few hundred messages in the mailbox

2008-07-25 Thread SteveC
Hello, I am trying to use POP3_SSL class of the poplib module to read email from my gmail account. I can connect just fine using the example here http://www.python.org/doc/lib/pop3-example.html import getpass, poplib M = poplib.POP3('localhost') M.user(getpass.getuser()) M.pass_(getpass.getpass

Re: Autocompletion and Interactive Tables in a Python IDE

2008-07-25 Thread Colin J. Williams
Anthony wrote: Hi, I'm a FoxPro programmer, but I want to learn python before it's too late. I do a lot of statistical programming, so I import SPSS into python. In my opinion, the best features of Visual FoxPro 9.0 were: a) Intellisense (tells you what classes/methods are available and what va

Re: object persistency, store instances relationship externally

2008-07-25 Thread Fredrik Lundh
King wrote: This is a new test for object persistency. I am trying to store the relationship between instances externally. It's not working as expected. May be I am doing it in wrong way. Any suggestions? The shelve module pickles each stored item individually. To preserve inter-object relat

Re: Execution speed question

2008-07-25 Thread Jeff
> I'd recommend using 'filter' and list comprehensions. Look at using reduce(). You can collect information about all of the nodes without necessarily building a large, intermediate list in the process. You might get some ideas from here [http://en.wikipedia.org/wiki/ Antiobjects]. -- http://ma

Re: Automatically loading and initialising objects from a plugins directory

2008-07-25 Thread Fredrik Lundh
Dave Challis wrote: I'll have a look into metaclasses too, haven't stumbled upon those yet at all. It's a potentially brain-exploding topic, though, so if the above solution works for you, you might want to leave it at that ;-) But very briefly, a metaclass is a something that's responsible

Re: Attack a sacred Python Cow

2008-07-25 Thread Lie
On Jul 24, 9:26 pm, Jordan <[EMAIL PROTECTED]> wrote: > In reality? I'll just keep writing Python (hopefully enough so that > explicit self become burned into muscle memory), and use other > languages when necessary (no more C than I have to, looking forward to > dabbling in Erlang soon, and one da

Re: object persistency, store instances relationship externally

2008-07-25 Thread Larry Bates
King wrote: This is a new test for object persistency. I am trying to store the relationship between instances externally. It's not working as expected. May be I am doing it in wrong way. Any suggestions? import shelve class attrib(object): pass class node(object): def __init__(self):

Re: Automatically loading and initialising objects from a plugins directory

2008-07-25 Thread Dave Challis
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Fredrik Lundh wrote: > so now you're no longer supporting mixins and multiple-level > inheritance? why not just tweak Diez' example a little: > > for name in dir(plugin): > > thing = getattr(plugin, name) > > # make sure this is a plugin >

Re: PyOpenGL Tutorial?

2008-07-25 Thread Mike C. Fletcher
arsyed wrote: ... Also, see: http://www.siafoo.net/browse?keyword_id=245 But note regarding the second tutorial there that the PyOpenGL 3.x *does* supply wrappers for most publicly known extensions, so you shouldn't have to create your own wrappers for them any more. There's also tutorial

Re: Undefined calling conventions in Python.h

2008-07-25 Thread Fredrik Lundh
Ben Sizer wrote: In theory, yeah. In practice, if his compiler was somehow not respecting that, then a quicker fix is to enclose the #include than to do individual prototypes. Admittedly that might obscure the problem rather than solve it. Well, I'd say that the should in You should put the

Re: lxml, comparing nodes

2008-07-25 Thread Stefan Behnel
code_berzerker wrote: >> Not in your code. >> >> Stefan > > Not sure what you mean, but I tested and so far every document with > the same order of elements had number of comparisons equal to number > of nodes. Sorry, missed the "let2.remove(foundEl)" line. Stefan -- http://mail.python.org/mailm

Re: lxml, comparing nodes

2008-07-25 Thread code_berzerker
> Not in your code. > > Stefan Not sure what you mean, but I tested and so far every document with the same order of elements had number of comparisons equal to number of nodes. -- http://mail.python.org/mailman/listinfo/python-list

Re: scanf in python

2008-07-25 Thread Fredrik Lundh
AMD wrote: For reading delimited fields in Python, you can use .split string method. Yes, that is what I use right now, but I still have to do the conversion to integers, floats, dates as several separate steps. What is nice about the scanf function is that it is all done on the same step. E

Re: lxml, comparing nodes

2008-07-25 Thread Stefan Behnel
code_berzerker wrote: >> If document order doesn't matter, try sorting the elements of each level in >> the two documents by some arbitrary deterministic key, such as (tag name, >> text, attr count, whatever), and then compare them in order, instead of >> trying >> to find matches in multiple pass

Re: Execution speed question

2008-07-25 Thread alex23
On Jul 25, 7:57 pm, Suresh Pillai <[EMAIL PROTECTED]> wrote: > The nodes in my network may be ON or OFF.  The network starts off with > all nodes in the OFF state.  I loop through the nodes.  For each node > that is OFF, I consider some probability of it turning ON based on the > states of its neig

Re: Undefined calling conventions in Python.h

2008-07-25 Thread Ben Sizer
On Jul 23, 1:19 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Ben Sizer wrote: > > You should put the extern block around the #include call > > rather than individual functions, as surely the C calling convention > > should apply to everything within. > > Hello?  Python's include files are C++ sa

Re: Questions on 64 bit versions of Python

2008-07-25 Thread Fredrik Lundh
M.-A. Lemburg wrote: 4. Is there a stable version of IronPython compiled under a 64 bit version of .NET? Anyone have experience with such a beast? Can't comment on that one. Should that matter? Isn't IronPython pure CLR? -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >