Re: Getting pid of a remote process

2008-08-19 Thread Diez B. Roggisch
srinivasan srinivas schrieb: HI, I am using Solaris and subprocess.Popen to spawn a process on a remote machine. No, you are *not* doing that. You are maybe using subproces to run SSH to spawn a remote process. Why don't you *show* us how you actually do that? DIEZ -- http://mail.python.org/

Re: Programming Languages Decisions

2008-08-19 Thread Terry Reedy
How is Python with graphics? It depends a bit on exactly what you mean, but there are 3rd party packages for just about everything. Ask a specific question, parhaps in a new thread, and you should a specific answer, or more. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting pid of a remote process

2008-08-19 Thread Willi Richert
Hallo, if the remote machines allow ssh login, you might try my SSHRemoteController (a combination of ssh and pexpect). Basically, it simulates a user typing something at the console. Then you can conveniently issue commands at the remote machine like "ps ax | grep cmd". http://www.richert.de/

Re: Python Substitute for PHP GD, Resizing an image on the client side

2008-08-19 Thread brahmaforces
Hi Everyone, Thanks for your responses. Sorry I should have been clearer in my question. Yes PHP is server side, and it seems that all image processing using GD or ImageMagicks etc happens on the server. Therefore Diez's suggestion of using javascript to select a rectangle on the client side would

Re: cathing uncaught exceptions

2008-08-19 Thread Alexandru Mosoi
On Aug 18, 6:02 pm, Alexandru Mosoi <[EMAIL PROTECTED]> wrote: > how can I catch (globally) exception that were not caught in a try/ > catch block in any running thread? i had this weird case that an > exception was raised in one thread, but nothing was displayed/logged. I found that normally sys

Re: Python Substitute for PHP GD, Resizing an image on the client side

2008-08-19 Thread Diez B. Roggisch
> Does anyone have any code that does the javascript "selecting the > rectangle bit" and uploading to the server. I've based my work in this field on some freely available JS, but don't know what it was called. Google is your friend here. > Also incidentally is ftp > or put the recommended way t

Re: Getting pid of a remote process

2008-08-19 Thread srinivasan srinivas
This is wat i am doing : args = [ "SSH", ,  ] I am giving this to subprocess.Popen() Thanks, Srini - Original Message From: Diez B. Roggisch <[EMAIL PROTECTED]> To: python-list@python.org Sent: Tuesday, 19 August, 2008 12:26:20 PM Subject: Re: Getting pid of a remote process srinivasan

Re: Getting pid of a remote process

