Re: MsiLib

2007-08-22 Thread Martin v. Löwis
> I am trying to figure out how to use msilib to extract the registry > information from an MSI file and I really could use a good example of > how that is accomplished or even just an example using msilib in > general. Does anybody happen to know of an example for this as I wasn't > able to find o

Re: What Are These Import/From Statements about?

2007-08-22 Thread W. Watson
While that's an interesting link, I was thinking of the named items like: Numeric, (this one I know about.) Image ImageChops ImageTk time binascii tkMessageBox tkSimpleDialog ... For example, what is the Image module? MakeQTE? ospath? Robert Kern wrote: > W. Watson wrote: >> Is

Re: Redo: How to create a function dynamically.

2007-08-22 Thread Peter Otten
Steven W. Orr wrote: > I have this which works: > > #! /usr/bin/python > strfunc = """ > def foo( a ): > print 'a = ', a > """ > exec strfunc > globals()['foo'] = foo > foo( 'Hello' ) > > and this which does not: > > #! /usr/bin/python > import new > strfunc = """ > def foo( a ): > pr

Re: MsiLib

2007-08-22 Thread Charlie
Thanks for the help. That definitely gets me on the right track. I am having an issue though. I keep getting the error that MSIDBOPEN_READONLY is not defined. Here is my code for testing. Am I missing something really obvious or is something just not working that should and my system is scre

Re: way to define static method

2007-08-22 Thread Marc 'BlackJack' Rintsch
On Wed, 22 Aug 2007 20:34:21 +0100, Eric CHAO wrote: > I think Python uses a very strange way to define static method in a > class. Why not make it like this? What is so strange about it? > class MyClass: > def my_static_method(self): > # self should be None as it's a static method >

Re: MsiLib

2007-08-22 Thread Jarek Zgoda
Charlie napisał(a): > Thanks for the help. That definitely gets me on the right track. I am > having an issue though. I keep getting the error that MSIDBOPEN_READONLY > is not defined. > > Here is my code for testing. Am I missing something really obvious or is > something just not working that s

Re: way to define static method

2007-08-22 Thread Eric CHAO
Thanks a lot. Because I found a solution about static method from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52304 And that's a little bit difficult to understand. # direct, naive approach -- doesn't work...: class Class1: def static1(name): print "Hello",name # ...but no

Re: MsiLib

2007-08-22 Thread Charlie
Thanks for pointing that out. It solved the one problem and along came another. Now I get the following error when I try running it. Thanks for the help. Traceback (most recent call last): File "msi.py", line 7, in record = view.Fetch() _msi.MSIError: function failed -- http://mail.

Re: Design philosophy of HTTPServer and BaseHTTPRequestHandler

2007-08-22 Thread tzuchien.chiu
On 22 ago, 14:45, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > The server is permanent; request handler instances are created and > destroyed as HTTP requests arrive and are processed. > You should store any permanent info in the server; your > "BaseHTTPRequestHandler-derived class" can reference

Learning Python using a book based on version 1.5

2007-08-22 Thread [EMAIL PROTECTED]
Greetings, A friend of mine dropped off a copy of Sams Teach Yourself Python in 24 Hours published in 2000. I skimmed the first couple of chapters looking for the interpreter version and the book was based on version Python version 1.5. Is this book still relevant? Should I toss it and look f

Re: Learning Python using a book based on version 1.5

2007-08-22 Thread Frederick Polgardy
On Aug 22, 3:27 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Greetings, > > A friend of mine dropped off a copy of Sams Teach Yourself Python in > 24 Hours published in 2000. I skimmed the first couple of chapters > looking for the interpreter version and the book was based on version > Py

Re: MsiLib

2007-08-22 Thread Martin v. Löwis
Charlie schrieb: > Thanks for pointing that out. It solved the one problem and along came > another. Now I get the following error when I try running it. Thanks for > the help. > > Traceback (most recent call last): > File "msi.py", line 7, in > record = view.Fetch() > _msi.MSIError: functi

