Re: Python in debug version?

2004-12-07 Thread mep
Hi, There is a columen named "Debug" for python.exe and python23.dll."Yes" is there. And if you open python.exe or python23.dll, you'll see: C:\sf\python\dist23\src\PCbuild\python.pdb at the tail of file.That means a debug version? -- Best Regards, Wang Kebo http://www.huihoo.org/~mep "M

Re: Trying to understand a little python

2004-12-07 Thread Nick Coghlan
McCarty, Greg wrote: Ok, I'm new to python, and I'm trying to come to grips with a few things. Got lots of years of experience with Java and asp/aspx, etc. Trying to relate Python's behavior to what I already know. You may find the following a useful overview of how class & instance attributes wo

Re: Trying to understand a little python

2004-12-07 Thread John Thingstad
On Tue, 07 Dec 2004 19:07:42 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: McCarty, Greg wrote: Ok, I'm new to python, and I'm trying to come to grips with a few things. Got lots of years of experience with Java and asp/aspx, etc. Trying to relate Python's behavior to what I already know.

Re: cut strings and parse for images

2004-12-07 Thread Andreas Volz
Am Tue, 07 Dec 2004 00:40:02 GMT schrieb Paul McGuire: > Is this in the ballpark of where you are trying to go? Yes, thanks. You helped me a lot. Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: [pywin32] windows shares, was os.listdir("\\\\delta\\public")

2004-12-07 Thread Dermot Doran
Hi Tim, Something like this is what I think you are looking for: from win32com.client import Dispatch theNetwork = Dispatch("WScript.Network") mappedNetDrives = theNetwork.EnumNetworkDrives for netDrive in mappedNetDrives(): print netDrive Should give you some ideas anyway. Cheers!! On 6 Dec

Re: long number multiplication

2004-12-07 Thread Nick Coghlan
Christopher A. Craig wrote: i needed to implement this myself and was thinking of storing the digits of an integer in a list. That's sort of what Python does except the "digits" are 15 bits, not base 10. Doing it in base 10 would be a huge pain because of the problems with base 10->base 2 conver

Re: RPC with Python - Comparison?

2004-12-07 Thread Wolfgang Keller
Am 6 Dec 2004 16:00:35 -0800 schrieb has: > Wolfgang Keller wrote: > >>> MacPython also supports Apple events >> >> I know, but I was thinking of OS-independent RPC protocols. :-) > Pity, you're missing some good stuff... :/ _I_ _am_ using a Mac at home. But not _everyone_ _else_ and especially

How to Refresh a Page Template using python in zope server

2004-12-07 Thread ganesh9001892
hai, I have a problem while refreshing the stored contents from zope database(zodb).java script command location.reload() doesnot work out.Is there any other way to refresh the page waiting for a Reply From, S.GANESH -- http://mail.python.org/mailman/listinfo/python-list

Re: Deadlock detection

2004-12-07 Thread Duncan Grisby
In article <[EMAIL PROTECTED]>, Josiah Carlson <[EMAIL PROTECTED]> wrote: > >Duncan Grisby <[EMAIL PROTECTED]> wrote: >> Does anyone know of a deadlock detector for Python? I don't think it >> would be too hard to hook into the threading module and instrument >> mutexes so they can be tested for

Re: Help with super()

2004-12-07 Thread Florian Lindner
Steven Bethard schrieb: Christopher J. Bottaro wrote: Why don't this code work? import PRI class Poscdnld_PYIO(PRI.BasicBatch): def __init__(self, *argv): super(Poscdnld_PYIO, self).__init__(*argv) x = Poscdnld_PYIO() I get this exception: File "poscdnld_pyio.py", line 52, in __init__

Re: Win32 Libs for 2.4

2004-12-07 Thread Robin Becker
Martin v. Löwis wrote: Robin Becker wrote: I thought that static .libs didn't make reference to the dll's they need; isn't that done at load time? Unfortunately, thanks to Microsoft's infinite wisdom, static libs *do* reference DLLs. The C lib headers contain things like #pragma lib("msvcrt.lib")

win32 extensions for Python 2.4

2004-12-07 Thread Ishwor
Hello all, I was looking through Mark Hammond's website for win32 extensions for Python 2.4 but couldn't find it. If i am not wrong has anyone any idea when it will be available or is it being worked on? The activestate's version of Python has win32 extension but i won't be bothered to download i