2008-08-19 Thread Diez B. Roggisch
srinivasan srinivas wrote: > This is wat i am doing : > > args = [ "SSH", ,  ] > I am giving this to subprocess.Popen() > Thanks, > Srini Then the answer is simple: how would you figure out the remote process pid using ssh? Once you found that out, pass that to Popen. Make sure you capture stdou

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-19 Thread Eric Brunel
On Fri, 15 Aug 2008 20:02:36 +0200, Rafe <[EMAIL PROTECTED]> wrote: [snip] 1) 'Declaring' attributes - I always felt it was good code practice to declare attributes in a section of the class namespace. I set anything that is constant but anything variable is set again in __init__(): Class A(obj

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-19 Thread Fredrik Lundh
Eric Brunel wrote: To add to what others have already said, it is not only 'just extra work', it is also quite dangerous. See: class A(object): children = [] the OP is aware of that, of course: > I set anything that is constant but anything variable is set again in > __init__() as long a

Re: searching through a string and pulling characters

2008-08-19 Thread Paul Boddie
On 19 Aug, 01:11, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Mon, 18 Aug 2008 15:34:12 -0700, Alexnb wrote: > > Okay, well the point of this program is to steal from the OS X built-in > > dictionary. > > Ah, not homework, but copyright infringement. It depends what the inqu

WindowsXP / CTypes Module - unable to access function in a dll

2008-08-19 Thread dudeja . rajat
Hi, I'm using the CTYPES module of python to load a dll. My dll contains a Get_Version function as: long __stdcall af1xEvdoRDll_GetVersion(long version[4]); This function accepts a long array of 4 elements. Following is the python code I've written: from ctypes import * abc = windll.af1xEvdoRD

Re: WindowsXP / CTypes Module - unable to access function in a dll

2008-08-19 Thread dudeja . rajat
On Tue, Aug 19, 2008 at 11:04 AM, <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using the CTYPES module of python to load a dll. My dll contains a > Get_Version function as: > long __stdcall af1xEvdoRDll_GetVersion(long version[4]); > > This function accepts a long array of 4 elements. > > Following is

Re: WindowsXP / CTypes Module - unable to access function in a dll

2008-08-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > > I'm using the CTYPES module of python to load a dll. My dll contains a > Get_Version function as: > long __stdcall af1xEvdoRDll_GetVersion(long version[4]); > > This function accepts a long array of 4 elements. > > Following is the python code I've written: >

Re: WindowsXP / CTypes Module - unable to access function in a dll

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: print version I'm getting the following output: <_FuncPtr object at 0x00A1EB70> <__main__.c_long_Array_4 object at 0x00A86300> But I'm not getting the desired output which I expect as : 2.1.5.0 expecting that Python/ctypes should be able to figure out that you want a

WindowsXP/ CTypes - How to convert ctypes array to a string?

2008-08-19 Thread dudeja . rajat
Hi, I've used CTYPES module to access a function from a dll. This function provides me the version of the dll. This information is accessible to me as an array of 4 long inetegers. information as : 2, 1, 5, 0 I want to display these elements concatenated as "v2.1.5.0". This string ( I'm thinking

Re: Getting pid of a remote process

2008-08-19 Thread srinivasan srinivas
Thanks a lot. But i am wondeing will it return correct pid if more than one instance of run on the remote machine?? Thanks, Srini - Original Message From: Diez B. Roggisch <[EMAIL PROTECTED]> To: python-list@python.org Sent: Tuesday, 19 August, 2008 2:54:52 PM Subject: Re: Getting pid

Re: Passing an object through COM which acts like str but isn't

2008-08-19 Thread Rafe
On Aug 16, 1:25 am, Wolfgang Grafen <[EMAIL PROTECTED]> wrote: > Rafeschrieb: > > > On Aug 15, 10:27 pm, Wolfgang Grafen <[EMAIL PROTECTED]> > > wrote: > >>Rafeschrieb: > > >>> Now if I try to pass this as I would a string, roughly like so... > >> s = StrLike("test") > >> Application.AnObje

Re: WindowsXP/ CTypes - How to convert ctypes array to a string?

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I've used CTYPES module to access a function from a dll. This function provides me the version of the dll. This information is accessible to me as an array of 4 long inetegers. information as : 2, 1, 5, 0 I want to display these elements concatenated as "v2.1.5.0". This

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-19 Thread Bruno Desthuilliers
Fredrik Lundh a écrit : Eric Brunel wrote: To add to what others have already said, it is not only 'just extra work', it is also quite dangerous. See: class A(object): children = [] the OP is aware of that, of course: > I set anything that is constant but anything variable is set again

How to stop iteration with __iter__() ?

2008-08-19 Thread ssecorp
I want a parse a file of the format: movieId customerid, grade, date customerid, grade, date customerid, grade, date etc. so I could do with open file as reviews and then for line in reviews. but first I want to take out the movie id so I use an iterator. then i want to iterate through all the r

Re: WindowsXP/ CTypes - How to convert ctypes array to a string?

2008-08-19 Thread dudeja . rajat
On Tue, Aug 19, 2008 at 12:20 PM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >> I've used CTYPES module to access a function from a dll. This function >> provides me the version of the dll. This information is accessible to >> me as an array of 4 long inetegers. informati

Code for locking a resource

2008-08-19 Thread tarun
Hello All, I've a configuration.ini file. This particular can be accessed by several threads of my application. Each thread can read/write configuration parameters from/to the configuration.ini file. I am using threading (Rlock) to lock the resource (configuration.ini file) while accessing it from

Re: How to stop iteration with __iter__() ?

2008-08-19 Thread Jeff
On Aug 19, 7:39 am, ssecorp <[EMAIL PROTECTED]> wrote: > I want a parse a file of the format: > movieId > customerid, grade, date > customerid, grade, date > customerid, grade, date > etc. > > so I could do with open file as reviews and then for line in reviews. > > but first I want to take out the

Re: How to stop iteration with __iter__() ?

2008-08-19 Thread Jon Clements
On Aug 19, 12:39 pm, ssecorp <[EMAIL PROTECTED]> wrote: > I want a parse a file of the format: > movieId > customerid, grade, date > customerid, grade, date > customerid, grade, date > etc. > > so I could do with open file as reviews and then for line in reviews. > > but first I want to take out th

Re: How to stop iteration with __iter__() ?

2008-08-19 Thread Leo Jay
On Tue, Aug 19, 2008 at 7:39 PM, ssecorp <[EMAIL PROTECTED]> wrote: > I want a parse a file of the format: > movieId > customerid, grade, date > customerid, grade, date > customerid, grade, date > etc. > > so I could do with open file as reviews and then for line in reviews. > > but first I want to

Question regarding the standard library?

2008-08-19 Thread Hussein B
Hey, Is the standard library of Python is compiled (you know, the pyc thing)? Is it allowed to edit the source code of the standard library? I'm not talking about submitting the modified code to Python source code repository, I'm just asking if some one can edit the source code in his own machine.

Re: WindowsXP/ CTypes - How to convert ctypes array to a string?

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I also add the letter 'v' same as you suggested. However, I'm looking to store this into some variable ( that variable could be be a string, tuple or anything, Im not sure which is the suited one) the expression gives you a string object; you'll store it in a variable

Re: Question regarding the standard library?

2008-08-19 Thread Fredrik Lundh
Hussein B wrote: Is the standard library of Python is compiled (you know, the pyc thing)? Is it allowed to edit the source code of the standard library? I'm not talking about submitting the modified code to Python source code repository, I'm just asking if some one can edit the source code in hi

Re: WindowsXP/ CTypes - How to convert ctypes array to a string?

2008-08-19 Thread dudeja . rajat
On Tue, Aug 19, 2008 at 12:40 PM, <[EMAIL PROTECTED]> wrote: > On Tue, Aug 19, 2008 at 12:20 PM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> >>> I've used CTYPES module to access a function from a dll. This function >>> provides me the version of the dll. This informati

optparse escaping control characters

2008-08-19 Thread wannymahoots
optparse seems to be escaping control characters that I pass as arguments on the command line. Is this a bug? Am I missing something? Can this be prevented, or worked around? This behaviour doesn't occur with non-control characters. For example, if this program (called test.py): from optparse

ANN: Resolver One 1.2 released

2008-08-19 Thread [EMAIL PROTECTED]
We are proud to announce the release of Resolver One, version 1.2 - the largest IronPython application in the world, we think, at 38,000 lines of production code backed up by 150,000 lines of unit and functional tests. Resolver One is a Rapid Application Development tool for analysing and presenti

Re: optparse escaping control characters

2008-08-19 Thread Hrvoje Niksic
[EMAIL PROTECTED] writes: > optparse seems to be escaping control characters that I pass as > arguments on the command line. Is this a bug? Am I missing > something? Can this be prevented, or worked around? It has nothing to do with optparse, it's how Python prints strings: $ python -c 'impor

Re: Getting pid of a remote process

2008-08-19 Thread Diez B. Roggisch
srinivasan srinivas wrote: > Thanks a lot. > But i am wondeing will it return correct pid if more than one instance of > run on the remote machine?? Thanks, What do you *think*? How about *trying* that out first? Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: optparse escaping control characters

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: optparse seems to be escaping control characters that I pass as arguments on the command line. Is this a bug? Am I missing something? you're missing the distinction between the content of a string object, and how the corresponding string literal looks. >>> x = {'d

Re: optparse escaping control characters

2008-08-19 Thread Dan Halligan
On Aug 19, 1:45 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > optparse seems to be escaping control characters that I pass as > > arguments on the command line.  Is this a bug?  Am I missing > > something?  Can this be prevented, or worked around? > > It has nothing t

Re: Question regarding the standard library?

2008-08-19 Thread Hussein B
On Aug 19, 7:16 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Hussein B wrote: > > Is the standard library of Python is compiled (you know, the pyc > > thing)? > > Is it allowed to edit the source code of the standard library? > > I'm not talking about submitting the modified code to Python source

Re: Question regarding the standard library?

2008-08-19 Thread George Sakkis
On Aug 19, 8:16 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Hussein B wrote: > > Is the standard library of Python is compiled (you know, the pyc > > thing)? > > Is it allowed to edit the source code of the standard library? > > I'm not talking about submitting the modified code to Python sourc

Re: optparse escaping control characters

2008-08-19 Thread John Machin
On Aug 19, 10:35 pm, [EMAIL PROTECTED] wrote: > optparse seems to be escaping control characters that I pass as > arguments on the command line. Is this a bug? Am I missing > something? Can this be prevented, or worked around? > > This behaviour doesn't occur with non-control characters. > > For

Re: searching through a string and pulling characters

2008-08-19 Thread Wojtek Walczak
On Mon, 18 Aug 2008 15:34:12 -0700 (PDT), Alexnb wrote: > Also, on a side-note, does anyone know a very simple dictionary site, that > isn't dictionary.com or yourdictionary.com. This one is my favourite: http://www.lingro.com/ -- Regards, Wojtek Walczak, http://tosh.pl/gminick/ -- http://mail

View this blogspot

2008-08-19 Thread srinu
http://indianmasalavideos4u.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

View this blogspot

2008-08-19 Thread srinu
http://indianmasalavideos4u.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Eggs and Gems

2008-08-19 Thread Hussein B
Hey, Are Python eggs and RubyGems do the same thing (of course Gems is for Ruby and eggs is for Python)? If yes, is it outstanding as the RubyGems? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question regarding the standard library?

2008-08-19 Thread Fredrik Lundh
Hussein B wrote: Is the standard library compiled? the portions are written in Python are compiled to PYC files, just like modules you write yourself are automatically compiled to PYC files when you import them. (why not just look in the Python installation tree? it's all there for you t

Re: optparse escaping control characters

2008-08-19 Thread Steven D'Aprano
On Tue, 19 Aug 2008 05:35:27 -0700, wannymahoots wrote: > optparse seems to be escaping control characters that I pass as > arguments on the command line. Is this a bug? Am I missing something? > Can this be prevented, or worked around? You are misinterpreting the evidence. Here's the short ex

Re: Question regarding the standard library?

2008-08-19 Thread Hussein B
On Aug 19, 8:10 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Aug 19, 8:16 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > > > > Hussein B wrote: > > > Is the standard library of Python is compiled (you know, the pyc > > > thing)? > > > Is it allowed to edit the source code of the standard lib

Re: Getting pid of a remote process

2008-08-19 Thread Miles
On Mon, Aug 18, 2008 at 9:34 AM, srinivasan srinivas wrote: > Could you please suggest me a way to find pid of a process started on a > remote machine by the current process?? If ps + grep (or the more robust tool pgrep) won't work because you're running more than one instance at once, try this:

Re: ANN: Resolver One 1.2 released

2008-08-19 Thread km
Hi, sounds great - but disappointing to find it only available on window$. Is there any Linux release in near future ??? KM ~~ On Tue, Aug 19, 2008 at 6:10 PM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > We are proud to announce the release of R

Re: optparse escaping control characters

2008-08-19 Thread wannymahoots
Thanks for all the responses! -- http://mail.python.org/mailman/listinfo/python-list

Re: optparse escaping control characters

2008-08-19 Thread Hrvoje Niksic
Dan Halligan <[EMAIL PROTECTED]> writes: > How would I pass a control character to python on the command line? It depends on which command line you are using. Most Unix-like shells will allow you to input a control character by preceding it with ^V. Since \t is the TAB character, you should be a

How to use win32com to convert a MS WORD doc to HTML ?

2008-08-19 Thread Lave
Hi, all ! I'm a totally newbie huh:) I want to convert MS WORD docs to HTML, I found python windows extension win32com can make this. But I can't find the method, and I can't find any document helpful. Can anyone help me? Thank in advance. -- http://mail.python.org/mailman/listinfo/python-list

RE: How to use win32com to convert a MS WORD doc to HTML ?

2008-08-19 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Lave > Sent: Tuesday, August 19, 2008 10:06 AM > To: python-list@python.org > Subject: How to use win32com to convert a MS WORD doc to HTML ? > > Hi, all ! > > I'm a totally newbie huh:) > >

who to call a list of method inside the class itself

2008-08-19 Thread maduma
Hi, Is the following code is ok. who to call all method. It is working but the call to m() without a reference to self seems strange Thanks for your help class CustomMethod: def method1(self): def method2(self): def method3(self): def getAll

Re: who to call a list of method inside the class itself

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Is the following code is ok. who to call all method. It is working but the call to m() without a reference to self seems strange Thanks for your help class CustomMethod: def method1(self): def method2(self): def method3(self):

HTML Tables

2008-08-19 Thread Amie
Hi, Thanks for your help so far. Ok here's a scenario: I have to create a site that displays 34 html tables. In each of these tables the following information has to be displayed: logo (image), site name, date, time. Remember: in all of these 34 tables. the information displayed on each of these t

Display the results of a query to an html table

2008-08-19 Thread Amie
Hi, how do you display the results of an sql query and display it onto the html form or html table Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-19 Thread Rafe
On Aug 16, 1:22 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Rafea écrit : > > > Hi, > > > I've been thinking in circles about these aspects of Pythonic design > > and I'm curious what everyone else is doing and thinks. There are 3 > > issues here: > > > 1) 'Declaring' attributes > > There'

Re: How to access an Array and a struct within a struct wrapped by Swig ?

2008-08-19 Thread jparker104
On Aug 17, 11:30 pm, [EMAIL PROTECTED] wrote: > Anish Chapagain, I already know how to use structure, as my example > shown it. > I had trouble only with the nested structures, and it was coz of > missing typedef (ie: Swig need C struct declaration, not C++). > > And I still cannot find how to get

Re: who to call a list of method inside the class itself

2008-08-19 Thread maduma
On Aug 19, 4:33 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Is the following code is ok. who to call all method. > > It is working but the call to m() without a reference to self seems > > strange > > > Thanks for your help > > > class CustomMethod: > > def metho

Re: who to call a list of method inside the class itself

2008-08-19 Thread Edwin . Madari
[EMAIL PROTECTED] wrote: > Hi, > > Is the following code is ok. who to call all method. > It is working but the call to m() without a reference to self seems > strange > > Thanks for your help > > class CustomMethod: > def method1(self): > > def method2(self): > ...

Re: who to call a list of method inside the class itself

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: def getAllMethod(self): return [self.method1, self.method2, self.method3] def applyAll(self): for m in self.getAllMethod(): # how to call all methods ? # is it correct m() what happens when you run the code?

Re: Display the results of a query to an html table

2008-08-19 Thread Marco Nawijn
On Aug 19, 4:35 pm, Amie <[EMAIL PROTECTED]> wrote: > Hi, > how do you display the results of an sql query and display it onto the > html form or html table > > Thanks Hello, You might want to take a look at: sqlobject http://www.sqlobject.org/ or sqlalchemy http://www.sqlalchemy.org/ Th

Re: Eggs and Gems

2008-08-19 Thread Mike Driscoll
On Aug 19, 8:19 am, Hussein B <[EMAIL PROTECTED]> wrote: > Hey, > Are Python eggs and RubyGems do the same thing (of course Gems is for > Ruby and eggs is for Python)? > If yes, is it outstanding as the RubyGems? > Thanks. I've never used Ruby, so I can't say for sure, but I think they're close. R

Re: who to call a list of method inside the class itself

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: 1. return string names of required methods in getAllMethod return ['method1', 'method2', 'method3'] 2. use gettattr on self and then exetute methods in applyAll def applyAll(self): for method_name in self.getAllMethod(): method

Cash Master

2008-08-19 Thread hello_mox_10
Cash Master I've made £1260 in one week using this system and you could too. Now in its fifth year, this Best Seller continues to transform thousands of ordinary peoples lives, and you can join them! NO prior knowledge or experience in the betting industry. A basic internet connection, dial-up

datetime.datetime.now() in military time

2008-08-19 Thread korean_dave
import datetime def main(): timenow = datetime.datetime.now() print(str(timenow.hour)) if __name__ == "__main__": main() If the time was, say, 2pm, how can I make output of timenow.hour "14" instead of "2"? Thanks. -Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Factory for Struct-like classes

2008-08-19 Thread eliben
On Aug 18, 11:16 am, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > On 13 ago, 14:46, eliben <[EMAIL PROTECTED]> wrote: > > > On Aug 13, 7:30 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > > > > eliben wrote: > > > > Ruby's 'Scruct' class (http://ruby-doc.org/core/classes/Struct.html) > > > > do

Re: who to call a list of method inside the class itself

2008-08-19 Thread Edwin . Madari
[EMAIL PROTECTED] wrote: > > [EMAIL PROTECTED] wrote: > > > 1. return string names of required methods in getAllMethod > > return ['method1', 'method2', 'method3'] > > 2. use gettattr on self and then exetute methods in applyAll > > def applyAll(self): > > for method_name in self.

Re: How to use win32com to convert a MS WORD doc to HTML ?

2008-08-19 Thread Tim Golden
Lave wrote: Hi, all ! I'm a totally newbie huh:) I want to convert MS WORD docs to HTML, I found python windows extension win32com can make this. But I can't find the method, and I can't find any document helpful. You have broadly two approaches here, both involving automating Word (ie using

Re: How to use win32com to convert a MS WORD doc to HTML ?

2008-08-19 Thread Simon Brunning
2008/8/19 Lave <[EMAIL PROTECTED]>: > Hi, all ! > > I'm a totally newbie huh:) > > I want to convert MS WORD docs to HTML, I found python windows > extension win32com can make this. But I can't find the method, and I > can't find any document helpful. This should be a useful starting point:

Re: who to call a list of method inside the class itself

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: ensure instance's method invocation with all > state information to that point, rather than > relying on implemenation. Did you read the stuff I wrote about "bound methods" in the other post? That's a fundamental Python feature, not an implementation artifact. For

Re: who to call a list of method inside the class itself

2008-08-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: >> >> [EMAIL PROTECTED] wrote: >> >> > 1. return string names of required methods in getAllMethod >> > return ['method1', 'method2', 'method3'] >> > 2. use gettattr on self and then exetute methods in applyAll >> > def applyAll(self): >> > for

Re: datetime.datetime.now() in military time

2008-08-19 Thread Mike Driscoll
On Aug 19, 10:42 am, korean_dave <[EMAIL PROTECTED]> wrote: > import datetime > > def main(): >     timenow = datetime.datetime.now() >     print(str(timenow.hour)) > > if __name__ == "__main__": >     main() > > If the time was, say, 2pm, how can I make output of timenow.hour "14" > instead of "2"

Re: ANN: Resolver One 1.2 released

2008-08-19 Thread Giles Thomas
2008/8/19 km <[EMAIL PROTECTED]> Hi, sounds great - but disappointing to find it only available on window$. Is there any Linux release in near future ??? KM Not in the near future, unfortunately - but we're looking at getting it running under Mono in the medium term. The big probl

What parts of C:\Python25 are important?

2008-08-19 Thread Robert Dailey
Hi, I've currently embedded the python interpreter into a C++ application of mine. I want to bundle the python core library with my application so the user does not have to install python to use my application. What files do I need to copy over? Help is appreciated, thank you. -- http://mail.pytho

exception handling in complex Python programs

2008-08-19 Thread eliben
Python provides a quite good and feature-complete exception handling mechanism for its programmers. This is good. But exceptions, like any complex construct, are difficult to use correctly, especially as programs get large. Most of the issues of exceptions are not specific to Python, but I sometim

Re: What parts of C:\Python25 are important?

2008-08-19 Thread Fredrik Lundh
Robert Dailey wrote: I've currently embedded the python interpreter into a C++ application of mine. I want to bundle the python core library with my application so the user does not have to install python to use my application. What files do I need to copy over? Help is appreciated, thank you.

Re: Programming Languages Decisions

2008-08-19 Thread Lie
On Aug 19, 1:45 pm, "E.D.G." <[EMAIL PROTECTED]> wrote: > "Terry Reedy" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Rather than explain further, I suggest that you visit python.org and read > > some of the tutorial to see what *you* think. > >http://docs.python.org/tut/tut

Re: exception handling in complex Python programs

2008-08-19 Thread Chris Mellon
On Tue, Aug 19, 2008 at 12:19 PM, eliben <[EMAIL PROTECTED]> wrote: > Python provides a quite good and feature-complete exception handling > mechanism for its programmers. This is good. But exceptions, like any > complex construct, are difficult to use correctly, especially as > programs get large.

Re: exception handling in complex Python programs

2008-08-19 Thread Rafe
On Aug 20, 12:19 am, eliben <[EMAIL PROTECTED]> wrote: > Python provides a quite good and feature-complete exception handling > mechanism for its programmers. This is good. But exceptions, like any > complex construct, are difficult to use correctly, especially as > programs get large. > > Most of

Re: HTML Tables

2008-08-19 Thread Mensanator
On Aug 19, 9:33 am, Amie <[EMAIL PROTECTED]> wrote: > Hi, > Thanks for your help so far. Ok here's a scenario: I have to create a > site that displays 34 html  tables. > In each of these tables the following information has to be displayed: > logo (image), site name, date, time. You want 34 tables

Re: cathing uncaught exceptions

2008-08-19 Thread Rafe
On Aug 18, 10:02 pm, Alexandru Mosoi <[EMAIL PROTECTED]> wrote: > how can I catch (globally) exception that were not caught in a try/ > catch block in any running thread? i had this weird case that an > exception was raised in one thread, but nothing was displayed/logged. Any chance you might hav

Re: exception handling in complex Python programs

2008-08-19 Thread Fredrik Lundh
Rafe wrote: Again, this is probably too simple to help, but the only way to ignore certain types of exceptions, as far as I know, is to catch them and pass. e.g. this ignores type errors... try: somethingBad() except TypeError, err: pass except Exception, err: raise TypeError(err)

Re: adding properties dynamically (how to?)

2008-08-19 Thread Rafe
On Aug 17, 7:51 pm, André <[EMAIL PROTECTED]> wrote: > I didn't want to hijack the original thread but I have basically the > same request... > > On Aug 17, 7:09 am, Bruno Desthuilliers<[EMAIL PROTECTED]> wrote: > > akonsu a écrit :> hello, > > [SNIP] > > > > > Wrong solution to your problem, I'd s

Re: adding properties dynamically (how to?)

2008-08-19 Thread Rafe
On Aug 17, 7:51 pm, André <[EMAIL PROTECTED]> wrote: > I didn't want to hijack the original thread but I have basically the > same request... > > On Aug 17, 7:09 am, Bruno Desthuilliers<[EMAIL PROTECTED]> wrote: > > akonsu a écrit :> hello, > > [SNIP] > > > > > Wrong solution to your problem, I'd s

Re: how to add property "dynamically"?

2008-08-19 Thread Rafe
On Aug 17, 5:09 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > akonsu a écrit :> hello, > > > i need to add properties to instances dynamically during run time. > > this is because their names are determined by the database contents. > > so far i found a way to add methods on demand: > > > c

Re: exception handling in complex Python programs

2008-08-19 Thread [EMAIL PROTECTED]
On Aug 19, 10:19 am, eliben <[EMAIL PROTECTED]> wrote: > P.S. There's a common case where a method is passed a filename, to do > something with a file (say, read data). Should the method catch the > errors possibly thrown by open(), or leave it to the caller ? You want to look up Easier to Ask Fo

Re: Programming Languages Decisions

2008-08-19 Thread E.D.G.
"Lie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] How is Python with graphics? pygame for graphic with SDL library (e.g. fullscreen apps, hardware accelerated) Tkinter for basic GUI that can run on any python with no dependencies (except python vm) wxWidget, etc for more advance

Graphics Contexts and DCs explanations?

2008-08-19 Thread RgeeK
Experimenting with graphics in an app: it's AUI based with a few panes, one of which has a panel containing a few sizers holding UI elements. One sizer contains a panel that needs some basic line-drawing graphics in it. I use the wxPython demo app heavily to figure this stuff out, and my expe

Re: Graphics Contexts and DCs explanations?

2008-08-19 Thread Chris Mellon
On Tue, Aug 19, 2008 at 1:16 PM, RgeeK <[EMAIL PROTECTED]> wrote: > Experimenting with graphics in an app: it's AUI based with a few panes, one > of which has a panel containing a few sizers holding UI elements. One sizer > contains a panel that needs some basic line-drawing graphics in it. > > I u

Re: Python encoding

2008-08-19 Thread Joan Pallarès
Sorry, The problem is the OblecjtListView doesn't show some characters correctly. In the image attached, in the "partidos list" in the grey line, where a square is showed it must be a Ç And in the second line where a | is showed it should be a ª Why this happen? maybe OLV doesn`t manage well the

Re: cathing uncaught exceptions

2008-08-19 Thread Gabriel Genellina
En Mon, 18 Aug 2008 12:02:29 -0300, Alexandru Mosoi <[EMAIL PROTECTED]> escribió: > how can I catch (globally) exception that were not caught in a try/ > catch block in any running thread? i had this weird case that an > exception was raised in one thread, but nothing was displayed/logged. Each

displaying my randomly selected numbers in a colorful interface.

2008-08-19 Thread Goksie Aruna
dear all, i have arrays of number of size lets say 4000 i.e. 201000..2013999 now i want to do the following. first print all the numbers to a colorful console. be it wx, tk, or web based. then pick a winning number from the range which will now be printed at the center of the page. how

Re: Getting pid of a remote process

2008-08-19 Thread Kurt Mueller
srinivasan srinivas schrieb: Thanks a lot. But i am wondeing will it return correct pid if more than one instance of run on the remote machine?? Thanks, Srini On UNIX-like OS: If you start the process in the background, you can get the PID with: :~> ssh 'ls -l & echo PID=$!' | grep PID PI

Re: HTML Tables

2008-08-19 Thread Stefan Behnel
Amie wrote: > Thanks for your help so far. Ok here's a scenario: I have to create a > site that displays 34 html tables. > In each of these tables the following information has to be displayed: > logo (image), site name, date, time. > Remember: in all of these 34 tables. the information displayed

Re: Python Query: Related to locking a resource in a multithreaded environment

2008-08-19 Thread Nils Oliver Kröger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I don't think the global interpreter lock is what you need ... read here for reference: http://docs.python.org/api/threads.html My approach what be to write one class for reading and writing to the configuration and make that class thread-safe u

Re: How to stop iteration with __iter__() ?

2008-08-19 Thread Terry Reedy
ssecorp wrote: I want a parse a file of the format: movieId customerid, grade, date customerid, grade, date customerid, grade, date etc. so I could do with open file as reviews and then for line in reviews. but first I want to take out the movie id so I use an iterator. then i want to iterat

Re: displaying my randomly selected numbers in a colorful interface.

2008-08-19 Thread Mike Driscoll
On Aug 19, 1:02 am, Goksie Aruna <[EMAIL PROTECTED]> wrote: > dear all, > > i have arrays of number of size lets  say 4000 i.e.  201000..2013999 > > now i want to do the following. > > first print all the numbers to a colorful console. be it wx,  tk, or web > based. > > then pick a winning number f

Newbie question about sending and receiving data to the command prompt.

2008-08-19 Thread aditya shukla
Hello folks, I am using windows vista and i am trying to send data to the command prompt ,this is what is done. import subprocess proc =subprocess.Popen('cmd.exe',stdin=subprocess.PIPE) proc.communicate('abc') when i run this the command prompt just blinks and disappears , can anyone explain what

Idle is not accepting backslashes on some Mac OSX keyboards

2008-08-19 Thread mounty
Hi list, I am using a German keyboard on Mac OS X 10.4.11. Idle 1.2.2 is constantly blocking entering the backslash character '\' which is for instance perfectly accepted by my mail application, as you can see for yourself. If I switch to an US, Australian or English keyboard layout the backsla

  1   2   >