Re: advice about `correct' use of decorator

2007-08-22 Thread Bruno Desthuilliers
Gerardo Herzig a écrit : > Steven Bethard wrote: > >> Gerardo Herzig wrote: >> >> >>> Hi all. I guess i have a conceptual question: >>> Im planing using a quite simple decorator to be used as a conditional >>> for the execution of the function. (snip) >>> >>> Something in my mind tells me that

Re: What Are These Import/From Statements about?

2007-08-22 Thread Matt McCredie
> While that's an interesting link, I was thinking of the named items like: > Numeric, (this one I know about.) > Image > ImageChops > ImageTk > time > binascii > tkMessageBox > tkSimpleDialog The `image' ones are all part of PIL (Python Imaging Library) which is a third party module (http

Re: Learning Python using a book based on version 1.5

2007-08-22 Thread Matt McCredie
> A friend of mine dropped off a copy of Sams Teach Yourself Python in > 24 Hours published in 2000. I skimmed the first couple of chapters > looking for the interpreter version and the book was based on version > Python version 1.5. > > Is this book still relevant? Should I toss it and look for

Re: What Are These Import/From Statements about?

2007-08-22 Thread Robert Kern
W. Watson wrote: > While that's an interesting link, I was thinking of the named items like: Okay, sorry. > Numeric, (this one I know about.) > Image > ImageChops > ImageTk The Image* modules are from PIL. http://www.pythonware.com/products/pil/ > time http://docs.python.org/lib/modu

Import question

2007-08-22 Thread Lamonte Harris
can I import more then one modules like this: import module,module2 ? -- http://mail.python.org/mailman/listinfo/python-list

Re: MsiLib

2007-08-22 Thread Charlie
This doesn't seem to be my day for this. When I add view.Execute() to the script, it gives me an error of Execute() takes exactly 1 argument (0 given). I can't seem to find anything on the Microsoft page that concerns the execute function that states what exactly needs to be included as an

Re: round-trip from egg to code and back to egg

2007-08-22 Thread Bruno Desthuilliers
Catherine a écrit : > I'd like to use Scriptaculous with TurboGears on Python 2.5. > Unfortunately, Scriptaculous is currently in the Cheese Shop only as a > Python 2.4 egg. > > If I had the setup.py that was used to generate the egg, I think it > would be really easy to generate a new Python 2.5

Re: Learning Python using a book based on version 1.5

2007-08-22 Thread [EMAIL PROTECTED]
> http://docs.python.org/tut/http://www.diveintopython.org/ I'm dense so the online python docs make great sources for reference points and they help clarify ambiguity but its too dry (without enough sample code) to help me fully understand the concepts. I think Dive Into Python would probably

Re: desperately in need of a tool

2007-08-22 Thread Bruno Desthuilliers
yagyala a écrit : > Hi. > > I recently started working for a company that has just implemented its > first set of software standards. So far, so good. Here's the problem: > one of those standards is that the comments for each routine must > indicate every other routine that it calls. May I sugges

Re: Error with long running web spider

2007-08-22 Thread Nick Craig-Wood
Josh Volz <[EMAIL PROTECTED]> wrote: > I have a spider that is relatively long running (somewhere between > 12-24 hours). My problem is that I keep having an issue where the > program appears to freeze. Once this freezing happens the activity of > the program drops to zero. No exception is t

Re: Import question

2007-08-22 Thread Wildemar Wildenburger
Lamonte Harris wrote: > can I import more then one modules like this: > > import module,module2 So your'e basically saying that you haven't tried it? /W -- http://mail.python.org/mailman/listinfo/python-list

Re: Class destruction

2007-08-22 Thread Robert Dailey
Thanks; I'll give it a try. On 8/22/07, Nils Oliver Kröger <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Robert Dailey schrieb: > > Hi, > > > > I'm wondering where the most appropriate location is to cleanup class > > objects. For example, i have a file handle

Re: Python for web development ...

2007-08-22 Thread Michael S
Check out http://www.modpython.org/, you can also use python with CGI http://docs.python.org/lib/module-cgi.html or fastcgi http://www.fastcgi.com/ --- [EMAIL PROTECTED] wrote: > > Hi everyone, > > I have to do a web based application for my final > year project. Since, > i am only familiar wi

