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

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

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

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

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

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

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

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

Car Air Conditioners!

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

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

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

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

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

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

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

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

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

way to define static method

2007-08-22 Thread Eric CHAO
I think Python uses a very strange way to define static method in a class. Why not make it like this? class MyClass: def my_static_method(self): # self should be None as it's a static method # just ignore self I'm a newcomer so maybe it's quite naive. But I just wonder why it

Re: libgmail failure

2007-08-22 Thread [EMAIL PROTECTED]
On Aug 22, 10:26 am, James Stroud <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hey all, > > > I've been using libgmail to send out automated notification emails for > > my company's nightly regression testing. Last night these emails > > started failing, though the python code has not

Re: libgmail failure

2007-08-22 Thread james.pingenot
On Aug 22, 10:26 am, James Stroud <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hey all, > > > I've been using libgmail to send out automated notification emails for > > my company's nightly regression testing. Last night these emails > > started failing, though the python code has not

Re: redirect or cover .bat log

2007-08-22 Thread vedrandekovic
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 cover or redirect log of that process into my wx program?

Redo: How to create a function dynamically.

2007-08-22 Thread Steven W. Orr
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 ): print 'a = ', a """ co = compile ( strfunc, '', 'exec' ) exe

Impersonate another user temporarily (Unix and Windows)

2007-08-22 Thread billiejoex
Hi there. I'm writing a modification for a FTP server library I'm maintaining. Depending on the system I'd want to temporarily impersonate the logged user to perform actions on filesystem. Something like: try: change_user('user', 'password') os.rmdir('dir') except: print "some error" f

Re: Problems with dynamic function creation.

2007-08-22 Thread Peter Otten
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. Should you need help again, remember post a

Re: Class destruction

2007-08-22 Thread Nils Oliver Kröger
-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 as an instance attribute in one > of my classes and I need to call f.close() on it when the class objec

Re: Free Air Conditioners!!!!!!

2007-08-22 Thread Eric
And $15 shipping to get the "free" paper sent to you! ;^) "Zentrader" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Aug 21, 10:13 pm, "Scott M." <[EMAIL PROTECTED]> wrote: >> Oh my God! How did you know?!! You were so smart to post that here! >> >> <[EMAIL PROTECTED]> wrote

Re: How do I express a backslash in a string?

2007-08-22 Thread Frederick Polgardy
On Aug 22, 1:19 pm, Tobiah <[EMAIL PROTECTED]> wrote: > >>> "'" > "'" > >>> "\'" > "'" > >>> "\\'" > "\\'" > >>> "\\\'" > "\\'" > > This is quite different than any other language > that I am used to. Normally, a double backslash > takes away the special meaning of the last backslash, > and so you

Re: How do I express a backslash in a string?

2007-08-22 Thread Tobiah
Tobiah wrote: "'" > "'" "\'" > "'" "\\'" > "\\'" "\\\'" > "\\'" > > This is quite different than any other language > that I am used to. Normally, a double backslash > takes away the special meaning of the last backslash, > and so you are left with a single backslash.

How do I express a backslash in a string?

2007-08-22 Thread Tobiah
>>> "'" "'" >>> "\'" "'" >>> "\\'" "\\'" >>> "\\\'" "\\'" >>> This is quite different than any other language that I am used to. Normally, a double backslash takes away the special meaning of the last backslash, and so you are left with a single backslash. How do I express the single backslas

Re: Free Air Conditioners!!!!!!

2007-08-22 Thread Zentrader
On Aug 21, 10:13 pm, "Scott M." <[EMAIL PROTECTED]> wrote: > Oh my God! How did you know?!! You were so smart to post that here! > > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > >http://freeairconditioners.blogspot.com/ It's probably a handheld fan made out of a piece of p

Class destruction

2007-08-22 Thread Robert Dailey
Hi, I'm wondering where the most appropriate location is to cleanup class objects. For example, i have a file handle as an instance attribute in one of my classes and I need to call f.close() on it when the class object falls out of scope. Any ideas? I've tried __del__() but I don't remember this

Re: Threads and racing conditions

2007-08-22 Thread Nils Oliver Kröger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Flavio Preto schrieb: > Hi, > > I have a doubt. Supose that i have the minimun class below: > > class db: > def __init__(self): > self.db = {} > def read(self, key): > return self.db[key] > def write(self, key, value): >

Re: Error with long running web spider

2007-08-22 Thread Josh Volz
On Aug 22, 10:58 am, Josh Volz <[EMAIL PROTECTED]> wrote: I'm running this program on Windows XP, using Python 2.5. I'm using Active State Komodo IDE 4.0 as the run environment. Thanks, J. > Hi everyone: > > I have a spider that is relatively long running (somewhere between > 12-24 hours). My

Error with long running web spider

2007-08-22 Thread Josh Volz
Hi everyone: 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 thrown or caught. The program simpl

Re: Regarding Classes

2007-08-22 Thread O.R.Senthil Kumaran
> > What is the main reason of "self" when it involves classes/functions > > > "self" provides a semi-standard way of addressing the current instance > of a class. It is used in an instance's method. It is not typically > used in functions. Btw, you are free to use any other term as well inste

Problems with dynamic function creation.

2007-08-22 Thread Steven W. Orr
I have some functions I need to create at runtime. The way I'm creating them is by calling a function which returns the string representation. Then I exec the string. Here's the code I use to gen the strings: mkfactfns.py --- import new def mkfactfns( cname ): def auxgen( name, para

Re: porting vc++ project to python?

2007-08-22 Thread Matt McCredie
> 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 entirely rewriting it > is actually no o

MsiLib

2007-08-22 Thread Charlie
Hi, 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 fin

Re: What Are These Import/From Statements about?

2007-08-22 Thread Robert Kern
W. Watson wrote: > Is there a single source that explains these statements? http://docs.python.org/tut/node8.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 underl

What Are These Import/From Statements about?

2007-08-22 Thread W. Watson
Is there a single source that explains these statements? -- from Tkinter import * from Numeric import * import Image import ImageChops import ImageTk import time import binascii import tkMessageBox import tkSimpleDialog from tkFileDialog import asksaveasfilename from tk

Re: libgmail failure

2007-08-22 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hey all, > > I've been using libgmail to 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 latest libgmail, but that isn't helping.

Re: Eval and raw string ??

2007-08-22 Thread Matthew Woodcraft
Mark <[EMAIL PROTECTED]> wrote: > Eval() doesn't seem to recognize the r'string' format. Is there a way > around this. > Example: > If I input: -> eval("r'C:\tklll\ndfd\bll'") > I get the output: > > Traceback (most recent call last): > File "", line 1, in > eval("r'C:\tklll\ndfd\bl

Re: Python is removing my quotes!

2007-08-22 Thread Thorsten Kampe
* Gary Herron (Tue, 21 Aug 2007 09:09:13 -0700) > Robert Dailey wrote: > > Note: I'm using Python on Windows > > > > I have an application that allows a user to submit a password as a > > command line parameter. The password of choice may contain any > > characters the user wishes, including quotes

Re: IDE for Python

2007-08-22 Thread Chris Mellon
On 8/21/07, Michael L Torrie <[EMAIL PROTECTED]> wrote: > Ricardo Aráoz wrote: > > Hi, > > Do you know if for in-house development a GPL license applies? (Qt4 > > and/or Eric4). > > If your programs are used in-house and never released, then you don't > have to abide by the terms of the GPL.

Re: Python for web development ...

2007-08-22 Thread marc wyburn
On Aug 22, 5:13 pm, [EMAIL PROTECTED] wrote: > Hi everyone, > > I have to do a web based application for my final year project. Since, > i am only familiar with basic HTML and Java Script, i am totally new > to this one. My friends are using LAMP (P->PHP). But i want to use > Python. Is it possible

Re: instance method questions

2007-08-22 Thread Peter Otten
Danny wrote: > I have created an instance method for an object using new.instancemethod. > It works great. Now the questions are: > > 1) how do I dynamically inspect an object to determine if it has an > instance method? (there is a class method with the same name) Why would you want to do that?

Re: Eval and raw string ??

2007-08-22 Thread Paul McGuire
On Aug 22, 11:06 am, Mark <[EMAIL PROTECTED]> wrote: > Eval() doesn't seem to recognize the r'string' format. Is there a way > around this. > Example: > If I input: -> eval("r'C:\tklll\ndfd\bll'") > I get the output: > > Traceback (most recent call last): > File "", line 1, in > eval

porting vc++ project to python?

2007-08-22 Thread marco Starglider
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 entirely rewriting it is actually no option.

Python for web development ...

2007-08-22 Thread thushianthan15
Hi everyone, I have to do a web based application for my final year project. Since, i am only familiar with basic HTML and Java Script, i am totally new to this one. My friends are using LAMP (P->PHP). But i want to use Python. Is it possible to use Python with Apache and MySQL. Is it possible ?

Re: Eval and raw string ??

2007-08-22 Thread Peter Otten
Mark wrote: > Eval() doesn't seem to recognize the r'string' format. Is there a way > around this. > Example: > If I input: -> eval("r'C:\tklll\ndfd\bll'") > I get the output: > > Traceback (most recent call last): > File "", line 1, in > eval("r'C:\tklll\ndfd\bll'") > File "", l

Re: Eval and raw string ??

2007-08-22 Thread Frederick Polgardy
On Aug 22, 11:06 am, Mark <[EMAIL PROTECTED]> wrote: > Eval() doesn't seem to recognize the r'string' format. Is there a way > around this. > Example: > If I input: -> eval("r'C:\tklll\ndfd\bll'") > I get the output: > > Traceback (most recent call last): > File "", line 1, in > eval

Re: Server-side scripting in python

2007-08-22 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Nagarajan <[EMAIL PROTECTED]> wrote: >> >> . >> . >> . >Let me phrase my problem in a finer way. >I have done simple projects in python. >I wanted to explore web programming facet of python. The

Re: IDE for Python

2007-08-22 Thread vdicarlo
> Have you tried SPE? I don't know how it compares to PyDev but SPE is > pretty slick. It has several other tools integrated into it, > including a pretty nice debugger. After trying Eclipse and SPE, I'm back to using VIM and the Winpdb debugger, which is the "pretty nice debugger" in SPE, and w

Eval and raw string ??

2007-08-22 Thread Mark
Eval() doesn't seem to recognize the r'string' format. Is there a way around this. Example: If I input: -> eval("r'C:\tklll\ndfd\bll'") I get the output: Traceback (most recent call last): File "", line 1, in eval("r'C:\tklll\ndfd\bll'") File "", line 1 r'C:klll

Re: instance method questions

2007-08-22 Thread Frederick Polgardy
On Aug 22, 10:23 am, Danny <[EMAIL PROTECTED]> wrote: > 1) how do I dynamically inspect an object to determine if it has an instance > method? (there is a class method with the same name) class Foo: def foo(self): pass x = Foo() import types >>> isinstance(x.foo, types.MethodType) T

SpreadsheetML writer??

2007-08-22 Thread Ellinghaus, Lance
Does anyone have or know of a module to write out Excel spreadsheets in SpreadsheetML format? Thank you, lance Lance Ellinghaus -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >