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
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
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.
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
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
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
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
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
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
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__
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")
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
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
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
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
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
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
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
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
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
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.
>
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.
>
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.
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
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
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
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
I just downloaded it yesterday, and it was very fast.
Donnal Walter
Arkansas Children's Hospital
--
http://mail.python.org/mailman/listinfo/python-list
Congratulations!
Laura
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
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
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
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
*
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
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
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
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
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
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
> 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
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
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
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
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
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,
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
[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
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.
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
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
"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
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.
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
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
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
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
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
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
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
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:
---
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
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
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
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
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
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
"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
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,
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
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
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
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')
"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
Got it, thanks :)
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
"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
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
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
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
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
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
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:
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
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
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
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"
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
[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 - 100 of 179 matches
Mail list logo