introspection and functions

2007-08-22 Thread yagyala
Hi. I would like to be able to tell, at run time, how many parameters a function requires. Ideally I would like to be able to tell which are optional as well. I've tried looking at the functions attributes, but haven't found one that helps in this. How can I do this? Thanks -- http://mail.python

Re: Import question

2007-08-22 Thread Wildemar Wildenburger
Lamonte Harris wrote: > On 8/22/07, *Wildemar Wildenburger* <[EMAIL PROTECTED] > > wrote: > > So your'e basically saying that you haven't tried it? > > No I haven't. Thats why I asked? Common sense? Sorry. Excuse my sarcasm. The common way for answering easy questi

Re: introspection and functions

2007-08-22 Thread Wildemar Wildenburger
yagyala wrote: > Hi. I would like to be able to tell, at run time, how many parameters > a function requires. Ideally I would like to be able to tell which are > optional as well. I've tried looking at the functions attributes, but > haven't found one that helps in this. How can I do this? > I'v

Re: MsiLib

2007-08-22 Thread Martin v. Löwis
Charlie schrieb: > This doesn't seem to be my day for this. When I add view.Execute() to > the script, it gives me an error of Execute() takes exactly 1 argument > (0 given). I can't seem to find anything on the Microsoft page that > concerns the execute function that states what exactly needs to b

Car Air Conditioners!

2007-08-22 Thread fritz
http://car-air-conditioning.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: introspection and functions

2007-08-22 Thread James Stroud
yagyala wrote: > Hi. I would like to be able to tell, at run time, how many parameters > a function requires. Ideally I would like to be able to tell which are > optional as well. I've tried looking at the functions attributes, but > haven't found one that helps in this. How can I do this? > > Tha

Re: Learning Python using a book based on version 1.5

2007-08-22 Thread 7stud
[EMAIL PROTECTED] wrote: > Greetings, > > A friend of mine dropped off a copy of Sams Teach Yourself Python in > 24 Hours published in 2000. I skimmed the first couple of chapters > looking for the interpreter version and the book was based on version > Python version 1.5. > > Is this book still r

Re: Class destruction

2007-08-22 Thread Marshall T. Vandegrift
Nils Oliver Kröger <[EMAIL PROTECTED]> writes: > If you want to "reuse" the file, you will have to delete your classes > instance explicitly using the del statement ... this will also call > the destructor. Sometimes, but not always. The `del' statement simple removes the reference to the instan

Re: libgmail failure

2007-08-22 Thread James Stroud
[EMAIL PROTECTED] wrote: > On Aug 22, 10:26 am, James Stroud <[EMAIL PROTECTED]> wrote: >> Have you thought about spoofing explorer? Always spoof explorer. >> >> James > > > I have not heard of this. How do you spoof IE in libgmail? You might have to edit libgmail.py directly and add a header t

Re: Learning Python using a book based on version 1.5

2007-08-22 Thread James Stroud
[EMAIL PROTECTED] wrote: > Greetings, > > A friend of mine dropped off a copy of Sams Teach Yourself Python in > 24 Hours published in 2000. I skimmed the first couple of chapters > looking for the interpreter version and the book was based on version > Python version 1.5. > > Is this book still

Re: What Are These Import/From Statements about?

2007-08-22 Thread W. Watson
Thanks very much. Where's the global index? Matt McCredie wrote: >> While that's an interesting link, I was thinking of the named items like: >> Numeric, (this one I know about.) >> Image >> ImageChops >> ImageTk >> time >> binascii >> tkMessageBox >> tkSimpleDialog > > The `image' ones a

Re: What Are These Import/From Statements about?

2007-08-22 Thread Robert Kern
W. Watson wrote: > Thanks very much. Where's the global index? http://docs.python.org/modindex.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth."

Re: The Future of Python Threading

2007-08-22 Thread Seun Osewa
Yes, but if you reduce the coupling between threads in Java (by using the recommended Python approach of communicating with Queues) you get the full speed of all the cores in your CPU. i wonder why we can't have this in Java; it will be very good for servers! > As for Java, making code thread saf

