[EMAIL PROTECTED] wrote:
So is the support of Unicode in virtually every computer language
because they don't support ... digits except 0..9.
Hex digits aren't 0..9.
Python 2.4 (#2, Dec 3 2004, 17:59:05)
[GCC 3.3.5 (Debian 1:3.3.5-2)] on linux2
Type help, copyright, credits or license for more
Tim Roberts wrote:
Stephen Thorne [EMAIL PROTECTED] wrote:
I would actually like to see pychecker pick up conceptual errors like this:
import datetime
datetime.datetime(2005, 04,04)
Why is that a conceptual error? Syntactically, this could be a valid call
to a function. Even if you have parsed
[EMAIL PROTECTED] wrote:
Anybody know a way to control the mouse pointer
(move it around and click on things) using python?
It depends on your operating system. For Windows, you'll want to use a
Python module to access the Win32 API. The relevant API function is
documented at
Kevin Smith wrote:
I have many cases in my code where I use a property for calculating a
value on-demand. Quite a few of these only need to be called once.
After that the value is always the same. In these properties, I set a
variable in the instance as a cached value and return that value
I'm writing a relatively simple multi-user public Web application with
Python. It's a rewrite of a similar application which used PHP+MySQL
(not particularly clean code, either). My opinions on various Web
frameworks tends to vary with the phase of the moon, but currently, I'm
planning to use
Robert Brewer wrote:
Try svn://casadeamor.com/dejavu/trunk if you want a truly Pythonic query
syntax. Wait a couple of days, and I'll have version 1.3 ready and
online at http://www.aminus.org/rbre/python -- lots of changes from
1.2.6 which is there now, but at least you can read old docs online
John Hunter wrote:
del locals()['x']
The locals() dictionary will only modify values in a module's top-level
code (i.e. when the expression locals() is globals() is true).
--
http://mail.python.org/mailman/listinfo/python-list
Bengt Richter wrote:
I thought XML was a good idea, but IMO requiring quotes around
even integer attribute values was an unfortunate decision.
I think it helps guard against incompetent authors who wouldn't
understand when they're required to use quotes and when they're not. I
see HTML pages all
snacktime wrote:
I'm used to using the perl DBI and not very familiar with the python
DB-API. I am using PyGreSQL. My question is what is the standard way
to quote strings in sql queries? I didn't see any quoting functions
in the DB-API docs. Is quoting handled internally by the PyGreSQL
[EMAIL PROTECTED] wrote:
I'm frequently using Py2.4 sets, I find them quite useful, and I like
them, even if they seem a little slower than dicts.
They look exactly the same speed-wise to me:
t1 = Timer('randrange(100) in foo', 'from random import randrange;
foo = set(xrange(1000))')
t2 =
Alan McIntyre wrote:
You could do something like this:
blah = type('Struct', (), {})()
blah.some_field = x
I think I'd only do this if I needed to construct objects at runtime
based on information that I don't have at compile time, since the two
lines of code for your empty class would probably
Is there a word for an iterable object which isn't also an iterator, and
therefor can be iterated over multiple times without being exhausted?
Sequence is close, but a non-iterator iterable could technically
provide an __iter__ method without implementing the sequence protocol,
so it's not
Philip Smith wrote:
I don't seem to be able to define multiple versions of __init__ in my matrix
class (ie to initialise either from a list of values or from 2 dimensions
(rows/columns)).
You could either use an if statement with *args:
class Matrix(object):
def __init__(self, *args):
Leif K-Brooks wrote:
@classmethod
def from_pair(self, rows, columns):
return Matrix([rows, columns]) # Or with the right argument
Er... I'm not sure why I named that argument self, it should be cls
if you don't want to confuse anyone reading your code.
--
http://mail.python.org
Paul Rubin wrote:
I notice that lots of the medium-largish sites (from hobbyist BBS's to
sites like Slashdot, Wikipedia, etc.) built using this approach are
painfully slow even using seriously powerful server hardware. Yet
compared to a really large site like Ebay or Hotmail (to say nothing
of
Gabriel B. wrote:
What it they revoke this license [on Qt]?
They can't. It's the GPL.
what it windows
longhorn has a non-backwardcompatible GDI API and a newer version of
Qt must be used, and that newer version does not have a gpl version?
What if Wx does that? What if Tk does? What if GTK does?
Frans Englich wrote:
runner.py:587: Using is not None, may not always work
It's a PyChecker bug relating to None being a constant in 2.4:
http://tinyurl.com/6dexc.
--
http://mail.python.org/mailman/listinfo/python-list
administrata wrote:
Is it possible?
I tried...
I = John
print \
I used to love pizza
Error occurs!!!
No error occurs; it prints I used to love pizza, as would be expected.
Oh: from the subject line, I'm guessing that you want it to say John
used to love pizza instead? In that case, try doing
Leo Breebaart wrote:
What I can't find an explanation for is why str.join() doesn't
automatically call str() on its arguments
I don't really like that idea for the reasons others have stated. But a
related and (IMHO) more Pythonic idea would be to allow arbitrary
objects to be str.join()ed if
Alex Martelli wrote:
execfunc = { 'key1' : (func1, ()),
'key2' : (func2, args) }
now, something like:
f, a = execfunc[k]
f(**a)
will work for either key.
Shouldn't func1's args be a dictionary, not a tuple?
--
http://mail.python.org/mailman/listinfo/python-list
Sybren Stuvel wrote:
There are over 2800 header files on my system in /usr/include. What do
you mean a limited number of header files?
I assume he's saying that the number is ∞. (Of course, the same is
true of Python modules unless you use a special __import__ hook or
something...)
--
Steve Holden wrote:
Another alternative might be to serve a script that sent the browser
back 2 pages in its history, as long as server state hasn't changed in
the meantime.
What about users with JavaScript disabled?
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
list = ['f', 'e', 'd', 'c', 'b', 'a']
How can i convert it into a string so the output is
fedcba
print ''.join(list)
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
Hello All,
How does one make an arbitrary class (e.g. class myclass(object)) behave like
a list in method calls with the *something operator? What I mean is:
myobj = myclass()
doit(*myobj)
Make it iterable:
class Foo(object):
... def __iter__(self):
...
mo wrote:
Can somebody explain how to stop a WHILE loop in running program by pressing
ESC key?
On Unix-like systems try:
import termios, fcntl, sys, os
fd = sys.stdin.fileno()
oldterm = termios.tcgetattr(fd)
newattr = termios.tcgetattr(fd)
newattr[3] = newattr[3] ~termios.ICANON
[EMAIL PROTECTED] wrote:
George Sakkis wrote:
list(takewhile(p, xrange(1000)))
[0, 1]
thanks. that is what I am doing now, in a more generic form :
takewhile(p, (x for x in xrange(1)))
How does a useless generator expression make it more generic?
--
[EMAIL PROTECTED] wrote:
Leif K-Brooks wrote:
[EMAIL PROTECTED] wrote:
thanks. that is what I am doing now, in a more generic form :
takewhile(p, (x for x in xrange(1)))
How does a useless generator expression make it more generic?
xrange is only picked as an example. I may
Kent Johnson wrote:
But why doesn't Foo.__call__ shadow type.__call__? Normally an instance
attribute takes precedence over a class attribute. Is it something
special about how function call syntax is handled internally, or do all
special methods work this way, or is there something else going
[EMAIL PROTECTED] wrote:
Is it possible to recompile the AST generated by compiler.parse, back
into code or an executable code object?
Into a bytecode object:
from compiler.pycodegen import ModuleCodeGenerator
from compiler.misc import set_filename
from compiler import parse
tree =
jena wrote:
hello,
when i create list of lambdas:
l=[lambda:x.upper() for x in ['a','b','c']]
then l[0]() returns 'C', i think, it should be 'A'
Fredrik Lundh provided the general solution, but in this specific case,
the simplest solution is:
l = [x.upper for x in ['a', 'b', 'c']]
--
amfr wrote:
I was wondering how i could parse the contents of a file into an array.
the file would look something like this:
gif:image/gif
html:text/html
jpg:image/jpeg
...
As you can see, it contains the mime type and the file extension
seperated by commas, 1 per line. I was
Leif K-Brooks wrote:
line = line.rsplit('\r\n')
Er, that should be line.rstrip, not line.rsplit.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
While using some nested data structures, I've seen that I'd like to
have a function that tells me if a given data structure contains one or
more cyclic references (a way to recognise a cycle in a graph is to do
a depth-first search, marking vertices along the way. An
In Python 2.4, although None can't be directly assigned to,
globals()['None'] can still be; however, that won't change the value of
the expression None in ordinary statements. Except with the eval
function, it seems:
Python 2.4 (#2, Dec 3 2004, 17:59:05)
[GCC 3.3.5 (Debian 1:3.3.5-2)] on
Steve Holden wrote:
Yes. print eval('None') is printing the value of None as defined in
your module's global namespace:
Right, but why? The expression None doesn't worry about the global
namespace when used in normal code; why does it when used in eval()ed code?
--
Mike Meyer wrote:
They do have a first-class function-like object called an agent. But
to use a standard method as an agent, you have to wrap it.
Just curious, but how does a method get wrapped in an agent if methods
aren't first-class objects? Subclassing the agent base class with a new
run
Thomas wrote:
im = Image.open(srcImage) # might be png, gif etc, for instance
test1.png
im.thumbnail(size, Image.ANTIALIAS) # size is 640x480
im.save(targetName, JPEG) # targetname is test1.jpg
produces an exception. Any clues?
The problem is that test1.png is a paletted image, and JPEGs can only
[EMAIL PROTECTED] wrote:
Wouldn't it have been better to define tuples with 's or {}'s or
something else to avoid this confusion??
The way I see it, tuples are just a way of having a function return
multiple values at once. When you think of them that way, you don't even
need parenthesis:
def
Krystian wrote:
I would also like to see Half Life 2 in pure Python.
or even quake1, do you think it could have any chances to run
smoothly?
If http://www.abrahamjoffe.com.au/ben/canvascape/ can run at a
reasonably speed, yes.
--
http://mail.python.org/mailman/listinfo/python-list
Leif K-Brooks wrote:
It's perfectly reasonable behavior, and it also applies to Linux. The
shell uses spaces to separate arguments; how do you expect it to know
that you want a space to be part of the program's name unless you escape it?
I'm sorry, disregard my message. I failed to read the OP
[EMAIL PROTECTED] wrote:
This comes up from time to time. The brain damage is all Windows',
not Python's.
It's perfectly reasonable behavior, and it also applies to Linux. The
shell uses spaces to separate arguments; how do you expect it to know
that you want a space to be part of the
Heiko Wundram wrote:
Fredrik Lundh wrote:
Matthias Kaeppler wrote:
polymorphism seems to be missing in Python
QOTW!
Let's have some UQOTW: the un-quote of the week! ;-)
+1
--
http://mail.python.org/mailman/listinfo/python-list
Chris Song wrote:
Here's my solution
_unicodeRe = re.compile((\\\u[\da-f]{4}))
def unisub(mo):
return unichr(int(mo.group(1)[2:],16))
unicodeStrFromNetwork = '\u5927'
unicodeStrNative = _unicodeRe(unisub, unicodeStrFromNetwork)
But I think there must be a more straightforward
Mike Tammerman wrote:
Hi,
I am trying to execute an executable or a pyton script inside my
program. I looked at the subprocess and os module. But all the
functions in these modules blocks my application.
subprocess doesn't block unless you call .wait():
from subprocess import Popen
proc =
Sybren Stuvel wrote:
It also allows for dynamic function creation in cases where a name
would not be available.
What cases are those?
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Im trying to create a decorator that counts the number of times a
function is run.
Your code doesn't work because decorators are run at function creation
time, not at function run time. Try this instead:
from itertools import count
def logFunctionCalls(function):
Xah Lee wrote:
i switched to system call with tail because originally i was using a
pure Python solution
inF = gzip.GzipFile(ff, 'rb');
s=inF.readlines()
inF.close()
last_line=s[-1]
and since the log file is 100 megabytes it takes a long time and hogs
Adam Monsen wrote:
class J:
name = ''
value = ''
def __str__(self):
vals = self.__class__.__dict__
vals.update(self.__dict__)
return 'name=%(name)s value=%(value)s' % vals
This will update the class's attributes with instance attributes when
str() is
billiejoex wrote:
Hi all. I'm searching for a portable (working on *nix and win32) function
that executes a system command and encapsulate its output into a string.
Searching for the web I found this:
os.popen('command').read()
It is perfect but when che command return an error the
billiejoex wrote:
Thank you for your help but I'm searching a different way.
Moreover it doesn't work always (for exaple: try a 'dir' command).
Because of I'm implementing a remote shell the
[[os.popen('command').read()]] rapresents the best for me because it can
also accepts arguments
[EMAIL PROTECTED] wrote:
i was wondering if anyone have written a GUI module that can
function as a replacment for stdin/stdout? ie. has a file like
interface, by which one could just assaign it to sys.stdout or
sys.stdin and have all your prints and raw_inputs and other such things
shown
ncf wrote:
I have a feeling that this is highly unlikely, but does anyone in here
know if it's possible to directly call a module, or will I have to wrap
it up in a class?
You could use trickery with sys.modules to automatically wrap it in a class:
import sys
from types import ModuleType
Ivan Shevanski wrote:
is there a way to turn off syntax warnings or just make them not
visible?
import warnings
warnings.filterwarnings('ignore', category=SyntaxWarning)
--
http://mail.python.org/mailman/listinfo/python-list
Sam wrote:
And foo if bar is Perl-ish; yet, even Perl has the ? : operators.
What _isn't_ Perl-ish?
--
http://mail.python.org/mailman/listinfo/python-list
Jeff Schwab wrote:
Sorta, but not really. Typically, you might distribute the source (.py)
files, but if you don't want to do that, you can distribute the
compiled .pyc files instead. Python creates these files automatically
when your modules are imported.
But remember that Python bytecode
Iyer, Prasad C wrote:
I have a class in a module which is getting imported in main module.
How do you differentiate between the 2 class
import foo
import bar
foo.TheClass().dostuff()
bar.TheClass().dostuff()
--
http://mail.python.org/mailman/listinfo/python-list
Sam wrote:
http://www.wnbc.com/family/5060215/detail.html
I know there's an on-topic joke in here somewhere, but I'm having some
problem finding it, at the moment.
You may take a crack at it, if you'd like…
Hmm... has anyone ever written a spyware removal tool in Python?
--
mike wrote:
i'd like to use
os.access(path,mode)
where path may contain linux style wildcards.
os.access(glob.glob(path), mode)
--
http://mail.python.org/mailman/listinfo/python-list
beza1e1 wrote:
Is it possible compiler.parse a statement, then change and then
execute/resolve it?
This should work:
from compiler.pycodegen import ModuleCodeGenerator
from compiler.misc import set_filename
from compiler import parse
tree = parse('foo = 42')
set_filename('foo',
[EMAIL PROTECTED] wrote:
I want to filter some strings,but i don t know how to use compile
method.
Why not?
first character must be [a-zA-z] group and others can only be digits or
letters.
if re.search('^[a-zA-Z][a-zA-Z0-9]*$', foo):
print Valid string.
else:
print Invalid string.
Leif K-Brooks wrote:
[EMAIL PROTECTED] wrote:
I want to filter some strings,but i don t know how to use compile
method.
Why not?
Sorry: I misread that as not _wanting_ to use the compile method.
--
http://mail.python.org/mailman/listinfo/python-list
Madhusudan Singh wrote:
I am using binascii.b2a_hex to convert some binary data to hex. The
result is a two bit hex representation (i. e., without the leading
0x).
Surely you mean two-byte?
How do I convert the resulting two bit representation into an integer
?
int(foo, 16)
--
[EMAIL PROTECTED] wrote:
name=property(getname,setname,None,None)
However, it no longer works if I modify getname and setname to
def getname(self):
return self.name
def setname(self,newname=Port2):
self.name=newname
That's because you're actually modifying
John Roth wrote:
Elliot Temple [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
One other interesting thing about case sensitivity I don't think
anyone has mentioned: in Python keywords are all lowercase already
(the way I want to type them). In some other languages, they
Oliver Andrich wrote:
re.sub(rgoogle(.*)/google,ra
href=http://www.google.com/search?q=\1\1/a, text)
For real-world use you'll want to URL encode and entityify the text:
import cgi
import urllib
def google_link(text):
text = text.group(1)
return 'a href=%s%s/a' %
Roy Smith wrote:
Just wait until the day you're trying to figure out why some C++ function
is behaving the way it is and you don't notice that a 50-line stretch of
code is commented out with /* at the top and */ at the bottom.
The same thing's happened to me in Python when I accidentally
Michael wrote:
a=2
b=a
b=0
That's more or less equivalent to this C++ code:
int *a;
int *b;
a = new int;
*a = 2;
b = a;
b = new int;
*b = 0;
--
http://mail.python.org/mailman/listinfo/python-list
Duncan Booth wrote:
The constant integers are created in advance, not when you do the
assignment.
But that's just an optimization, not Python's defined behavior. It seems
more useful to me to think of all integers as being created at
assignment time, even if CPython doesn't actually do that.
Elliot Temple wrote:
I want to write a function, foo, so the following works:
def main():
n = 4
foo(n)
print n
#it prints 7
What's wrong with:
def foo(n):
return 7
def main():
n = 4
n = foo(n)
print n
Anything else (including the tricks involving mutable
John J. Lee wrote:
class Klass:
def _makeLoudNoise(self, *blah):
...
woof = _makeLoudNoise
[...]
At least in 2.3 (and 2.4, AFAIK), you can't pickle classes that do
this.
Works for me:
Python 2.3.5 (#2, May 4 2005, 08:51:39)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on
Frank Abel Cancio Bello wrote:
request.add_header('content-encoding', 'UTF-8')
The Content-Encoding header is for things like gzip, not for
specifying the text encoding. Use the charset parameter to the
Content-Type header for that, as in Content-Type: text/plain;
charset=utf-8.
--
Joe Stevenson wrote:
I skimmed through the docs for Python, and I did not find anything like
a case or switch statement. I assume there is one and that I just
missed it. Can someone please point me to the appropriate document, or
post an example? I don't relish the idea especially long
Mark Harrison wrote:
What is the best way to process a text file of delimited strings?
I've got a file where strings are quoted with at-signs, @like [EMAIL
PROTECTED]
At-signs in the string are represented as doubled @@.
import re
_at_re = re.compile('(?!@)@(?!@)')
def
Eduardo Biano wrote:
def foo(request):
ans01 = request.get_form_var(ans01)
if ans01 == 4:
ans_1 = 1
return ans_1
ans01 will be a string (4), not an int (4).
--
http://mail.python.org/mailman/listinfo/python-list
How do I make a regular expression which will match the same character
repeated one or more times, instead of matching repetitions of any
(possibly non-same) characters like .+ does? In other words, I want a
pattern like this:
re.findall(.+, foo) # not what I want
['foo']
skn wrote:
Does the python compiler provide an option to generate a .pyo(optimized byte
code file) from a .py (source file)?
For generating .pyc I know that I only have to pass the source file name as
an argument to py_compile.py.
py_compile.py checks __debug__ to decide whether to use
Steven D'Aprano wrote:
The language is *always* spelt without the a, and usually all in
lower-case: perl.
The language is title-cased (Perl), but the standard interpreter is
written in all lowercase (perl). Sort of like the distinction between
Python and CPython.
--
Kent Johnson wrote:
letters = {}
for letter in ascii_lowercase:
letters[letter] = 0
Or more simply:
letters = dict.fromkeys(ascii_lowercase, 0)
--
http://mail.python.org/mailman/listinfo/python-list
Didier C wrote:
E.g in Perl, we can do something like:
$dir=/home/cypher;
system(ls $dir);
Is there a way to reproduce the same thing in Python?
system(ls %s % dir)
But you should really be using subprocess for security (so that if
dir==/home/foo; rm -rf / nothing bad will happen):
McBooCzech wrote:
This is easy. Subprocess function call looks:
returncode = subprocess.call([/root/dex/dex,/dev/ttyS0,
blabla.txt])
and it runs smoothly.
The problem starts when I am trying to add 1/dev/null 2/dev/null
parameters to suppres output sendings.
from subprocess import call,
David Bear wrote:
Is there an easy way to create a dictionary object with the members of
'alist' being the keys in the dictionary, and the value of the keys set to
null?
adict = dict.fromkeys(alist)
--
http://mail.python.org/mailman/listinfo/python-list
jwaixs wrote:
I've a question. Can I execute a part of a python code and put it's
output in a string?
import sys
from cStringIO import StringIO
def exec_and_get_output(code):
... old_stdout = sys.stdout
... sys.stdout = StringIO()
... try:
... exec code in {}, {}
[EMAIL PROTECTED] wrote:
I'd like to dynamically find and invoke a method in a Python CGI.
getattr(self, methodName)()
But make sure to validate user input first, of course.
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Heller wrote:
I forgot to mention this: The Base class also implements a __getitem__
method which should be used for iteration if the .Iterator method in the
subclass is not available. So it seems impossible to raise an exception
in the __iter__ method if .Iterator is not found -
Grant Edwards wrote:
1) So I know whether an parameter was passed in or not. Perhaps
it's not considered good Pythonic style, but I like to use a
single method for both get and set operations. With no
parameters, it's a get. With a parameter, it's a set:
class demo:
def
Grant Edwards wrote:
On 2005-07-07, Leif K-Brooks [EMAIL PROTECTED] wrote:
_NOVALUE = object()
class demo:
def foo(v=_NOVALUE):
if v is _NOVALUE:
return self.v
else:
self.v = v
Apart from the change in the logic such that the set operation
doesn't
Kay Schluehr wrote:
Well, I want to offer a more radical proposal: why not free squared
braces from the burden of representing lists at all? It should be
sufficient to write
list()
list()
So then what would the expression list('foo') mean? Would it be
equivalent to ['foo'] (if so, how
Kay Schluehr wrote:
list.from_str(abc)
list(a, b, c )
I assume we'll also have list.from_list, list.from_tuple,
list.from_genexp, list.from_xrange, etc.?
--
http://mail.python.org/mailman/listinfo/python-list
rbt wrote:
IMO, most of the people who deride goto do so because they heard or read
where someone else did.
1 GOTO 17
2 mean,GOTO 5
3 couldGOTO 6
4 with GOTO 7
5 what GOTO 3
6 possibly GOTO 24
7 you! GOTO 21
8 that GOTO 18
9 really,
Admin wrote:
I am creating a chat application like Messenger for the web (using the
browser) and I'm wondering if there is a way to receive new messages
from time to time from the server other than refreshing the page each 5
sec.
Here's a pretty basic example I wrote a while ago using
[EMAIL PROTECTED] wrote:
Templating engines like ZPT prefer to put some code in the template,
Nevow prefers to put code in python and allow you to write some xhtml in
python too.
Oh yeah, now I remeber, I think this is a controversial idea.
One important thing to realise about Nevow is that it
Roy Smith wrote:
No, that works fine. But, now I can't even reproduce the error I reported
earlier (when I try, I get the help message as expected). And, yes, that
was with a brand new interpreter session. Strange.
Perhaps you were running Python from a directory with a file called
42 wrote:
I was wondering if it would be effective to pre-parse incoming scripts
and reject those containing import?
getattr(__builtins__, '__imp' + 'ort__')('dangerousmodule')
--
http://mail.python.org/mailman/listinfo/python-list
42 wrote:
FWIW I've already given up on making python secure. I agree that odds
are extremely high that I've missed something. I'm just curious to see
what one of the holes I left is, preferably without wading through
hundreds of pages :)
f = [x for x in
Learning Python wrote:
A code like this:
def adder(**varargs):
sum=varargs[varargs.keys()[0]]
for next in varargs.keys()[1:]:
sum=sum+varargs[next]
return sum
print adder( first,second,'third')
How to pass arguments to a functions that use dictionary
Kenneth McDonald wrote:
I'm curious about this because, quite aside their function as web
browsers, it is now possible to build some very useable interfaces
using browsers with HTML, CSS, and JavaScript. (The biggest problem is
still the lack of a decent text widget.) However, JavaScript
I'm running Python 2.3.5 and 2.4.1 under Debian Sarge. Instead of
deleting the character after the cursor, pressing my delete key in an
interactive Python window causes a system beep and inserts a tilde
character. This behavior occurs across all of the terminals I've tried
(xterm, Konsole, real
Frans Englich wrote:
This is silly. How do I access data files I've installed with distutils? In a
portable, generic way, I want to find out what is the following path on most
systems:
/usr/local/lib/python2.4/lib/site-packages/foo/bar.txt
Assuming your module is also in site-packages/foo, I
Paddy wrote:
I had to do as you suggest but I was thinking either it was a kludge,
and there should be a 'deep' substitution of globals, or that there
was a good reason for it to work as it does and some magician would
tell me.
If there was deep substitution of globals, how would functions
Xah Lee wrote:
lambda x, y: x + y
that's what i was looking for.
... once i have a lambda expr, how to apply it to arguments?
http://python.org/doc/current/ref/calls.html
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 197 matches
Mail list logo