Is there an *explicitly stated* reason (e.g. in a PEP, or in some
python dev list message) for why the inspect module (at least for
Python 2.7) does not include anything like a "currentcallable()"
function that would *stably*[1] return the currently executing
callable object?
(It seems unlikely
In Chris Angelico
writes:
>I'm not familiar with it by that name, but Pike's this_function is
>what the OP's describing.
You got it.
>It's a useful construct in theory when you want to write in recursion,
>which was part of the rationale behind PE
What's the most reliable way for "module code" to determine the
absolute path of the working directory at the start of execution?
(By "module code" I mean code that lives in a file that is not
meant to be run as a script, but rather it is meant to be loaded
as the result of some import statement
As far as I've been able to determine, Python does not remember
(immutably, that is) the working directory at the program's start-up,
or, if it does, it does not officially expose this information.
Does anyone know why this is? Is there a PEP stating the rationale
for it?
Thanks!
--
http://ma
In Roy Smith writes:
>In article , kj
>wrote:
>> As far as I've been able to determine, Python does not remember
>> (immutably, that is) the working directory at the program's start-up,
>> or, if it does, it does not officially expose this information.
&
n implementing and testing functions with optional
arguments in Java would be appreciated.
TIA!
kj
--
http://mail.python.org/mailman/listinfo/python-list
it's an all-out disgrace.
when is python going to get a decent module distribution system???
and don't tell me to do it myself: it's clear that the sorry
situation we have now is precisely that too many programmers without
the requisite expertise or policy-making authority have decided to
pitch
d during my first attempt.
My question is: is there any tutorial on Python scoping aimed at
diehard Perlheads?
Thanks!
kj
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list
is with my naive attempt to add a method
to class A dynamically (in the last two lines of the definition of
_auto). What's the right way to do this?
Thanks!
kj
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list
Nevermind, I found the problem...
Thanks,
kj
In <[EMAIL PROTECTED]> kj <[EMAIL PROTECTED]> writes:
>I've tried a bazillion ways to code dynamically generated methods,
>to no avail.
>The following snippet is a very simplified (and artificial) demo
>of the proble
a C compiler)
or not terribly useful to the average person (e.g. a function that
efficiently computes the n-th Fibonacci number).
Any pointers would be much appreciated.
kj
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it,
Is it possible to buy the official Python docs in book form? If
so, I'd very much appreciate the name(s) and author(s) of the
book(s).
TIA!
kynnjo
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
ht
In <[EMAIL PROTECTED]> gordyt <[EMAIL PROTECTED]> writes:
>Howdy kynnjo,
>> Is it possible to buy the official Python docs in book form? If
>> so, I'd very much appreciate the name(s) and author(s) of the
>> book(s).
>I haven't seen them in print form, but you can download PDF's from
>here:
>h
I'm looking for "example implementations" of small projects in
Python, similar to the ones given at the end of most chapters of
The Perl Cookbook (2nd edition, isbn: 0596003137). (Unfortunately,
the otherwise excellent Python Cookbook (2nd edition, isbn:
0596007973), by the same publisher (O'Re
I've only recently started programming in Python, trying to wean
myself from Perl. One of the things I *really* miss from Perl is
a 100% mouse-free data inspector, affectionally known as the Perl
debugger, PerlDB, or just perl -d. With it I can examine the most
elaborate data structures with e
In <[EMAIL PROTECTED]> Paddy <[EMAIL PROTECTED]> writes:
>python -h gives me:
> ...
> Other environment variables:
> PYTHONSTARTUP: file executed on interactive startup (no default)
> ...
Sweet. Thanks!
kynn
--
NOTE: In my address everything before the first period is backwards;
and the la
In <[EMAIL PROTECTED]> Terry Jones <[EMAIL PROTECTED]> writes:
>>>>>> "kj" == kj <[EMAIL PROTECTED]> writes:
>You actually liked the perl debugger... gasp!
Still do, in fact!.
>OK, I used it too, but it
>left a few things to be desire
In <[EMAIL PROTECTED]> Paddy <[EMAIL PROTECTED]> writes:
>I tend to do the following at the python prompt:
> from pprint import pprint as pp
Thanks, that's a good one to know, but isn't there a way to automate
it???
I looked around, but I couldn't find the name of any *rc-type file
that would
For many months now I've been trying to learn Python, but I guess
I'm too old a dog trying to learn new tricks... For better or
worse, I'm so used to Perl when it comes to scripting, that I'm
just having a very hard time getting a hang of "The Python Way."
It's not the Python syntax that I'm ha
In <[EMAIL PROTECTED]> "Reedick, Andrew" <[EMAIL PROTECTED]> writes:
>> Be that as it may, the activation barrier to using Python for my
>> scripting remains too high.
>>=20
>> I'd written a Perl module to facilitate the writing of scripts.
>> It contained all my boilerplate code for parsing and v
In <[EMAIL PROTECTED]> Wildemar Wildenburger <[EMAIL PROTECTED]> writes:
>kj wrote:
>> Is there any good reading (to ease the transition) for Perl
>> programmers trying to learn Python?
>>
>www.diveintopython.org
Thanks. Not for Perl programmers specifical
I'm learning python, for the umpteenth time. This time I decided
to start out by writing Python scripts for everyday tasks. Most
of these scripts are meant to be used only once or twice, but a
few of them have become useful enough that I'd like to make them
a little bit more solid...
I'd like
In <802a051qoqmpnih0j2su9hhriqumagu...@4ax.com> Tim Roberts
writes:
>kj wrote:
>>
>>I'm learning python, for the umpteenth time. This time I decided
>>to start out by writing Python scripts for everyday tasks. Most
>>of these scripts are meant to be u
Below is my very firs python script.
This was just a learning exercise; the script doesn't do anything
terribly exciting: for an argument of the form YYMMDD (year, month,
day) it prints out the corresponding string YYMMDDW, where W is a
one-letter abbreviation for the day of the week. E.g.
% wd
In <0216ec41$0$20647$c3e8...@news.astraweb.com> Steven D'Aprano
writes:
>On Sun, 10 May 2009 12:52:21 +, kj wrote:
>> 1. The name of the BadArgument exception class defined in the script
>>does not seem to me sufficiently specific. If one were to import th
Thank you all very much! I really appreciate it.
kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list
I know about the construct:
try:
# do something
except ...:
# handle exception
else:
# do something else
...but I can't come with an example in which the same couldn't be
accomplished with
try:
# do something
# do something else
except ...:
# handle exception
The only
In Scott David Daniels
writes:
>kj wrote:
>> ... I can't come with an example in which the same couldn't be
>> accomplished with
>>
>> try:
>> # do something
>> # do something else
>> except ...:
>> # handle exception
Hi. I'm trying to learn how to play a .wav file in OS X with Python.
I tried the following, which ran without errors, but produced
nothing audible (even though the file bell.wav plays perfectly well
otherwise, e.g. view the Finder's Preview):
import pygame.mixer
pygame.mixer.init()
pygame.mixer.
Suppose I have the following:
def foo(x=None, y=None, z=None):
d = {"x": x, "y": y, "z": z}
return bar(d)
I.e. foo takes a whole bunch of named arguments and ends up calling
a function bar that takes a single dictionary as argument, and this
dictionary has the same keys as in foo's sign
In Terry Reedy
writes:
>kj wrote:
>>
>> Suppose I have the following:
>>
>> def foo(x=None, y=None, z=None):
>> d = {"x": x, "y": y, "z": z}
>> return bar(d)
>>
>> I.e. foo takes a whole bunch of named
Suppose that f is an object whose type is 'function'.
Is there a way to find out f's list of formal arguments?
The reason for this is that I'm trying to write a decorator and
I'd like the wrapper to be able to check the number of arguments
passed. Specifically, I'd like the wrapper to look as
In Dave Angel
writes:
>kj wrote:
>> In Terry Reedy
>> writes:
>>
>>
>>> kj wrote:
>>>
>>>> Suppose I have the following:
>>>>
>>>> def foo(x=None, y=None, z=None):
>>>> d = {&
I've written a tiny module that I'd like to make available online
from my website. This module is not "production-grade" code; it
is meant only as an illustration, but still I'd like to make its
download and installation as painless as possible.
I could simply bundle everything into a .tgz fil
In Chris Rebert
writes:
>Take a look at inspect.getargspec(func):
>http://docs.python.org/library/inspect.html#inspect.getargspec
Thank you much, that did the trick. And inspect is a very handy
module to know about.
kynn
--
NOTE: In my address everything before the first period is backwards
In <99246143-a853-4041-bc45-eeb648388...@r3g2000vbp.googlegroups.com> Carl
Banks writes:
>On May 14, 1:26=A0pm, kj wrote:
>> I've written a tiny module that I'd like to make available online
>> from my website. =A0This module is not "production-gr
I have read a couple of "learn Python"-type books, and now I'm
looking for some more advanced books on Python, something analogous
to "Effective Java" or "High-Order Perl". I've only been able to
find "Advanced Python 3 Programming Techniques", which, as far as
I can tell, is only available as a
Suppose I have two lists, list_a and list_b, and I want to iterate
over both as if they were a single list. E.g. I could write:
for x in list_a:
foo(x)
for x in list_b:
foo(x)
But is there a less cumbersome way to achieve this? I'm thinking
of something in the same vein as Perl's:
fo
In Chris Rebert
writes:
>Just add the lists together.
>for x in list_a + list_b:
>foo(x)
Cool! Thanks!
kynn
--
--
http://mail.python.org/mailman/listinfo/python-list
Hi. Sorry for this very clueless question, but how does one write
in Python an HTTP client that can send a POST request? The modules
I've found (e.g. urllib, urllib2), as far as I can tell, seem to
be limited to GET requests. (I could be wrong though; please
correct me if this is so.)
TIA!
In <[EMAIL PROTECTED]> kj <[EMAIL PROTECTED]> writes:
>Hi. Sorry for this very clueless question, but how does one write
>in Python an HTTP client that can send a POST request? The modules
>I've found (e.g. urllib, urllib2), as far as I can tell, seem to
>be limit
Hi. I'd like to port a Perl function that does something I don't
know how to do in Python. (In fact, it may even be something that
is distinctly un-Pythonic!)
The original Perl function takes a reference to an array, removes
from this array all the elements that satisfy a particular criterion,
Thanks to Jeff and subeen for the helpful comments and suggestions.
Kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list
>This function will take a list of integers and modify it in place such
>that it removes even integers. The removed integers are returned as a
>new list
Great!
Thanks!
kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, sh
In <[EMAIL PROTECTED]> John Machin <[EMAIL PROTECTED]> writes:
>It's nothing to do with list comprehensions, which are syntactical
>sugar for traditional loops. You could rewrite your list comprehension
>in the traditional manner...
>and it would still fail for the same reason: mutating the list o
In <[EMAIL PROTECTED]> kj <[EMAIL PROTECTED]> writes:
>In <[EMAIL PROTECTED]> John Machin <[EMAIL PROTECTED]> writes:
>>It's nothing to do with list comprehensions, which are syntactical
>>sugar for traditional loops. You could rewrite your list compre
How can a script know its absolute path? (__file__ only gives the
path it was used to invoke the script.)
Basically, I'm looking for the Python equivalent of Perl's FindBin.
The point of all this is to make the scripts location the reference
point for the location of other files, as part of a
In <[EMAIL PROTECTED]> "Mark Tolonen" <[EMAIL PROTECTED]> writes:
>import os
>print os.path.abspath(__file__)
Great. Thanks!
Kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.or
I'm a Perlhead trying to learn the Way of Python. I like Python
overall, but every once in a while I find myself trying to figure
out why Python does some things the way it does. At the moment
I'm scratching my head over Python's docstrings. As far as I
understand this is the standard way to d
Wow. That was a great bunch of advice.
Thank you all very much!
Kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]> "Mike Driscoll" <[EMAIL PROTECTED]> writes:
>For my compiled scripts, I usually use this variation:
>path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0])))
Thanks. But why the os.path.join()? (BTW, I did read the docs
before posting, but they make no sense to
I'm running into a strange seg fault with the module cjson. The
strange part is that it does not occur when I run the code under
Emacs' Pydb.
Here's an example:
import sys, cjson
d1 = {'a': 1, 'b': 2, 'c': 3}
print sys.version
j1 = cjson.encode(d1)
print j1 # should print the string '{"a
In <[EMAIL PROTECTED]> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
>kj schrieb:
>> I'm running into a strange seg fault with the module cjson. The
>> strange part is that it does not occur when I run the code under
>> Emacs' Pydb.
&g
[Note: I changed the subject line to make it more informative.]
In <[EMAIL PROTECTED]> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
>kj wrote:
>> In <[EMAIL PROTECTED]> "Diez B. Roggisch"
>> <[EMAIL PROTECTED]> writes:
>>
I'm sure this is a simple, but recurrent, problem for which I can't
hit on a totally satisfactory solution.
As an example, suppose that I want write a module X that performs
some database access. I expect that 99.999% of the time, during
the foreseeable future, the database connection paramete
In <[EMAIL PROTECTED]> =?iso-8859-1?q?Robin_K=E5veland?= Hansen <[EMAIL
PROTECTED]> writes:
>On Thu, 12 Jun 2008 21:32:34 +, kj wrote:
>> I'm sure this is a simple, but recurrent, problem for which I can't hit
>> on a totally satisfactory solution.
>
I'm downloading some very large tables from a remote site. I want
to sort these tables in a particular way before saving them to
disk. In the past I found that the most efficient way to do this
was to piggy-back on Unix's highly optimized sort command. So,
from within a Perl script, I'd creat
d I'm very used (maybe too used) to the
fact that if the Perl module Foo::Bar::Baz is installed on our
system, all I need to do to read its full-blown documentation in
all its glory is to type "perldoc Foo::Bar::Baz" at the command
line. Is there anything like this in Python?
TIA!
OK, the following should work but doesn't, and I can't figure out
why:
>>> from xml.marshal.generic import dumps
>>> dumps( ( 1, 2.0, 'foo', [3,4,5] ) )
'12.0foo345'
>>> from xml.dom.ext import PrettyPrint
>>> PrettyPrint( dumps( ( 1, 2.0, 'foo', [3,4,5] ) ) )
>>> import sys
>>> PrettyPrint( du
In <[EMAIL PROTECTED]> Matimus <[EMAIL PROTECTED]> writes:
>If you are in the interpreter and you type: help(foo.bar.baz) you get
>the embeded documentation.
>I usually go straight to the `global module index` http://docs.python.org/m=
>odindex.html
Thanks!
kynn
--
NOTE: In my address everythi
In <[EMAIL PROTECTED]> John Machin <[EMAIL PROTECTED]> writes:
>On Jun 20, 7:17 am, kj <[EMAIL PROTECTED]> wrote:
>> OK, the following should work but doesn't, and I can't figure out
>> why:
>>
>> >>> from xml.ma
Hi. Does anyone know of a module that will take a suitable Python
dictionary and return the corresponding XML structure?
In Perl I use XML::Simple's handy XMLout function:
use XML::Simple 'XMLout';
my %h = ( 'Foo' => +{
'Bar' => +{
I just came across an assignment of the form
x, = y
where y is a string (in case it matters).
1. What's the meaning of the comma in the LHS of the assignment?
2. How could I have found this out on my own?
(Regarding (2) above, I consulted the index of several Python
reference books but I c
In <[EMAIL PROTECTED]> Erik Max Francis <[EMAIL PROTECTED]> writes:
>kj wrote:
>> I just came across an assignment of the form
>>
>> x, = y
>>
>> where y is a string (in case it matters).
>>
>> 1. What's the meaning of the
In <[EMAIL PROTECTED]> Matthew Woodcraft <[EMAIL PROTECTED]> writes:
>kj wrote:
>> I still don't get it. If we write
>>
>> y = 'Y'
>> x, = y
>>
>> what's the difference now between x and y? And if there's no
>>
If I'm in the python interactive interpreter, I get a beep when I
hit the backspace key.
I must confess, though, that my terminal is "complicated", to put
it mildly: I work on a Mac running Leopard; I open a Terminal
session, and through it I ssh to an Ubuntu server; on this server
I connect to
In <[EMAIL PROTECTED]> kj <[EMAIL PROTECTED]> writes:
Please ignore my question. I found a general solution that works
not only for the python interactive interpreter but also for all
programs that have a readline-type interaction. This solution has
nothing to do with Python, but
Python noob here.
I want to write a script that creates and populates a simple Postgres
database.
The word on the street is to use something like SQLAlchemy for
database access in Python, but my experience in the past with
packages that perform automated SQL generation has been awful, so
I alw
In <[EMAIL PROTECTED]> Tim Henderson <[EMAIL PROTECTED]> writes:
>I believe there are a couple of options but pyscopg, and PyGreSQL seem
>to be popular.
Great. Thanks!
kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, sho
Is there a special pythonic idiom for iterating over a list (or
tuple) two elements at a time?
I mean, other than
for i in range(0, len(a), 2):
frobnicate(a[i], a[i+1])
?
I think I once saw something like
for (x, y) in forgotten_expression_using(a):
frobnicate(x, y)
Or maybe I just
Hi. I can't find any documentation for psycopg2.
I'm a noob, so I'm sure I'm just not looking in the right place...
Anybody know where it is?
TIA!
kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded
Thanks for all the replies. I learned a lot!
kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list
Yet another noob question...
Is there a way to mimic C's static variables in Python? Or something
like it? The idea is to equip a given function with a set of
constants that belong only to it, so as not to clutter the global
namespace with variables that are not needed elsewhere.
For example,
In <[EMAIL PROTECTED]> Matthew Woodcraft <[EMAIL PROTECTED]> writes:
>kj <[EMAIL PROTECTED]> wrote:
>> Hi. I can't find any documentation for psycopg2.
>>
>> I'm a noob, so I'm sure I'm just not looking in the right place...
>>
&
In <[EMAIL PROTECTED]> Larry Bates <[EMAIL PROTECTED]> writes:
>kj wrote:
>> Yet another noob question...
>>
>> Is there a way to mimic C's static variables in Python? Or something
>> like it? The idea is to equip a given function with a set of
>&
In <[EMAIL PROTECTED]> Terry Reedy <[EMAIL PROTECTED]> writes:
>kj wrote:
>> Is there a special pythonic idiom for iterating over a list (or
>> tuple) two elements at a time?
>>
>> I mean, other than
>>
>> for i in range(0, len(a), 2)
In Perl, one can break a chunk of text into an array of lines while
preserving the trailing line-termination sequence in each line, if
any, by splitting the text on the regular expression /^/:
DB<1> x split(/^/, "foo\nbar\nbaz")
0 'foo
'
1 'bar
'
2 'baz'
But nothing like this seems to work
In <[EMAIL PROTECTED]> kj <[EMAIL PROTECTED]> writes:
>In Perl, one can break a chunk of text into an array of lines while
>preserving the trailing line-termination sequence in each line, if
>any, by splitting the text on the regular expression /^/:
> DB<1> x
I'm trying to subclass file, overriding the readline method. The
new method definition begins with
def readline(self, size=None):
line = self.file.readline(size)
# etc., etc.
...where the self.file attribute is a regular file object.
This works fine if I invoke the new met
I have a script that calls the function write_tmpfile, which looks
something like this:
def write_tmpfile(f, tmpfile):
# set-up code omitted
in_f = popen("""grep -v '^\\[eof\\]$' %s |\
grep '[^[:space:]]' |\
sort -u""" % f)
out_f = open(tmpf
In <[EMAIL PROTECTED]> Miles <[EMAIL PROTECTED]> writes:
>On Wed, Jul 30, 2008 at 5:52 PM, kj <[EMAIL PROTECTED]> wrote:
>> I know that I could rewrite the method like this:
>>
>>def readline(self, size=None):
>>if size == None:
>>
Hi! I have a Pythonoob question.
I have a script that hangs indefinitely at random times; the only
thing to do at this point is to kill it.
I'm looking for suggestions on how to troubleshoot and debug the
problem.
I'm not even sure of where exactly the script is hanging, though
I suspect it i
I'm looking for a good way to get a listing of all the undocumented
(i.e. docstring-less) functions, classes, and methods as defined
in a (largish) library of files.
What's a good way to get this information?
TIA!
-Kynn
--
http://mail.python.org/mailman/listinfo/python-list
Before I go off to re-invent a thoroughly invented wheel, I thought
I'd ask around for some existing module for computing binomial
coefficient, hypergeometric coefficients, and other factorial-based
combinatorial indices. I'm looking for something that can handle
fairly large factorials (on the
In Perl, one can label loops for finer flow control. For example:
X: for my $x (@X) {
Y: for my $y (@Y) {
for my $z (@Z) {
next X if test1($x, $y, $z);
next Y if test2($x, $y, $z);
frobnicate($x, $y, $z);
}
glortz($x, $y);
}
splat($x);
}
What's considered
Is there any way to specify unbuffered I/O from *within* the code
(rather than via the command-line -u flag)?
TIA!
kynn
--
http://mail.python.org/mailman/listinfo/python-list
Challenge: to come up with a sorting task that cannot be achieved
by passing to the sort method (or sorted function) suitable values
for its key and reverse parameters, but instead *require* giving
a value to its cmp parameter.
For example,
from random import random
scrambled = some_list.sort(c
ry, reversed=3DTrue)
>sorted(s, key=primary)
In the special case where the value returned by secondary is
numeric, I suppose one could do this in one go with
sorted(s, key=lambda x: (primary(x), -secondary(x)))
...but I can't think of a way to generalize this...
kj
--
http://mai
In <7x1vln2bzh@ruckus.brouhaha.com> Paul Rubin
<http://phr...@nospam.invalid> writes:
>kj writes:
>> Is there a real-life sorting task that requires (or is far more
>> efficient with) cmp and can't be easily achieved with key and
>> reverse?
>Yes, t
In alex23
writes:
>kj wrote:
>> This example convinces me that it was a bad idea to
>> get rid of cmp in Python 3, even if situations like this one are
>> rare.
>It sounds like the entire point of this exercise was to get other
>people to confirm your bias for
es are
not there. It seems to me it would take forever to get the simplest
things done in these languages...
Confused.
kj
--
http://mail.python.org/mailman/listinfo/python-list
I'm getting the error:
smtplib.SMTPServerDisconnected: please run connect() first
when I run code that is essentially identical to the code given in
http://docs.python.org/library/email-examples.html
The error happens at the line (copied verbatim from the example
linked to above):
s.
In Ethan Furman
writes:
>The line preceeding it,
>s = smtplib.SMTP()
>needs to have an e-mail server specified. E.g.
>s = smtplib.SMTP('localhost') # from the 2.5 docs
Perfect. Thanks!
kynn
--
http://mail.python.org/mailman/listinfo/python-list
I'm coaching a group of biologists on basic Python scripting. One
of my charges mentioned that he had come across the advice never
to use loops beginning with "while True". Of course, that's one
way to start an infinite loop, but this seems hardly a sufficient
reason to avoid the construct alt
In <01ccc46d-5ea9-4dfe-ba22-699c6b859...@v36g2000yqv.googlegroups.com>
Mensanator writes:
>On Oct 10, 3:15=EF=BF=BDpm, kj wrote:
>> I'm coaching a group of biologists on basic Python scripting. =EF=BF=BDOn=
>e
>> of my charges mentioned that he had come across the
Perl's directory tree traversal facility is provided by the function
find of the File::Find module. This function accepts an optional
callback, called postprocess, that gets invoked "just before leaving
the currently processed directory." The documentation goes on to
say "This hook is handy fo
In Dave Angel
writes:
>kj wrote:
>> Perl's directory tree traversal facility is provided by the function
>> find of the File::Find module. This function accepts an optional
>> callback, called postprocess, that gets invoked "just before leaving
>> the
I like Python a lot, and in fact I'm doing most of my scripting in
Python these days, but one thing that I absolutely *DETEST*
about Python is that it does allow an internal function to modify
variables in the enclosing local scope. This willful hobbling of
internal functions seems to m
How can one check that a Python script is lexically correct?
As my Python apps grow in complexity and execution, I'm finding it
more often the situation in which a program dies after a lengthy
(i.e. expensive) run because the execution reaches, say, a typo.
Of course, this typo needs to be fixed
How can a module determine the path of the file that defines it?
(Note that this is, in the general case, different from sys.argv[0].)
TIA!
kynn
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 384 matches
Mail list logo