Re: Reading Java byte[] data stream over standard input

2008-05-19 Thread Giles Brown
On 19 May, 06:11, sapsi <[EMAIL PROTECTED]> wrote: > Hello, > I am using HadoopStreaming using a BinaryInputStream. What this > basically does is send a stream of bytes ( the java type is : private > byte[] bytes) to my python program. > > I have done a test like this, > while 1: > x=sys.s

Re: select.poll() and WSAPoll

2008-05-06 Thread Giles Brown
On 6 May, 14:18, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 6 May 2008 08:36:28 -0400, inhahe <[EMAIL PROTECTED]> wrote: > >select.poll isn't supported on Windows, because Windows doesn't have such a > >feature, or at least it didn't until Vista. Vista implements the same thing > >bu

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-02 Thread Giles Brown
On Mar 2, 2:08 pm, Preben Randhol wrote: > On Sun, 2 Mar 2008 15:06:17 +0100 > > Preben Randhol <[EMAIL PROTECTED]> wrote: > >class dbase(list): > > Sorry the definition of the class is: > > class dbase(object): > > it doesn't derive from the list class. > > Preben http://docs.python.

Re: COM server and EXE

2008-01-08 Thread Giles Brown
On 8 Jan, 11:04, Teja <[EMAIL PROTECTED]> wrote: > On Jan 8, 3:33 pm, Teja <[EMAIL PROTECTED]> wrote: > > > > > Hi All, > > > I have a Python COM server. I need to deploy it on various sytems. > > When I run the COM server from > > python its showing an output " Registered : sample.lib" > > > If I

Re: Converting Excel time-format (hours since 1.1.1901)

2007-12-07 Thread Giles Brown
On 7 Dec, 13:20, Dirk Hagemann <[EMAIL PROTECTED]> wrote: > Hello, > > From a zone-file of a Microsoft Active Directory integrated DNS server > I get the date/time of the dynamic update entries in a format, which > is as far as I know the hours since january 1st 1901. > For Example: the number 3566

Re: securing a python execution environment...

2007-11-19 Thread Giles Brown
On 19 Nov, 11:16, Chris Withers <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm trying to build a secure execution environment for bits of python > for two reasons: > > - to allow users of the system to write scripts in python without > circumventing the application's security model > > - to allow the

Re: Which persistence is for me?