Re: win32 extensions for Python 2.4

2004-12-07 Thread Simon Brunning
On Tue, 7 Dec 2004 21:25:03 +1030, Ishwor <[EMAIL PROTECTED]> wrote: > Hello all, > I was looking through Mark Hammond's website for win32 extensions > for Python 2.4 but couldn't find it. If i am not wrong has anyone any > idea when it will be available or is it being worked on? The > activestat

Re: win32 extensions for Python 2.4

2004-12-07 Thread Nick Coghlan
Ishwor wrote: Hello all, I was looking through Mark Hammond's website for win32 extensions for Python 2.4 but couldn't find it. If i am not wrong has anyone any idea when it will be available or is it being worked on? The activestate's version of Python has win32 extension but i won't be bothered

Re: win32 extensions for Python 2.4

2004-12-07 Thread Ishwor
On Tue, 07 Dec 2004 21:00:22 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Ishwor wrote: > > > > Hello all, > > I was looking through Mark Hammond's website for win32 extensions > > for Python 2.4 but couldn't find it. If i am not wrong has anyone any > > idea when it will be available or is

Upgrading Python Article

2004-12-07 Thread Michael Foord
http://www.voidspace.org.uk/python/articles/upgrading_python.html I've been looking at whether to upgrade immediately from Python 2.3 to Python 2.4 or postpone it. This is my first `major version change`, so I've come up against the usual windoze (tm) problem - upgrading python breaks all my exten

Re: pre-PEP generic objects

2004-12-07 Thread Jacek Generowicz
Carlos Ribeiro <[EMAIL PROTECTED]> writes: > On 06 Dec 2004 10:09:25 +0100, Jacek Generowicz > <[EMAIL PROTECTED]> wrote: > [great explanation about function descriptors] > > Thanks. Now I know more about function descriptors than I ever wanted > to :-) With a little polish, Yeah, replace the tw

Re: Python in debug version?

2004-12-07 Thread Wolfgang Langner
Hello, Hi, There is a columen named "Debug" for python.exe and python23.dll."Yes" is there. And if you open python.exe or python23.dll, you'll see: C:\sf\python\dist23\src\PCbuild\python.pdb at the tail of file.That means a debug version? No, that means to this file are debug symbols available

Re: regex syntax

2004-12-07 Thread James Stroud
Ich kann nicht spricht Deutch, aber: import re regex = re.compile(r'(.*)(\.jpg)$') m = regex.match("bild.jpg") g = m.groups() print g[0] print g[1] Auf wiedersehen! James On Monday 06 December 2004 04:03 pm, Andreas Volz wrote: > Hi, > > ich kann nicht gut regex, aber für das nötigste reich

Re: regex syntax

2004-12-07 Thread jstroud
Ich kann nicht spricht Deutch, aber: import re regex = re.compile(r'(.*)(\.jpg)$') m = regex.match("bild.jpg") g = m.groups() print g[0] print g[1] Auf wiedersehen! James On Monday 06 December 2004 04:03 pm, Andreas Volz wrote: > Hi, > > ich kann nicht gut regex, aber für das nötigste reich

Re: RPC with Python - Comparison?

2004-12-07 Thread has
Wolfgang Keller wrote: > Am 6 Dec 2004 16:00:35 -0800 schrieb has: > > > Wolfgang Keller wrote: > > > >>> MacPython also supports Apple events > >> > >> I know, but I was thinking of OS-independent RPC protocols. :-) > > Pity, you're missing some good stuff... :/ > > _I_ _am_ using a Mac at home. >

Re: RPC with Python - Comparison?

2004-12-07 Thread has
Wolfgang Keller wrote: > Am 6 Dec 2004 16:00:35 -0800 schrieb has: > > > Wolfgang Keller wrote: > > > >>> MacPython also supports Apple events > >> > >> I know, but I was thinking of OS-independent RPC protocols. :-) > > Pity, you're missing some good stuff... :/ > > _I_ _am_ using a Mac at home. >

Re: regex syntax

2004-12-07 Thread Daniel Dittmar
Andreas Volz wrote: string = "bild.jpg" ich möchte jetzt einfach wissen ob in dem string ein ".jpg" vorkommt oder nicht und dann eine Entscheidung treffen. Ich hab mir schon überlegt einfach die letzten viel Stellen des strings "per Hand" auf die Zeichenfolge zu vergleichen und so regex zu umgehen.

