ANN: RELEASE: 4Py

2008-07-25 Thread webmaster
4Py is a collection of wrappers for Python. You can retrieve this package in Org.keyphrene Library. Org.keyphrene has been splited to simple package. SSL4Py is an OpenSSL Wrapper. SSH4Py is a LibSSH2 Wrapper (SSH, SCP, SFTP). Spell4Py is a Hunspell Wrapper.

PyGoogleDesktop v0.4 released!

2008-07-25 Thread Jack G. Atkinson Jr.
I'm pleased to announce the release of PyGoogleDesktop version 0.4 available at http://code.google.com/p/pythongoogledesktop/ Feedback is welcome. What is PyGoogleDesktop? - PyGoogleDesktop is a python interface into the Google Desktop search engine. It allows

Re: pci card adjusting

2008-07-25 Thread Tim Roberts
Oguz Yarimtepe [EMAIL PROTECTED] wrote: I need to adjust the dimming property of my video card. There is currently a written application called nvclock but it is not supporting my card right now. So i need to implement the requiered register jobs on the card. This is already done to a degree in

Re: Attack a sacred Python Cow

2008-07-25 Thread s0suk3
On Jul 24, 5:01 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Jordan wrote: Except when it comes to Classes. I added some classes to code that had previously just been functions, and you know what I did - or rather, forgot to do?

Questions on 64 bit versions of Python

2008-07-25 Thread python
Background: I'm going to be processing some raw transaction logs that are 30G in size. As part of this processing I may need to create some very large dictionary structures. I will be running my scripts on a version of Windows 2003 Server Enterprise Edition that supports 16G of RAM. Yes, I could

2d graphics - what module to use?

2008-07-25 Thread Pierre Dagenais
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

Re: Function editing with Vim throws IndentError

2008-07-25 Thread Timothy Grant
On Thu, Jul 24, 2008 at 9:32 PM, Lawrence D'Oliveiro [EMAIL PROTECTED] 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], Matimus wrote: That isn't the

Re: import dll instead of pyd

2008-07-25 Thread jrh
Yes it is in the same directory. The problem is it does not seem to look for dll's at all. So is this by design, or am I missing something? On 25 Juli, 10:03, Nick Dumas [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Is this DLL in the same directory as your script? If

Re: need help with introducing more traffic

2008-07-25 Thread leo davis
Fredrik Lundh,   I'm with you and my apologies for not making the scenario more clearer in my previous post [QUOTE]load testing other people's sites are known as something else, of course[QUOTE]-    yes,that could cause a DoS and its lameI certainly dont intend to do that,was just 

Re: import dll instead of pyd

2008-07-25 Thread Fredrik Lundh
jrh wrote: Yes it is in the same directory. The problem is it does not seem to look for dll's at all. So is this by design, or am I missing something? looks like that was removed in 2.5; from Misc/NEWS: - On Windows, .DLL is not an accepted file name extension for extension modules

Re: os.walk question

2008-07-25 Thread Fredrik Lundh
Lawrence D'Oliveiro wrote: Won't that return any subdirectories as well as files? sure, as was discussed in this very thread two days ago. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Attack a sacred Python Cow

2008-07-25 Thread Nikolaus Rath
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 list is trivial. Mindlessly

Re: file operations.

2008-07-25 Thread Fredrik Lundh
aditya shukla wrote: Guys thanks for your previous help .I have a doubt again (I'm sure you mean a question; in english, a doubt is something slightly different, and quite often more negative.) Also , because of this i am not able to extract the floating point values ie 0.50,0.50,0.66

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

2008-07-25 Thread waldek
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 callback receives a pointer instance. You can dereference the pointer to

Re: 2d graphics - what module to use?

2008-07-25 Thread King
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 at www.mathworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: 2d graphics - what module to use?

2008-07-25 Thread Lorenzo Gatti
On 25 Lug, 08:13, 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. What you are really asking for is what GUI library you should use; every one allows you to draw

Re: 2d graphics - what module to use?

2008-07-25 Thread Guilhem Faure
You can try R cran also. Very powerfull and free. And with R you can use Rpy, a library R for python and can access to R function and R graph in a python script. Other mathematic library exist in python : Matplotlib for exemple. Summary : to draw graph easely in python : Rpy lib or Matplotlib. If

Re: Function editing with Vim throws IndentError

2008-07-25 Thread Thomas Troeger
Lawrence D'Oliveiro wrote: Specified by whom? The most common setting these days is 4 columns. Where? I've randomly seen code snipplets that indent using spaces or, worse, tabstop != 8, but most code I've come across uses tabstop width 8, which is how it was meant to be from the beginning of

Re: Attack a sacred Python Cow

2008-07-25 Thread cokofreedom
By that logic, C++ is not OO. By that logic, Ruby is not OO. By that logic, I know of only one OO language: Java :) The fact that a language doesn't force you to do object-oriented programming doesn't mean that it's not object-oriented. In other words, your words are nonsense. No, what it

Re: Attack a sacred Python Cow

2008-07-25 Thread s0suk3
On Jul 25, 3:38 am, [EMAIL PROTECTED] wrote: By that logic, C++ is not OO. By that logic, Ruby is not OO. By that logic, I know of only one OO language: Java :) The fact that a language doesn't force you to do object-oriented programming doesn't mean that it's not object-oriented. In

Re: 2d graphics - what module to use?

2008-07-25 Thread arsyed
On Fri, Jul 25, 2008 at 2: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. -- http://mail.python.org/mailman/listinfo/python-list I'd recommend matplotlib:

Re: interpreter vs. compiled

2008-07-25 Thread Bob Martin
in 75186 20080725 050433 Tim Roberts [EMAIL PROTECTED] wrote: castironpi [EMAIL PROTECTED] wrote: Compiling a program is different than running it. A JIT compiler is a kind of compiler and it makes a compilation step. I am saying that Python is not a compiler and in order to implement JIT

Execution speed question

2008-07-25 Thread Suresh Pillai
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 general feedback in

Re: lxml, comparing nodes

2008-07-25 Thread code_berzerker
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 passes. itertools.groupby() might be

Re: Questions on 64 bit versions of Python

2008-07-25 Thread M.-A. Lemburg
On 2008-07-25 08:13, [EMAIL PROTECTED] wrote: Background: I'm going to be processing some raw transaction logs that are 30G in size. As part of this processing I may need to create some very large dictionary structures. I will be running my scripts on a version of Windows 2003 Server Enterprise

Re: scanf in python

2008-07-25 Thread AMD
In message [EMAIL PROTECTED], AMD wrote: Actually it is quite common, it is used for processing of files not for reading parameters. You can use it whenever you need to read a simple csv file or fixed format file which contains many lines with several fields per line. I do that all the time,

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? /F -- http://mail.python.org/mailman/listinfo/python-list

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

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

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.

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 python.h call rather than individual functions, as surely the C calling convention should apply to everything within. Hello?  Python's include files are C++

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

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

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

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

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

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 day

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

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

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

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

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())

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

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 CLR? /F

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 value of

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 invoke one function

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 from within a

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

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.

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

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 to

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

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

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

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 callback

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 original post,

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 input

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

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

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. How does the

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:

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

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

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 ran it asks the user

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 and xsd

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 with

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

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 ran it

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

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 )) c

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 M =

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

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

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

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

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

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

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

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

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

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

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() would

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 open

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 embed

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

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

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 care

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

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

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 *

  1   2   >