Re: Where we need to use Python ?

2007-08-22 Thread Bruno Desthuilliers
Terry Reedy a écrit : > |"Bruno Desthuilliers" Terry Reedy a écrit : > | > |> The CPython implementation of the langauge compiles Python to > proprietary > |> byte code > > |Hahem... "proprietary" is certainly not the right term here. > > a. you are being nitpicky, Possibly. > overly in my op

Re: How to optimise this code?

2007-08-22 Thread Bruno Desthuilliers
David N Montgomery a écrit : > class testCase: > def __init__(self, tc): > if tc == 1:self.testCase1() > if tc == 2:self.testCase2() > if tc == 3:self.testCase3() > if tc == 4:self.testCase4() > if tc == 5:self.testCase5() > if tc == 6:self.testCa

Re: way to define static method

2007-08-22 Thread Bruno Desthuilliers
Eric CHAO a écrit : > Thanks a lot. > > Because I found a solution about static method from > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52304 This is a largely outdated recipe (while it may be usefull if you have to write code for an old Python version). > And that's a little bit

Re: introspection and functions

2007-08-22 Thread Bruno Desthuilliers
yagyala a écrit : > Hi. I would like to be able to tell, at run time, how many parameters > a function requires. Ideally I would like to be able to tell which are > optional as well. I've tried looking at the functions attributes, but > haven't found one that helps in this. How can I do this? >>>

Re: libgmail failure

2007-08-22 Thread [EMAIL PROTECTED]
On Aug 22, 4:11 pm, James Stroud <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Aug 22, 10:26 am, James Stroud <[EMAIL PROTECTED]> wrote: > >> Have you thought about spoofing explorer? Always spoof explorer. > > >> James > > > I have not heard of this. How do you spoof IE in libgmail

Re: Parser Generator?

2007-08-22 Thread Jason Evans
On Aug 18, 3:22 pm, "Jack" <[EMAIL PROTECTED]> wrote: > Hi all, I need to do syntax parsing of simple naturual languages, > for example, "weather of London" or "what is the time", simple > things like these, with Unicode support in the syntax. > > In Java, there are JavaCC, Antlr, etc. I wonder wha

Re: The folder a script is executed in

2007-08-22 Thread Benjamin
On Aug 21, 10:23 am, Benjamin <[EMAIL PROTECTED]> wrote: > On Aug 21, 4:10 am, [EMAIL PROTECTED] wrote:> Hi, > > > How do I find out what folder a script is in while it is executing? > > > For example, for the file "C:/folder/script.py" contain the following > > two lines of code - > > > myLocation

How would I go about making a file open. Not the way you might think.

2007-08-22 Thread Lamonte Harris
Basically you can open a file by double clicking, and by default it would open w/ what every program you have it set to. Most text files would open in notepad. How can I make a txt open so that notepad opens w/ the content in it by using just python. -- http://mail.python.org/mailman/listinfo/py

How do I get the current path of my python file that is currently running.

2007-08-22 Thread Lamonte Harris
Say I start i click on a python file on my desktop, how could I return the path of the current python file thats running? -- http://mail.python.org/mailman/listinfo/python-list

Re: Design philosophy of HTTPServer and BaseHTTPRequestHandler

2007-08-22 Thread Gabriel Genellina
En Wed, 22 Aug 2007 17:27:01 -0300, tzuchien.chiu <[EMAIL PROTECTED]> escribi�: > On 22 ago, 14:45, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> The server is permanent; request handler instances are created and >> destroyed as HTTP requests arrive and are processed. >> You should store any p

Baby Steps, optionDB

2007-08-22 Thread W. Watson
I'm just playing with Python. It's my first outing. The program is below. I thought I'd fuss with numbers, and then get bold and try some Tkinter stuff. I copied the root stuff from a book (Grayson), and get stopped at the optionDB statement. What's wrong? I get clError: couldn't open "opti

Re: ctypes and unsigned char*

2007-08-22 Thread Gabriel Genellina
En Mon, 20 Aug 2007 08:30:50 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribi�: > On 19 Aug., 20:40, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> In the first case, use a plain c_char_p - the individual "chars" are >> already unsigned in Python (that is, ord(xxx[i]) is always positive) >>

