This installment, like all those for several months, was authored by
Gabriel Genellina. We have hopes of correcting the attribution before
year's-end.
QOTW: "Plus, it's not something that's never foolproof." - Carl
Banks,
daring negater
http://groups.google.com/group/comp.lang.python/msg/e8
compare.
When you say "self.items" python looks first in the object and then in
the class. Your code didn't put it in the object namespace, so it found
the one in the class.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
I have always been a welly
appen is a loop testing select() (or its poll-like friends) with a short or
zero timeout on inactive file handles.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
No electrons were harmed in the production of this message.
- Dr. P. Gensheimer
--
http://mail.python.o
t.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Team work is essential. It gives the enemy other people to shoot at.
- Murphy's Laws of Combat
--
http://mail.python.org/mailman/listinfo/python-list
QOTW: "It took Python to make me realize that programming *could* be
fun, or at least not annoying enough to keep me from making a career
of
programming." - Aahz
http://groups.google.com/group/comp.lang.python/msg/65ad4e71c194d97e
Thanks to Gabriel Genellina for these references:
How t
ac and then upgrade the RAM
| separately.
Unless it's a Macbook Air. Then you're stuck with 2GB max:-(
At least I didn't pay for it:-) It's a nice machine in many respects.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
I am a Bear of Very Little Brain and long word
t;else" part is to handle exceptions I can't change, so for now I've
just printing the "pfx" context on stderr as the exception bubbles out.
Nasty.
The calling code looks like this:
with Pfx("some tag"):
... suite ...
Cheers,
--
Cameron Simpson DoD#74
:
- the directory user and group ownership and permissions
- the daemon's user and group values?
You can also strace your daemon:
strace -f -e trace=file your-daemon your-daemon-args... 2>strace.out
and then examine the log for the precise UNIX-level failure.
Cheers,
--
Cameron Simp
On 03Jan2010 14:20, cassiope wrote:
| On Jan 2, 8:02 pm, Cameron Simpson wrote:
| > Can you show us:
| > - the directory user and group ownership and permissions
| > - the daemon's user and group values?
|
| Directory permissions: 774
That's unusual - why the "4&quo
id you eyeball the actual open() call to ensure the file pathname
is correct, and doesn't use a bogus (non-existent) directory name?
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
"GOD IS MY SOURCE" - Bumper sticker, Chapel Hill, NC
I'll have to remem
On 04Jan2010 09:16, cassiope wrote:
| To Cameron: the file doesn't (yet) exist; and it has the correct full
| path.
Can you show us the strace output of the failing open() call?
| To "Nobody" : hey, this seems interesting. First test, invoking
| seteuid()
| and setegid() di
sure you don't want chmod?
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Winter is gods' way of telling us to polish.
- Peter Harper
--
http://mail.python.org/mailman/listinfo/python-list
hen a file is saved.
CherrypPy too.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
--
http://mail.python.org/mailman/listinfo/python-list
106 2009-09-26 10:19:17 test.py
| -rwx-- 1 pengy lilab 339 2009-09-26 10:20:39 test.pyc
This happens for me with python 2.6 x86_64 on gentoo.
You're not alone.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Reaching consensus in a group often is confused with findin
ure and 1 for "this didn't work".
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Don't have awk? Use this simple sh emulation:
#!/bin/sh
echo 'Awk bailing out!' >&2
exit 2
- Tom Horsley
--
http://mail.python.org/mailman/listinfo/python-list
uff is only delivered to the main thread of
a python program, thus requiring special handle to tidy up other stuff.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
No team manager will tell you this; but they all want to see you
come walking back into the pits somet
QOTW: "It was intended to be understood, not copied." - Dave Angel
comments
on a characteristic of didactic examples
http://groups.google.com/group/comp.lang.python/msg/61e2d60d08f1c630
Altering the default character encoding (sys.setdefaultencoding) is
never
a good idea:
^://gr
(x)
Your deepercopy() function will explode.
Probably the best method is to pre-munge the list you pass to deepcopy:
d = [1,2,3]
d3 = [d]*3
# pre-copy the multiple references
d3deeper = [ list(d3i) for d3i in d3 ]
r = copy.deepcopy(d3deeper)
You can see this requires special knowled
structure would get non-independent
"x"s. Which is necessary to avoid an infinite copy but breaks your
requirement.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Every technical corrigendum is met by an equally troublesome new defect report.
- Norman Diamond
--
http://mail.python.org/mailman/listinfo/python-list
QOTW: "I consider "import *" the first error to be fixed ..." -
Robert
Kern, author of PyFlakes, a potential replacement for Pylint and
Pychecker,
on his personal style
http://groups.google.com/group/comp.lang.python/msg/5bf77b21b3b0caf2
Python 2.6.4 is out; it fixes some small but impor
QOTW: "Don't get me wrong - innovation often comes from scratching
ones
personal itch. But you seem to be suffering from a rather bad case of
neurodermatitis." - Diez B. Roggisch, on ... well, personal style in
problem-solving
http://groups.google.com/group/comp.lang.python/msg/4cf102bdd3a3267
QOTW: "... it's generally accepted that COM sucks rocks through
straws, so
explore alternatives when they're available ;-)" - Chris Withers
http://groups.google.com/group/comp.lang.python/msg/29577c851ceed167
From nothing to a complete working program - Peter Otten on
stepwise
refine
Might, Courage, Vision, SINCERITY.
> / v \ Simplicity is Beauty! May the Force and Farce be with you!
> /( _ )\ (x86_64 Ubuntu 9.10) Linux 2.6.32.7
> ^ ^ 12:16:01 up 6 days 20:22 2 users load average: 0.45 0.26 0.09
> 不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援
> (CSSA):http://www.sw
-read-form-of-the-test}" if it
all still reads well. If the program flow gets ugly one way, that breaks
"still reads well" and can be cause to flip the condition.
In loops my tendency is a bit less flexible; I often have code like
this:
while ...:
if winnowing-test:
whi
taul
waiting for everything.
This makes for clean and timely shutdown for me.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
If your new theorem can be stated with great simplicity, then there
will exist a pathological exception.- Adrian Mathesis
--
http://mail.python.org/mailman/listinfo/python-list
t; > files, that does not take a long time to run?
| >
| > Here's my attempt. [...open directory and read native format...]
I'd be inclined first to time os.listdir('.') versus glob.lgo('*.*').
Glob routines tend to lstat() every matching name to ensure
()
method as you're using already.
Read from to_file as needed.
The same scheme should work in both server and client:
Don't look for EOF, watch the input line flow.
You might need to use readline() instead of the file-by-line iteration stuff,
which I seem to recall has some sort of problem
But otherwise, yes, missing Content-Type.
And the request method needs to be POST; I expect the code above will be
using GET unless told not to.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
There's no trick to being a humorist when you have the whole government
working for you.- Will Rogers
--
http://mail.python.org/mailman/listinfo/python-list
more lightweight in terms of machine resources?)
On the flipside, given that generators were recently augumented to
support coroutines I can see your motivation within that framework.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
C makes it easy for you to shoot yourself in the
readed setup.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Principles have no real force except when one is well fed. - Mark Twain
--
http://mail.python.org/mailman/listinfo/python-list
obably not enough, I
would guess. Just wondering.
Do you need to move a "standard" image format around? If everything's
16x16 8 bit colour (and if, with luck, they share a colour map) maybe
you can ship raw bytes expressing what you want.
How colourful are these GIFs?
--
Came
ts a 99, and increases
| > every loop?
And here we see the strength of the Usability example; in Python it
won't overflow, rather seguing seamlessly into an increasing expensive
arbitrary sized int. Though most machines will eventually run out of
memory to hold it...
--
Cameron S
til the consumer has sent an acknowledgement before
| sending more info.
I agree with this statement.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
In the end, winning is the only safety. - Kerr Avon
--
http://mail.python.org/mailman/listinfo/python-list
| are normally automatically started with the COMMAND_MODE environment
| variable set:
|
| $ echo $COMMAND_MODE
| unix2003
|
| Adding an "env={"COMMAND_MODE": "unix2003"}" argument to your subprocess
| Popen call should do the trick.
For an added datum, my machine (MacOSX
quot; % local_date)
It's worth noting that if you know the number of return arguments you
can do this:
locyr, locmm, locdd, lochh = itc_to_local(...)
and then easily use the individual values.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Admit Nothing. Blame Everyone. Be Bitter.
- Matt Hopkins, DoD #1197,
--
http://mail.python.org/mailman/listinfo/python-list
ary).
EINVAL (since Linux 2.6.12) length was 0.
EINVAL flags contained neither MAP_PRIVATE or MAP_SHARED, or contained both
of these values.
Sure looks like a length of 0 is disliked.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Carpe Daemon - Seize the Bac
27;s worth noting that any time you get an errno error/exception then it
is almost certainly the underlying OS interface that has rejected your
request, not the python library.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Don't have awk? Use this simple sh emulation
l be these
| equivalents
| in Python?
I would start by looking at the "profile" python module:
http://docs.python.org/library/profile.html#module-profile
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Their are thre mistakes in this sentence.
- Rob Ray
It would seem the import lock breaks over the fork, so that the
child process doesn't hold the lock. But because it is a fork, it does
not know this! (Being identical to its parent.) So you raise SystemExit,
and during the stack unwind the child tries to release the lock. Which
it
that look like this:
def main(argv):
... parse args, do stuff ...
return exit_status
... functions, classes etc ...
if __name__ == '__main__':
sys.exit(main(sys.argv))
It seems fairly effective for keeping the top level logic up the top.
Cheers,
--
Cameron Simpso
$mypath/$myfile ]
[...]
Check out the glob module:
http://docs.python.org/library/glob.html#module-glob
Use it to do the glob, then os.path.isfile with a path constructed from
the result:
http://docs.python.org/library/os.path.html#os.path.isfile
Cheers,
--
Cameron Simpson DoD#743
http
e only troll here is YOU! [...]
I confess to finding these two sentences in your message contradictory.
Again, my poor comprehension skills must be to blame.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
That's just the sort of bloody stupid name they would choose
-c
possibly sent off into a temp file. That will let you see what character
are actually escaping from the program (versus terry's suggestion, which
is good for looking at the characters before they escape).
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
I'm not making any of this up you know. - Anna Russell
--
http://mail.python.org/mailman/listinfo/python-list
ystem) this is a
problem.
The "env" command is actually a special hook for setting environment
variables before running a command, but without extra arguments is can
be used to rely on $PATH to find the command. So the command:
/usr/bin/env python
incantation finds "the python th
e original python snippet.
If so, my apologies for the long misanswer.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
I was gratified to be able to answer promptly and I did.
I said I didn't know. - Mark Twain
--
http://mail.python.org/mailman/listinfo/python-list
Writing man pages in nroff is a bit tedious (though actually not all
that hard). Generating man pages from POD or some other similarly friendly
format is easy and desirable.
| Except possibly as the automated output of some multi-target
| documentation system which produces them as a by-product
The tag
closing etc is a PITA, I agree. Of course, in nroff you'd be going:
.H1 A Level One Heading
paragraph blah blah ...
No tedious closing tags there!
CCheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
(about SSSCA) I don't say this lightly. However, I real
sts (eg running as
validation of a live transaction stream, or in some audit mode) it may be
less useful than one might hope. Of course, if they're gone as far as
requiring python code, perhaps that's exactly what they hope to be able to
do.
Cheers,
--
Cameron Simpson DoD#743
http:
of (value, key) pairs using zip(): pairs = zip(d.values(),
d.keys()).
BTW, I got to that particular piece of text by starting at the doco for
the .values() method of "dict", which links to the .items() method.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
I cou
On 19Apr2010 21:31, alex23 wrote:
| Cameron Simpson wrote:
| > If items(), keys(), values(), iteritems(), iterkeys(), and
| > itervalues() are called with no intervening modifications to the
| > dictionary, the lists will directly correspond. This allows the
| > creation of
ly echoing Guido's
criterion of debuggability in language design
http://groups.google.com/group/comp.lang.python/msg/3ebe7a0b78086acf
Editor Cameron Laird apologizes for the following three entries, which
appeared in the last installment only in an unusably garbled form:
There is no module
QOTW: "... [T]hat kills yet another usage of C ..." - Maciej
Fijalkowski
http://morepypy.blogspot.com/2009/11/some-benchmarking.html
Making operations in the Fraction class automatically return a
subclass
instance when called with subclass arguments:
http://groups.google.com/grou
QOTW: "You see? That's what I like about the Python community: people
even
apologise for apologising :)" - Tim Golden
http://groups.google.com/group/comp.lang.python/msg/858d1c31d0c2adff
The third alpha version of Python 2.7 is ready for testing:
http://groups.google.com/group/comp
QOTW: "There's no RightAnswer(tm), just our best guess as to what is
the most
useful behavior for the most number of people." - Raymond Hettinger
http://groups.google.com/group/comp.lang.python/msg/e7f78ef27811781b
First beta version of Python 2.7 is available:
http://groups.google.
quot; etc in the test to get the
right names.
However, that means the unit test knows its own filename/module-name.
This doesn't feel totally nice.
Remarks, anyone?
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
I have an inferiority complex, but it isn't a very good one.
- Bill Garrett
--
http://mail.python.org/mailman/listinfo/python-list
("dev" is a wrapper to set PYTHONPATH
to use my work area, etc).
Since I've convinced myself that my previous practices were inherently
instantiating node.py twice with different names, I guess I can say my
problem is solved, for some definition of the term:-)
Cheers,
--
Camer
#x27;t_ want to duck-type the Node and merely test for "type" and "name"
values, because I want to be rather picky about what gets into the backend
database - the wrong types indicate bad app code, and should not be allowed
to introduce corrupt database values.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
That particular mistake will not be repeated. There are plenty of mistakes
left that have not yet been used. - Andy Tanenbaum
--
http://mail.python.org/mailman/listinfo/python-list
On 23Apr2010 13:25, Peter Otten <__pete...@web.de> wrote:
| Cameron Simpson wrote:
| > and it's failing. I've traced the failure cause, ending up with this
| > assertion message from the end of serialise() above:
| >
| > AssertionError: HOST:fo
a good job of this,
coping even with typical not quite right HTML. It gives you a parse
tree you can easily walk, and you can modify it in place and write it
straight back out.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
The Web site you seek
cannot be located but
end
On 29Apr2010 05:03, james_027 wrote:
| On Apr 29, 5:31 am, Cameron Simpson wrote:
| > On 28Apr2010 22:03, Daniel Fetchinson wrote:
| > | > Any idea how I can replace words in a html file? Meaning only the
| > | > content will get replace while the html tags, javascript, & css
On 30Apr2010 07:15, Stefan Behnel wrote:
| Cameron Simpson, 30.04.2010 00:47:
| >Here's a function from a script I wrote to bulk edit a web site. I was
| >replacing OBJECT and EMBED nodes with modern versions:
| >
| > def recurse(node):
| > global didmod
| > [..
ms) '.' and
'..' are just pointers to "here" and "up".
Your rmdir has detached the current directory from the one that was
"up", but the "up" pointer still references the old parent.
There's just no filesystem path that refers to you
e(x[1:], y + [x[0]])
Otherwise the function returns None.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
[...] every time you touch something, if your security systems rely
on biometric ID, then you're essentially leaving your pin number on a
post-it note. - Ben Gold
wed to do it).
|
| i think there are versions of mac osx that use hard-linked
| directories in their backup systems.
I believe TimeMachine exploits that.
I think one can make loops with recursive mounts.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
You can't go around hop
t tell
| whether 'boot' or 'home' is the correct next parent if it only
| checks the inode number? i think the algorithm would at least need
| to take account of changes in the current device id. not sure
| whether that would be enough to cover all cases, though.
Look at the st_rdev fi
On 06May2010 05:24, Nobody wrote:
| On Thu, 06 May 2010 10:21:45 +1000, Cameron Simpson wrote:
|
| > Look at the st_rdev field (== the device holding this inode).
| > When that changes, you've crossed a mount mount point.
|
| st_dev reports the device on which the inode resides.
|
|
[Authored by Gabriel Genellina.]
QOTW: "Even on alt.haruspicy they cannot do much without a liver now
and
then..." - Peter Otten
http://groups.google.com/group/comp.lang.python/msg/7852938d0b92bd7b
Mixing bytes and unicode when writing data in Python 3.x:
http://groups.google.com.a
e point out what's problem?
I don't suppose you have a file called "logging.py" in your working
directory? Python will find it before the system libraries; it is a bad
idea to name .py files the same as library module for this reason.
Cheers,
--
Cameron Simpson DoD#743
http://w
| handler for SIGTERM, which apparently never gets called).
I hate to tell you this, but ^C sends SIGINT, not SIGTERM.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
To have no errors
Would be life without meaning
No struggle, no joy
- Haiku Error Messages
http
avoid this error when I create the script on a windows
| machine?
The standard approach is to copy the file to the unix machine and use
the dos2unix command.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
A pessimist is an optimist in full possession of the facts.
--
http
usually much faster than bz2.
Have you tested the decompression or the problematic files with the
bunzip2 command? Just to ensure the bug is with the python bz2 module
and not with the pbzip2 utility?
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
A lot of people don't know
QOTW: "... it's just laziness and hubris passed off under the banner
of
agility." - Clifford Heath, on the fashion of justification of
"metaschemas"
because those darn data architects are just too slow
Efficient way to apply a function to every element in a list,
discarding
the results:
y can endure. I will bring some positive attitudes to this
| group if it's the last thing i do! That will be my contribution to
| this group, and it may just save the Python community as a whole!
Hmm. Your efforts are misdirected. It would be better to devote your
energies to implementing so
file.
You might try searching for "processing open document format with python"
or something like that.
You haven't, btw, said what you hoped to achieve above. I'm presuming
you're after the "text" content of the ODT document.
Cheers,
--
Cameron Simpson
Please don't top post; post below and trim the content.
Also, please do a reply-to-all to keep the discussion on the list.
Further content is below...
On 14Jun2010 11:44, madhuri vio wrote:
| On Mon, Jun 14, 2010 at 11:39 AM, Cameron Simpson wrote:
| > ODT files are _not_ text fil
yntactically correct and correctly spelt
code text faster than I, but I don't think that's where the majority of
my screen time goes.
Good docs (clean well indexed HTML, like javadoc and the python docs)
and a good HTML reader for me, rather than code completion.
Cheers,
--
Cameron Simpson D
QOTW: "Python advocacy seems to be by example, not cheerleading." -
Cameron
Simpson
http://groups.google.com/group/comp.lang.python/msg/2cc7e643702d0ec8
The first release candidate of Python 2.7 is now available for
testing:
http://groups.google.com/group/comp.lan
On Jun 6, 5:49 pm, Kevin Walzer wrote:
.
[much wisdom, particularly
in regard to Tkinter]
.
.
>
> The very diversity of GUI toolkits came into effect because Python is
> very easy to extend and integrate with other C/C++ libraries. Writing a
> GUI toolkit from scratch is much, muc
e "partial" function:
f2 = functools.partial(f, arg1, arg2, ...)
Then calling f2() will call f(arg1, arg2, ...). So you can pass "f2"
to an event handler. Of course, this means you need to know arg1 etc in
advance.
However, you really do need to show the calling end of
r
choice, such as that in the random module. Then binary search the list
for the matching item.
The list scales linearly as the number of choices, not exponentially
with the precision of the proportions. The search is logarithmic with
the number of choices. Beyond a very small number of choices the
QOTW: "It's hard to overestimate the variance you'll see when you
start
asking your users for information." - Cody Powell
http://www.codypowell.com/taods/2010/01/production-aint-pretty-a-case-for-excessive-application-logging.html
The second Release Candidate of Python 2.7 is available fo
. I do what you suggest (make SQL
statements at need) using SQLalchemy all the time. It is simple and easy
and _robust_ against odd data. The number of times I've had to
fix/remove insert-values-into-SQL-text code ...
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Plague, Fami
ause havoc when inserted with correctly escaped parameter
values if I tried, probably using quotes in the SQL typo part.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
George, discussing a patent and prior art:
"Look, this publication has a date, the patent has a prior
ring function by it's name.
Bah. It's for copying a _string_ into a _buffer_! Strangely, since it
starts with a string (NUL-terminated byte sequence) it begins with
"str". And it _is_ copying, but not into another string.
It is special purpose but perfectly reasonable for t
On 30Jun2010 12:19, Paul Rubin wrote:
| Cameron Simpson writes:
| > The original V7 (and probably earlier) UNIX filesystem has 16 byte directory
| > entries: 2 bytes for an inode and 14 bytes for the name. You could use 14
| > bytes of that name, and strncpy makes it effective to work
brush as a mouse click:-(
The Mac's click-to-focus model may also be helping me here - my thinkpad
desktop would be UNIX X11 in focus-follows-mouse mode, which is far more
sensitive to trouble from accidental mouse movement.
But yes, the trackpoint _greatly_ reduced my need to move my a
to use the http library module.
Rename your http.py file to "my-http-test.py" and retry.
Then its name won't get in the way of the library name.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Success in software development depends on making a carefully pl
answer the phone and say "Hello, Steven
| > speaking?" I often get called Peter.
|
| Er, without the question mark.
Ah, so you get differing results when you use the question mark?
Phonetic punctuation; Victor Borge would be proud.
--
Cameron Simpson DoD#743
http://www.cskk.ezos
mine, but I, the coder, _must_ care about the
details of using non-Booleans in a Boolean context.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
It is Texas law that when two trains meet each other at a railroad crossing,
each shall come to a full stop, and neither shall p
and writes to the file _before_ the echo command gets to run.
Wait for desLrr to complete before proceeding.
| fileName.seek(0,2)
| fileName.write ('%s %s %s \n' % (85,25,12))
| fileName.close()
And the rest is ok.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.
y.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
There is a chasm
of carbon and silicon
the software can't bridge
- Haiku Error Messages
http://www.salonmagazine.com/21st/chal/1998/02/10chal2.html
--
http://mail.python.org/mailman/listinfo/python-list
cause you have opened the file in 'a' mode you should not need the
.seek() - an "append" mode file will always write to the end of the
file.
So: your first problem only requires a .flush(), to empty the buffer
before "echo" or "ls" runs. However, you still hav
s usualy a bad
idea to catch broad things like "Exception". It is normally better to
place try/except around very small pieces of code and to catch very
specific things. That way you know exactly what's going wrong and don't
quietly catch all sorts of unplanned stuff.
Cheer
nd never waits for them _is_
bad in the long run. Process ids are often 2-byte integers on many
systems for it's quite feasible to fill the table, and depending on the
kernel's process table implementation a big process table might have other
performance side effects.
Cheers,
--
Cam
| grep R_HOME
Then, presuming it shows only in the first command:
export R_HOME
and then try your python script again.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
It is an approved maxim in war, never to do what the enemy wishes you to
do, for this reason alone, t
l stop) but on
| > linux, ps shows tcpdump as defunct process
| > what am I missing?
| > thanks for any help.
|
| I think I found it. need to call os.wait()
Yep. "defunct" == "zombie". See:
http://code.activestate.com/lists/python-list/580569/
Cheers,
--
Cameron Simpson
osted conversations this
way all the time. Works well.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
To be or not to be?Not to be.
- John Slater (Arnold Schwartzenegger),
_Macbeth_ (_The_Last_Action_Hero_)
--
http://mail.python.org/mailman/listinfo/p
gets sourced, because the terminal
is started by the desktop manager. Once common "fix" for this is to
make all new terminals run login shells. Ugh, but it does work. But it
they're not login shells, people stuff everything into their .bashrc
because the .profile doesn't get sourc
t hardwire ^W
either!)
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
To be positive: To be mistaken at the top of one's voice.
Ambrose Bierce (1842-1914), U.S. author. The Devil's Dictionary (1881-1906).
--
http://mail.python.org/mailman/listinfo/python-list
ecause many programs that change
their buffering when attached to a terminal also change other behaviour,
such as issuing interactiove prompts etc.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
The type syntax for C is essentially unparsable. - Rob Pike
--
http://mail.py
2201 - 2300 of 2434 matches
Mail list logo