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 chec

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 anymore;

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

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

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 dr

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,

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.

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 matp

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

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 te

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

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 E

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? -- 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 neig

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: 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: 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: 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 -- http://mail.python.org/mailm

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

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

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

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

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 s

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

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

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

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

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

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

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 lang

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 http://matplotlib.so

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 deb

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(

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

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

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

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

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

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

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

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

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

  1   2   >