Problems getting TwistedMatrix

2004-12-07 Thread Lucas Raab
Has anybody who has recently downloaded Twisted seem to have any problems with downloading it?? I'm a dial-up user (which might be why) and whenever I click the link to download it it takes 30+ for a 1.8 MB file, which should take only about 7-10. -- http://mail.python.org/mailman/listinfo/pytho

Unknown locale nb_NO ?

2004-12-07 Thread Stas Z
Hello, Just noticed that the locale 'nb_NO' is not supported in Python?! [EMAIL PROTECTED]:~$ locale LANG=nb_NO [...] [EMAIL PROTECTED]:~$ python Python 2.3.4 (#2, Sep 24 2004, 08:39:09) [GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2 Type "help", "copyright", "credits" or "license" for more informat

Re: Help with super()

2004-12-07 Thread Andy Gross
Florian, See: http://www.python.org/doc/newstyle.html /arg On Dec 7, 2004, at 5:38 AM, Florian Lindner wrote: Steven Bethard schrieb: Christopher J. Bottaro wrote: Why don't this code work? import PRI class Poscdnld_PYIO(PRI.BasicBatch): def __init__(self, *argv): super(Poscdnld_PYIO, s

Re: Unknown locale nb_NO ?

2004-12-07 Thread Ola Natvig
Stas Z wrote: Hello, Just noticed that the locale 'nb_NO' is not supported in Python?! [EMAIL PROTECTED]:~$ locale LANG=nb_NO [...] [EMAIL PROTECTED]:~$ python Python 2.3.4 (#2, Sep 24 2004, 08:39:09) [GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2 Type "help", "copyright", "credits" or "license" for mo

Re: Problems getting TwistedMatrix

2004-12-07 Thread donnal
I just downloaded it yesterday, and it was very fast. Donnal Walter Arkansas Children's Hospital -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Wing IDE 2.0.1 released

2004-12-07 Thread Laura Creighton
Congratulations! Laura -- http://mail.python.org/mailman/listinfo/python-list

cookie lib policy how-tp?

2004-12-07 Thread Riko Wichmann
dear all, i try to retrieve information from a secure web site. I use cookielib and urllib2 for this exercise which works to a certain level. I can authenticate myself and read the top-level page. However, from here I need to load a page which is dynamically build from information available fro

Re: Problems getting TwistedMatrix

2004-12-07 Thread Donnal Walter
Lucas Raab wrote: Has anybody who has recently downloaded Twisted seem to have any problems with downloading it?? I'm a dial-up user (which might be why) and whenever I click the link to download it it takes 30+ for a 1.8 MB file, which should take only about 7-10. I just downloaded Twisted yest

Re: using cmd.exe as a telnet client

2004-12-07 Thread Jp Calderone
On Mon, 06 Dec 2004 12:52:31 -0600, Donnal Walter <[EMAIL PROTECTED]> wrote: >I wrote: > > I've been wanting to get acquainted with Twisted for awhile > > now, ... BTW, do you know if Twisted's option negotiation > > uses a callback function? I might download it to take a look, ... > > Sorry I did

Loading a file only once into an object and being able to access it from other modules

2004-12-07 Thread Philippe C. Martin
This is a basic question I'm sure but I do not know wether to use __builtin__, global, or a static method: I have a very large XML file that I load into dictionnaries defined in a class located in a module that is imported in many places. Since the loading process is very slow, I would like th

Re: Loading a file only once into an object and being able to access it from other modules

2004-12-07 Thread Remy Blank
Philippe C. Martin wrote: > I have a very large XML file that I load into dictionnaries defined in a > class > located in a module that is imported in many places. > > Since the loading process is very slow, I would like the file not to be > loaded > on import or class instantiation, but only

Re: Loading a file only once into an object and being able to access it from other modules

2004-12-07 Thread Thomas Guettler
Am Tue, 07 Dec 2004 09:25:57 -0600 schrieb Philippe C. Martin: > This is a basic question I'm sure but I do not know wether to use > __builtin__, > global, or a static method: > > I have a very large XML file that I load into dictionnaries defined in a > class > located in a module that is i

Re: Loading a file only once into an object and being able to access it from other modules

2004-12-07 Thread Andrew James
You're looking for the Singleton pattern to ensure that only one instance of your class is instantiated at a time. There's a particularly useful discussion about this at: http://c2.com/cgi/wiki?PythonSingleton I suggest you try the different methods out and pick the one best suited to your situ

Re: Unknown locale nb_NO ?

2004-12-07 Thread Stas Z
On Tue, 07 Dec 2004 15:22:00 +0100, Ola Natvig wrote: > Stas Z wrote: >> Hello, >> >> Just noticed that the locale 'nb_NO' is not supported in Python?! >> [...] > I believe the standard locale for "Norsk bokmål" is 'no_NO'. You could > try that. When I 'googled' for it, I saw that no_NO has bec

Re: cookie lib policy how-tp?

2004-12-07 Thread Jonathan Ellis
Riko Wichmann wrote: > > When I use opera to access this page by hand and look at the sources, I > see the full sources when letting opera identify itself as MSIE 6.0. > When using Mozilla 5.0 I get the same in-complete source file as with > python. Sounds like your first step should be to identi

Re: regex syntax

2004-12-07 Thread Andreas Volz
Am Mon, 6 Dec 2004 17:24:35 -0800 (PST) schrieb [EMAIL PROTECTED]: > Ich kann nicht spricht Deutch, aber: Ahh! Sorry for this! It was a mistake :-( regards Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: regex syntax

2004-12-07 Thread Andreas Volz
Am 6 Dec 2004 17:43:21 -0800 schrieb [EMAIL PROTECTED]: > viel besser als das vergleichbare Regexp: > > >>> re.match('.*\.jpg$', filename) Ok,now I've choosen this regex: > '.*\.(?i)jpe?g' to get .jpg .JPG .jpeg .JPEG seems to work. Is this correct? regards Andreas -- http://mail.python.or

Re: cookie lib policy how-tp?

2004-12-07 Thread Riko Wichmann
Jonathan Ellis wrote: Riko Wichmann wrote: When I use opera to access this page by hand and look at the sources, I see the full sources when letting opera identify itself as MSIE 6.0. When using Mozilla 5.0 I get the same in-complete source file as with python. Sounds like your first step should

Re: Loading a file only once into an object and being able to access it from other modules

2004-12-07 Thread Philippe C. Martin
Thank you all for your answers, I guess I would not have made Python 101:-) As far as I was concerned, importing a module twice would have resulted in loading the file twice. Regards, Philippe -- * Philippe C. Martin SnakeCard LLC www.snakecard.com *

TwistedMatrix everywhere!!

2004-12-07 Thread Ishwor
Hello all, Since i see alot of talks abt TwistedMatrix these days, i just checked its website to see what it is all about ( I am still learning Python). Anyway my point here is that for running the examples ( in http://twistedmatrix.com/documents/current/examples/ ), I'll have to get the various

Re: embedded python and interpreter threads

2004-12-07 Thread Charlie DeTar
Woohoo, fixed my problem. It had to do with the way I was handling the methods which overwrote stderr and stdout. Yeehaw! =Charlie Charlie DeTar wrote: Quick correction, sorry - the command should read like this (I had omitted the "log" before 'CaptureStdout' and 'CaptureStderr'). Same probl

Re: How is Python designed?

2004-12-07 Thread Diez B. Roggisch
Hi, > it is executed. In this technique, indeed, checking > patterns is a little complicated. In Yuan this part is > not optimally implemented, somethings have to be > improved or changed. why did you choose that technique and not a common parser generator? The kind of parsing you use is somewhat

PythonWin32 issue with McMillan Installer (6a2) and WMI

2004-12-07 Thread bschollnick
Folks, I have run into a strange problem, that I have not been able to solve. I have previously "bundled" this application with Installer successfully. Just recently though, I tried, and ran into a issue. Yes, I have made changes, but nothing I would expect this level of issue with... Mainly upg

Re: httpconnection class handle 302 redirect?

2004-12-07 Thread Laszlo Zsolt Nagy
Hello Joe, Tuesday, December 7, 2004, 3:50:53 AM, you wrote: > Hi , it looks like that HTTPConnection class is not capable to > handle 302 redirect response. Is there any sample implementation > that tackle this problem? I am using python 2.3.3 on Windows > platform. I'm using this method (ins

Re: Quixote+Nevow+LivePage

2004-12-07 Thread mirnazim
I am really sorry if i sounded a bit bad, i did not mean that. what i meant was that , i got my answer to Q2 that livepage is for twisted only. but Q1 and Q2 still stand. I m sorry again. -- http://mail.python.org/mailman/listinfo/python-list

Re: Time for : comp.lang.python.newbies ??

2004-12-07 Thread James Stroud
> Maybe a time for a new discussion group along that suggested > by the Subject line ? I would hesitate to change too much about this list. I spend about 1 hr. per day (probably too much) perusing the technical explanations, musings, and rants--and hoping to learn enough to reply with an answe

Re: Time for : comp.lang.python.newbies ??

2004-12-07 Thread Steven Bethard
James Stroud wrote: As far as lists go, this is my favorite, and I've subscribed to lists in a variety of fields. I'm afraid that scaring off newbies would remove some of the charm of this list. Amen. =) And anyway, with a good newsreader, you can just ignore any threads that are too "newbie" fo

Re: using cmd.exe as a telnet client

2004-12-07 Thread Donnal Walter
Jp Calderone wrote: The iac_FOO method will be called whenever the telnet command FOO is received with the command's "argument" (the byte following it) as its only argument. When a subnegotiation is received, iacSBchunk is called. That's the 1.3 API, anyway. It will still exist in 2.0, but it i

Re: Deadlock detection

2004-12-07 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Duncan Grisby <[EMAIL PROTECTED]> writes understood, and there are plenty of systems that do it. I just haven't been able to find one for Python. There is one at http://www.softwareverify.com as I mentioned in a previous posting. Stephen -- Stephen Kellett Object

Webapp servers & security

2004-12-07 Thread Anakim Border
App servers such as quixote, webware and skunkweb (just to name a few) offer a clean environment to develop Python webapps. I have some problems, however, understanding their security model. My objective is to host webapps from different people on a single Linux server; because of that, I want to

ming for python

2004-12-07 Thread titouille
Hello everybody !! anyone has try to build ming0.3beta1 for python 2.3.3 under windows ?? Since three days, I try to build it with mingw32, and finally, I am stopped with C declarations error in src/actioncompiler/swf4compiler.y If anyone has build with success ming (mingc.pyd) for python 2.3.3,

Re: Time for : comp.lang.python.newbies ??

2004-12-07 Thread Ron Phillips
Speaking for the newbies (or that segment of them who aren't asking you to do their homework/job/googling for them):   The trouble is, we don't know whether we can't find information(X) because: "X" is not the term "knowbies" use for the concept, or because: information(X) is rare due to the

Re: Webapp servers & security

2004-12-07 Thread Alan Kennedy
[Anakim Border] > App servers such as quixote, webware and skunkweb (just to name a > few) offer a clean environment to develop Python webapps. I have some > problems, however, understanding their security model. Since they each have different security models, that's not surprising. This is a dif

Re: Loading a file only once into an object and being able to access it from other modules

2004-12-07 Thread Peter Hansen
Philippe C. Martin wrote: Thank you all for your answers, I guess I would not have made Python 101:-) As far as I was concerned, importing a module twice would have resulted in loading the file twice. Background on that: importing the module the first time causes the code in it to be executed (i.

Find index of item in list

2004-12-07 Thread Sean Berry
Given myList = ['cat', 'dog', 'mouse' ... 'bear'] what is the easiest way to find out what index 'dog' is at? -- http://mail.python.org/mailman/listinfo/python-list

Re: Find index of item in list

2004-12-07 Thread wes weston
Sean Berry wrote: Given myList = ['cat', 'dog', 'mouse' ... 'bear'] what is the easiest way to find out what index 'dog' is at? Sean, >>> myList = ['cat', 'dog', 'mouse','bear'] >>> myList.index('dog') 1 >>> wes -- http://mail.python.org/mailman/listinfo/python-list

Re: Unknown locale nb_NO ?

2004-12-07 Thread Richard Brodie
"Stas Z" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > However it strikes me as odd, that Python2.3.4 raises an exception when > querying for a valid locale. I tend to call it a bug :-( File one in the bug tracker, then, and it might get fixed. -- http://mail.python.org/mailma

Re: Win32 Libs for 2.4

2004-12-07 Thread "Martin v. Löwis"
Robin Becker wrote: I don't think this forces the linker to load stuff from this module although I can see that it might be dangerous depending on which obj files are seen first. I think you are wrong. In the object, there will be simply a linker command line option encoded; do "dumpbin /all foo.

Re: finding byte order

2004-12-07 Thread biner . sebastien
Scott David Daniels wrote: > biner wrote: > > I am using a program that has to read binary data from files coming > > from different machines. The file are always written with big endian. > > Diez B. Roggisch wrote: > [Scott David Daniels wrote] > >>How about sys.byteorder? > > This doesn't h

I need to create the table and I want to edit its content from www level.

2004-12-07 Thread Rootshell
Hi. Yes, the 'Tabla' concept seems to be very helpful. I need few days to instal and try it. Thank you very much. Greetings. Rootshell -- http://mail.python.org/mailman/listinfo/python-list

New experiences with PythonForDelphi

2004-12-07 Thread Caleb Hattingh
Hi all I hadn't checked PythonForDelphi in a while, and decided to again today. All I can say is *wow*. Those guys are doing a terrific job. For those of you with a pascal background (and a Delphi/Kylix licence), you may want to check it out. In particular, the creation of binary addons/m

Re: Find index of item in list

2004-12-07 Thread Steven Bethard
wes weston wrote: Sean Berry wrote: myList = ['cat', 'dog', 'mouse' ... 'bear'] what is the easiest way to find out what index 'dog' is at? >>> myList = ['cat', 'dog', 'mouse','bear'] >>> myList.index('dog') 1 >>> Yup, list.index is almost certainly what you want, though it's worth mentioning t

Re: How is Python designed?

2004-12-07 Thread Limin Fu
Hi, > why did you choose that technique and not a common > parser generator? The Because I didn't know the standard parse technique when I started to implement Yuan :) > kind of parsing you use is somewhat oldfashioned - > back in the times where > parsing theory wasn't evolved enough. The > dis

error on crude test of embedding python in c++ HELP PLEASE

2004-12-07 Thread Donnie Leen
I wrote a program to test calling c function from python code embedding in c as following, it cause error after running a while(about 398 circle). I test it in msvc6, python2.3, windows 2k, could anyone tell me why this happened since i just work according to the document? Thanks first. Donnie Le

PIL for Windows for Python 2.4

2004-12-07 Thread Scott F
As there is no build for Python 2.4, I attempted to put it together from source. Running setup.py build gives this error: Traceback (most recent call last): File "C:\tmp\PIL\Imaging-1.1.4\setup.py", line 60, in ? for line in open(os.path.join("libImaging", "ImConfig.h")).readlin

Import a module without executing it?

2004-12-07 Thread Jay O'Connor
Is there a good way to import python files without executing their content? I'm trying some relfection based stuff and I want to be able to import a module dynamically to check it's contents (class ad functions defined) but without having any of the content executed. For example: ---

Re: Unknown locale nb_NO ?

2004-12-07 Thread StasZ
On Tue, 07 Dec 2004 19:19:42 +, Richard Brodie wrote: > > "Stas Z" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >> However it strikes me as odd, that Python2.3.4 raises an exception when >> querying for a valid locale. I tend to call it a bug :-( > > File one in the bug tra

Sorting in huge files

2004-12-07 Thread Paul
Hi all I have a sorting problem, but my experience with Python is rather limited (3 days), so I am running this by the list first. I have a large database of 15GB, consisting of 10^8 entries of approximately 100 bytes each. I devised a relatively simple key map on my database, and I would like to

Re: ming for python

2004-12-07 Thread Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle.
Ha ! Ha ! Tu tentes la coup de l'émigration ? J'espère que ça marchera... -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

writing to mailboxes

2004-12-07 Thread Eric S. Johansson
I've been searching around for the equivalent to the mailbox module except with the capability of writing messages as well as reading. If it makes it easier, I only need to write to maildir mailboxes. I found a reference to http://pythonms.sf.net/ Python mail system) but it seems to have vanis

Re: Webapp servers & security

2004-12-07 Thread Istvan Albert
Anakim Border wrote: few) offer a clean environment to develop Python webapps. I have some problems, however, understanding their security model. Did I miss anything? They don't have a security model. AFAIK only Zope has. Istvan. -- http://mail.python.org/mailman/listinfo/python-list

How do I do this? (eval() on the left hand side)

2004-12-07 Thread It's me
I am new to the Python language. How do I do something like this: I know that a = 3 y = "a" print eval(y) would give me a print out of 3 - but how do I do something to the effect of: eval(y) = 4# hopefully the value of a gets changed to 4 ?? Thanks, -- It's me -- http

Re: error on crude test of embedding python in c++ HELP PLEASE

2004-12-07 Thread Thomas Heller
"Donnie Leen" <[EMAIL PROTECTED]> writes: > I wrote a program to test calling c function from python code embedding in c > as following, it cause error after running a while(about 398 circle). I > test it in msvc6, python2.3, windows 2k, could anyone tell me why this > happened since i just work

Re: Import a module without executing it?

2004-12-07 Thread Caleb Hattingh
Hi You could just parse the model file. Off the top of my head *** f = open('ModuleYouWantToExamine.py','r') for i in f: if i.find('def ') > -1: print 'Found a function!: '+i.replace('def ','') f.close() *** You would have to build this up for a more complete examination. Of course,

Re: [BUG] IMO, but no opinions? Uncle Tim? was: int(float(sys.maxint)) buglet ?

2004-12-07 Thread Bengt Richter
On Mon, 6 Dec 2004 10:30:06 -0500, Tim Peters <[EMAIL PROTECTED]> wrote: >[Bengt Richter] >> Peculiar boundary cases: >> >> >>> 2.0**31-1.0 >> 2147483647.0 >> >>> int(2147483647.0) >> 2147483647L >> >>> int(2147483647L ) >> 2147483647 >> >>> >> >>> -2.0**31 >> -2147483648.0 >> >>> int(-2147483648

Re: Import a module without executing it?

2004-12-07 Thread Andy Gross
You'll want to use the "compiler" package. compiler.parseFile will return an AST that you can inspect (which is not really 'reflection', btw). /arg On Dec 7, 2004, at 10:56 PM, Caleb Hattingh wrote: Hi You could just parse the model file. Off the top of my head *** f = open('ModuleYouWantToExa

Re: How do I do this? (eval() on the left hand side)

2004-12-07 Thread Caleb Hattingh
Hi It's me a = 3 y = "a" print eval(y) To get 'a' to be 4 here, you would say a = 4 I am not sure why you would want to do otherwise? Perhaps you could sketch out a little more about what you are trying to do? That would help a lot. Are you aiming for something like point

Re: Import a module without executing it?

2004-12-07 Thread Caleb Hattingh
Andy thx for that. I had a file called 'tktest.py' lying around, and I did: '>>> a = compiler.parseFile('tktest.py') And "a" looks something like this: *** Stmt([Import([('Tkinter', None)]), Function(None, 'add_rows', ['w', 'titles', 'rows'], [], 0, None, Stmt([Discard(CallFunc(Getattr(Name('w')

Re: How do I do this? (eval() on the left hand side)

2004-12-07 Thread It's me
"Caleb Hattingh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi It's me > > > > > a = 3 > > y = "a" > > print eval(y) > > > > To get 'a' to be 4 here, you would say > > a = 4 > Obviously but that's not what I wish to do. > I am not sure why you would want to do othe

Re: error on crude test of embedding python in c++ HELP PLEASE

2004-12-07 Thread Donnie Leen
Got it, thanks :) -- http://mail.python.org/mailman/listinfo/python-list

sys.stdin.read question

2004-12-07 Thread It's me
Why do I get an "AttributeError: read" message when I do: import sys r=sys.stdin.read() ?? I've tried: r=sys.stdin.read(80) r=sys.stdin.read(1) same error message. I couldn't find any reference to this function in my Python book (they have the stdout but not in). Some sample

Re: Import a module without executing it?

2004-12-07 Thread Andy Gross
Here's a quick example that will pull out all functions defined in the top-level of a module: --- #/usr/bin/env python from compiler import parse, walk from compiler.visitor import ASTVisitor testdata = r''' def aFunction(anArg): return anArg + 1 ''' class SimpleVisitor(ASTVisitor): def v

Re: Import a module without executing it?

2004-12-07 Thread Steven Bethard
Jay O'Connor wrote: -- def test(var): print var #main test(3) -- I want to be able to import this module so I can see "ah ha, this module defines a function called 'test'", but I don't want the code at the bottom executed during the import. If you have

Re: How do I do this? (eval() on the left hand side)

2004-12-07 Thread Caleb Hattingh
Sure, ok, I think I am with you now. You get a (e.g.) variable name as a string, and you KNOW how to evaluate it with "eval", but you also want to be able to assign back to (through) the string representation? One way (if I understand you correctly) is with the globals or locals dicts. Try

Re: How do I do this? (eval() on the left hand side)

2004-12-07 Thread Russell Blau
"It's me" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > In REXX, for instance, one can do a: > > interpret y' = 4' > > Since y contains a, then the above statement amongs to: > > a = 4 > > There are many situations where this is useful. For instance, you might be > getti

Re: How do I do this? (eval() on the left hand side)

2004-12-07 Thread Erik Max Francis
It's me wrote: In REXX, for instance, one can do a: interpret y' = 4' Since y contains a, then the above statement amongs to: a = 4 The direct equivalent in Python would be a = 3 y = 'a' exec '%s = 4' % y The better question would be whether or not this as useful as

Re: Import a module without executing it?

2004-12-07 Thread Andy Gross
On Dec 7, 2004, at 4:20 PM, Steven Bethard wrote: If you have source control over this file, you could write it with the more standard idiom... I should have mentioned this first. If you're just trying to avoid existing top-level code from being executed, use the if __name__ == "__main__" idiom

Re: sys.stdin.read question

2004-12-07 Thread Grant Edwards
On 2004-12-07, It's me <[EMAIL PROTECTED]> wrote: > Why do I get an "AttributeError: read" message when I do: > > import sys > r=sys.stdin.read() Dunno. Works fine for me under 2.3.4, and according to the docs, should work under 2.4. What do you get when you do this: import sys type(sy

Re: Import a module without executing it?

2004-12-07 Thread finite . automaton
Functions and classes are created during the very execution you're trying to skip so there's no precise way to do what you want. That said, you can parse the code without executing it, and that will give you some information about defined functions and classes. It will _not_ give you actual funct

Re: How do I do this? (eval() on the left hand side)

2004-12-07 Thread Craig Ringer
On Wed, 2004-12-08 at 05:12, It's me wrote: > There are many situations where this is useful. For instance, you might be > getting an input which is a string representing the name of a variable and > you wish to evaluate the expression (like a calculator application, for > instance). While I do

Re: sys.stdin.read question

2004-12-07 Thread Caleb Hattingh
Hi You are probably typing this within IDLE. Try it after starting python in a shell like DOS or Bash. Should work then (works for me, and I also get the AttributeError in IDLE. Thanks Caleb On Tue, 07 Dec 2004 21:15:51 GMT, It's me <[EMAIL PROTECTED]> wrote: Why do I get an "AttributeError:

Re: Sorting in huge files

2004-12-07 Thread Steven Bethard
Paul wrote: I expect a few repeats for most of the keys, and that s actually part of what I want to figure out in the end. (Said loosely, I want to group all the data entries having "similar" keys. For this I need to sort the keys first (data entries having _same_ key), and then figure out which ke

Re: sys.stdin.read question

2004-12-07 Thread Caleb Hattingh
It runs properly in a shell (bash), but on another matter: '>>> r=sys.stdin.read(1) g '>>> r 'g' '>>> r=sys.stdin.read(5) 1234567890 '>>> r '\n1234' '>>> What exactly happened to my 1234567890? I understand that I am only taking 5 characters, but where does the newline (\n) come from? Is that a

Re: How do I do this? (eval() on the left hand side)

2004-12-07 Thread Steven Bethard
It's me wrote: How do I do something like this: I know that a = 3 y = "a" print eval(y) would give me a print out of 3 - but how do I do something to the effect of: eval(y) = 4# hopefully the value of a gets changed to 4 Generally, if you find yourself doing this, you may want t

Re: How do I do this? (eval() on the left hand side)

2004-12-07 Thread It's me
Yes, Russell, what you suggested works. I have to chew more on the syntax to see how this is working. because in the book that I have, it says: exec code [ in globaldict [, localdict] ] ... -- It's me "Russell Blau" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "It's me"

Re: Sorting in huge files

2004-12-07 Thread Paul
I really do need to sort. It is complicated and I haven't said why, but it will help in finding similar keys later on. Sorry I can't be more precise, this has to do with my research. Your two other suggestions with itertools and operator are more useful, but I was mostly wondering about performanc

Re: [BUG] IMO, but no opinions? Uncle Tim? was: int(float(sys.maxint)) buglet ?

2004-12-07 Thread Tim Peters
[Tim Peters] >> ... there's no promise anywhere, e.g., that Python will return an int >> whenever it's physically possible to do so. [Bengt Richter] > Ok, I understand the expediency of that policy, but what is now the meaning > of int, in that case? Is it now just a vestigial artifact on the way

  1   2   >