Re: porting vc++ project to python?

2007-08-22 Thread Steve Holden
marco Starglider wrote: > hi, > > i have a very large project in visual studio2005->visual c++ in windowsxp. > i'd like to port it, or my next project, over to python. > is this possible without rewriting all my code? > are there multiple options to do this? > my project is so large, that entirel

Re: introspection and functions

2007-08-22 Thread Scott David Daniels
yagyala wrote: > Hi. I would like to be able to tell, at run time, how many parameters > a function requires. Ideally I would like to be able to tell which are > optional as well. I've tried looking at the functions attributes, but > haven't found one that helps in this. How can I do this? > > Tha

Re: libgmail failure

2007-08-22 Thread Hamish Macpherson
On Aug 21, 5:07 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey all, > > I've been usinglibgmailto send out automated notification emails for > my company's nightly regression testing. Last night these emails > started failing, though the python code has not changed. I updated to > the l

Re: Problems with dynamic function creation.

2007-08-22 Thread Steve Holden
Peter Otten wrote: > Steven W. Orr wrote: > > [snip mess] > >> Everything works just fine (that I know of) except > > Sometimes you have to just fix the code you have. This however doesn't just > smell funny, it's hopeless. Start with clearly stating your goals and then > do a rewrite. > > Sho

Re: Learning Python using a book based on version 1.5

2007-08-22 Thread Steve Holden
James Stroud wrote: > [EMAIL PROTECTED] wrote: >> Greetings, >> >> A friend of mine dropped off a copy of Sams Teach Yourself Python in >> 24 Hours published in 2000. I skimmed the first couple of chapters >> looking for the interpreter version and the book was based on version >> Python version 1

Re: Baby Steps, optionDB

2007-08-22 Thread BartlebyScrivener
On Aug 22, 10:41 pm, "W. Watson" <[EMAIL PROTECTED]> wrote: > clError: couldn't open "optionDB": no such file or directory Because the file doesn't exist? Did you make an optionDB file? http://tinyurl.com/283o98 -- http://mail.python.org/mailman/listinfo/python-list

Re: Baby Steps, optionDB

2007-08-22 Thread W. Watson
Don't even know what the file is. I figured the book would have included it in the example. I see no mention of it in the index. Does it go by another name? BartlebyScrivener wrote: > On Aug 22, 10:41 pm, "W. Watson" <[EMAIL PROTECTED]> wrote: > >> clError: couldn't open "optionDB": no such

Re: Server-side scripting in python

2007-08-22 Thread Nagarajan
On Aug 22, 8:50 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: > In article <[EMAIL PROTECTED]>,Nagarajan <[EMAIL PROTECTED]> wrote: > > >> . > >> . > >> . > >Let me phrase my problem in a finer way. > >I have done simple projec

Re: introspection and functions

2007-08-22 Thread Ayaz Ahmed Khan
"James Stroud" typed: > py> def doit(a, b, c, x=14): > ... pass > ... > py> doit.func_code.co_argcount > 4 > py> doit.func_code.co_varnames > ('a', 'b', 'c', 'x') > py> doit.func_defaults > (14,) Neat. -- Ayaz Ahmed Khan I have not yet begun to byte! -- http://mail.python.org/mailman/listinf

Re: redirect or cover .bat log

2007-08-22 Thread vedrandekovic
On 22 kol, 21:18, [EMAIL PROTECTED] wrote: > On 22 kol, 16:01, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > > > > On 22 ago, 10:04, [EMAIL PROTECTED] wrote: > > > > > >> > e.g I need run my my_scripts_setup.bat that contain: > > > > > >> > python myscript_setup.py py2exe > > > > > >> > Can I co

Raw strings to normal strings conversion?

2007-08-22 Thread Nagarajan
Is there a way by which I could obtain normal string form of a raw string. XML CDATA is returned as raw string. But I need the string to actually escape special chars. Any idea? -- http://mail.python.org/mailman/listinfo/python-list

<    1   2