2007-11-01 Thread Giles Brown
On 1 Nov, 11:47, Neal Becker <[EMAIL PROTECTED]> wrote: > I need to organize the results of some experiments. Seems some sort of > database is in order. > > I just took a look at DBAPI and the new sqlite interface in python2.5. I > have no experience with sql. I am repulsed by e.g.: > c.execute(

Re: interfacing Python interpreter with a VB6 frontend

2007-10-03 Thread Giles Brown
On 3 Oct, 11:07, Anonymous <[EMAIL PROTECTED]> wrote: > I am trying something which appears (so far), that many other people > have not yet tried before - since I can't find any useful related > material despite several days of searching various sites/blogs etc. > > I want to use VB6 as a front end

Re: VB frontend to Python COM backend

2007-07-06 Thread Giles Brown
On 6 Jul, 06:58, nik <[EMAIL PROTECTED]> wrote: > I have a VB6 application that I would like to attach to a python > communications application. > > I have come across several discussions on using VB with a Python COM > back-end, but no starting point. I haven't had anymore luck with > google at fi

Re: Postpone creation of attributes until needed

2007-06-11 Thread Giles Brown
On 11 Jun, 11:10, Frank Millman <[EMAIL PROTECTED]> wrote: > On Jun 11, 11:47 am, Phil Thompson <[EMAIL PROTECTED]> > wrote: > > > > > On Monday 11 June 2007 10:24 am, Frank Millman wrote: > > > > Hi all > > > > I have a small problem. I have come up with a solution, but I don't > > > know if it is

Re: Decorator question

2007-05-23 Thread Giles Brown
On 23 May, 14:46, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > I just discovered decorators. Very cool. My question is that I can't > figure out how to make a decorator not be restricted to a function so it > would also work on a method. > > Here's my code: > > def g(expr): > def rpt(func): >

Re: NOOOOB

2007-05-22 Thread Giles Brown
On 22 May, 11:29, jolly <[EMAIL PROTECTED]> wrote: > Hey guys, > > I want to begin python. Does anyone know where a good starting point > is? > > Thanks, > Jem My suggestion is have a look at www.python.org and see if you can find what you're looking for. Giles -- http://mail.python.org/mailman

Re: SQLAlchemy and Oracle Functions?

2007-03-08 Thread Giles Brown
On 8 Mar, 22:19, "Greg Copeland" <[EMAIL PROTECTED]> wrote: > I'm using SQLAlchemy and have a need to call an Oracle function; which > is not the same as a stored procedure. Can this be done directory or > indirectly with SQLAlchemy? If so, can someone please provide an > example? If not, how do

Re: How to build a Windows service using win32?

2007-03-08 Thread Giles Brown
On 7 Mar, 16:45, "Gregor Mosheh" <[EMAIL PROTECTED]> wrote: > Giles Brown wrote: > > Yeah. You've cleverly decided to simplify the "smallest > > possible python service" by removing the > > if __name__ == '__main__': > > Ha ha.

Re: How to build a Windows service using win32?

2007-03-07 Thread Giles Brown
On 7 Mar, 10:25, "Gregor Mosheh" <[EMAIL PROTECTED]> wrote: > I'm trying to write a Win32 service. The following is straight from Python > Programming on Win32 and it doesn't work. Is that book out of date; is > there a new way to do services? I searched Google for hours trying to find > any other

Re: _ssl.pyd is buggy?

2007-02-14 Thread Giles Brown
On 14 Feb, 00:17, "Giles Brown" <[EMAIL PROTECTED]> wrote: > Something I always found useful is to use the win32traceutil to set up > the trace debugging tool. > You can then see the output in the pythonwin trace collector tool. > This is very useful for > Python ser

Re: _ssl.pyd is buggy?

2007-02-13 Thread Giles Brown
Something I always found useful is to use the win32traceutil to set up the trace debugging tool. You can then see the output in the pythonwin trace collector tool. This is very useful for Python services and COM servers. Best of luck, Giles -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes.com.IUnknown

2007-02-04 Thread Giles Brown
On 3 Feb, 20:36, Robin Becker <[EMAIL PROTECTED]> wrote: > I find that ctypes.com has disappeared from the ctypes extension bundled > with Python 2.5. I think I only need the IUnknown, I was playing with > building a dialog using venster, but it needs IUnknown, STDMETHOD, > HRESULT, GUID from ctype

Re: Bad Code (that works) help me re-write!

2006-10-11 Thread Giles Brown
Matthew Warren wrote: > I have the following piece of code, No doubt you will get some kind soul to suggest some things, but if you want really good answers I think you need explain why you want this command file (as opposed to using say a python script itself). Are you attempting to create a sim

Re: How do I read Excel file in Python?

2006-10-06 Thread Giles Brown
John Machin wrote: > [EMAIL PROTECTED] wrote: > > > > >>> excel_date = 38938.0 > > > > >>> python_date = datetime.date(1900, 1, 1) + > > > > >>> datetime.timedelta(days=excel_date) > > > > >>> python_date > > > > datetime.date(2006, 8, 11) > > > > > > Err, that's the wrong answer, isn't it? Perhap

Re: How to avoid a warning message box when sending email via Outlook

2006-08-31 Thread Giles Brown
Tim Golden wrote: > [Dermot Doran] > > | I'm very new to using win32com! I just want to send an email > | message via Outlook. However, I keep getting an annoying > | message box (generated by Outlook) indicating that my program > | could be a virus. Does anybody know how to get around this? >

Re: how do you get the name of a dictionary?

2006-08-25 Thread Giles Brown
jojoba wrote: > Does anyone know how to find the name of a python data type. > Conside a dictionary: > Banana = {} > > Then, how do i ask python for a string representing the name of the > above dictionary (i.e. 'Banana')? As many people have already said this question doesn't really make sense, b

Re: hi,every body. a problem with PyQt.

2006-05-24 Thread Giles Brown
The tool to create a python script from a Qt designer .ui file is called pyuic. I suggest you have a google for "pyqt tutorial" pages. I found this one for example: http://wiki.python.org/moin/JonathanGardnerPyQtTutorial Regards, Giles -- http://mail.python.org/mailman/listinfo/python-list

Re: How to move optparse from main to function?

2006-02-23 Thread Giles Brown
Doesn't the module documentation ... http://docs.python.org/lib/optparse-putting-it-all-together.html ... tell you what you need? Giles -- http://mail.python.org/mailman/listinfo/python-list

Re: A C-like if statement

2006-02-23 Thread Giles Brown
But maybe we're talking about string methods so to get an exception we'd want to use "index" instead of "find". Giles -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to use python to unit test C++ code?

2005-12-22 Thread Giles Brown
I have used the Python version of this: http://cxxtest.sourceforge.net/ unit testing framework successfully (but not heavily). Hth, Giles Brown -- http://mail.python.org/mailman/listinfo/python-list

Re: Would this be Guido's pen?

2005-09-26 Thread Giles Brown
Yeah and of course http://www.masterlock.com/promos/python/8413python_lock.shtml is Guido's security cable too. Giles -- http://mail.python.org/mailman/listinfo/python-list

Re: Software bugs aren't inevitable

2005-09-16 Thread Giles Brown
Michael Sparks wrote: > The problem that these sorts of approaches don't address is the simple > fact that simple creating a formal spec and implementing it, even if > you manage to create a way of automating the test suite from the spec > *doesn't guarantee that it will do the right thing*. > As

Re: Software bugs aren't inevitable

2005-09-14 Thread Giles Brown
s is for proving your code matches a specification in Z. So your annotations are part of that proof and can again be checked automatically. > > So, How do I get feedback from Praxis, Do they already read > comp.lang.py? Are there no email links on: http://www.praxis-his.com/sparkada/ ?

Re: Windows Cmd.exe Window

2005-07-07 Thread Giles Brown
Addendum - forgot to mention that the problem with checking the extension of sys.argv[0] is that sys.argv[0] is not set until after sitecustomize.py is run (and it needs to be in sitecustomize.py not an imported module due to the top-level SyntaxError problem mentioned in my other post). Cheers ag

Re: Windows Cmd.exe Window

2005-07-07 Thread Giles Brown
Hooray! We have a winner! Thanks Duncan. Your improved shell line will do the job very nicely. :) (btw, the problem with "import sethook" at the top of the script is that syntax errors in the top-level will prevent the import from being run meaning we don't get our traceback anymore.) Giles --

Re: Windows Cmd.exe Window

2005-07-07 Thread Giles Brown
Hi Larry, I mentioned how I am already using "sys.excepthook" in my initial posting. What I'm looking for is: 1) Is there any better way of solving the problem than setting sys.excepthook in sitecustomize.py? 2) Or is there a better way of detecting when I am running a .cmd based script than the me

Re: Windows Cmd.exe Window

2005-07-07 Thread Giles Brown
Thanks for your replies. I think we might have a miscommunication here as (to my understanding) neither of your replies actually solve my problem. After all, the function raw_input is just another way of blocking until user input. I was already doing that using "os.system('pause')". To recap, w

Re: Windows Cmd.exe Window

2005-07-07 Thread Giles Brown
Nah. You're missing my point. I only want the command window not to be closed if there is an *exception*. Picky I know, but there you go. Giles -- http://mail.python.org/mailman/listinfo/python-list

Windows Cmd.exe Window

2005-07-07 Thread Giles Brown
For my sins I'm a MS Windows user at work and apart from that I have a small problem ... I like to write python scripts to do small tasks and then double click on them from the file explorer to run them. Unfortunately I'm not perfect and sometimes I make mistakes and have unhandled exceptions or

Re: odbc and python

2005-06-03 Thread Giles Brown
MM wrote: > Are there any other odbc packages other than the win32all and mxodbc > ones? The win32all odbc.pyd can't access table structure info like > SQLColumns, and mxobdc requires a commercial license which is > unjustifiable for this tiny project. Any other OS alternatives for > win32?. Thanks

Re: how to config a comserver in a customize dll?

2005-05-23 Thread Giles Brown
But just to muddy the waters, using py2exe you can package your COM server as a .dll in its own right. Cheers, Giles Brown -- http://mail.python.org/mailman/listinfo/python-list