On Sun, 26 May 2013 04:11:56 -0700, Ahmed Abdulshafy wrote:
I'm having a hard time wrapping my head around short-circuit logic that's
used by Python, coming from a C/C++ background; so I don't understand why
the following condition is written this way!
if not allow_zero and abs(x)
On Mon, 27 May 2013 13:11:28 -0700, Ahmed Abdulshafy wrote:
On Sunday, May 26, 2013 2:13:47 PM UTC+2, Steven D'Aprano wrote:
What the above actually tests for is whether x is so small that (1.0+x)
cannot be distinguished from 1.0, which is not the same thing. It is
also quite arbitrary. Why
On Thu, 23 May 2013 17:20:19 +1000, Chris Angelico wrote:
Aside: Why was PHP's /e regexp option ever implemented?
Because it's a stupid idea, and that's the only requirement for a feature
to be implemented in PHP.
--
http://mail.python.org/mailman/listinfo/python-list
New submission from Nobody/Anonymous:
report,您好!
$$
158766中 坚 力 量 6 堂 课158766
5月18-19日 北 京 05月25-26日 上 海 6月08-09日 深 圳
热 线 电 话 : 4 0 0 7 0 5 0 5 1 9
On Thu, 09 May 2013 05:23:59 +, Steven D'Aprano wrote:
There is no sensible use-case for creating a file without opening it.
What would be the point? Any subsequent calls to just about any method
will fail. Since you have to open the file after creating the file object
anyway, why make
On Wed, 08 May 2013 04:19:07 -0700, jamadagni wrote:
I have the below C program spiro.c (obviously a simplified testcase)
which I compile to a sharedlib using clang -fPIC -shared -o libspiro.so
spiro.c, sudo cp to /usr/lib and am trying to call from a Python script
spiro.py using ctypes.
On Sat, 27 Apr 2013 17:22:31 -0700, cormogram wrote:
Was trying os.execl() and got a python.exe has stopped working on my
Windows 7 Ultimate SP1 x64 desktop.
I'm using Python 2.7.4 and that happens when the second arg is ''. For
example:
os.execl('filename.exe','')
Note that, by
On Fri, 12 Apr 2013 00:06:21 +, Steven D'Aprano wrote:
The close method is defined and flushing and closing a file, so it
should not return until that's done.
But note that done in this case means the file system thinks it is
done, not *actually* done. Hard drives, especially the
On Wed, 10 Apr 2013 00:23:46 -0700, nagia.retsina wrote:
Look at what 'python3 metrites.py' gives me
File /root/.local/lib/python2.7/lib/python3.3/os.py, line 669, ...
^^^ ^^^
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 07 Apr 2013 01:30:45 +, Steven D'Aprano wrote:
Am I the only one here who has used a typewriter?
Tab stops were set manually, to a physical distance into the page, using
a mechanical stop. This long predates the rule that tab stops are every
8 characters.
And your point is?
On Fri, 05 Apr 2013 06:49:14 -0700, Candide Dandide wrote:
So, could someone please explain what exactly the is operator returns ?
The official doc says :
The ‘is‘ operator compares the identity of two objects; the id()
function returns an integer representing its identity (currently
On Fri, 05 Apr 2013 21:53:40 -0600, Ian Kelly wrote:
8 characters is common, but no more correct than any other,
This is pure revisionism. 8-column tabs may never have been a significant
/de jure/ standard (although they have been that in many specific
domains), but they have been a significant
On Mon, 01 Apr 2013 00:39:56 +, Alex wrote:
Given that
3
5
4
(i.e.: 4**5**3) is transitive,
I think you meant associative, and exponentiation isn't associative,
i.e. (x**y)**z is not, in general, equal to x**(y**z). In fact, (x**y)**z
is equal to x**(y*z).
Conventional
On Sat, 23 Mar 2013 19:37:35 -0500, Fabian von Romberg wrote:
I have a single questions regarding id() built-in function.
example 1:
var1 = some string
var2 = some string
if use the id() function on both, it returns exactly the same address.
I'm assuming that you used something other
On Thu, 21 Mar 2013 01:52:17 -0700, bartolome.sintes wrote:
In Python 3, free variable and nonlocal variable are synonym terms?
Free variable is a computer science term. A variable is free if it is
not bound. E.g. x and y are free in x+y, x is bound and y is free in
lambda x: x+y, x and y are
On Wed, 20 Mar 2013 07:17:08 -0700, bartolome.sintes wrote:
I thought that x += ... was the same than x = x + ..., but today I have
realized it is not true when operating with mutable objects.
It may or may not be the same. x += y will invoke x.__iadd__(y) if x has
an __iadd__ method,
On Sat, 09 Mar 2013 09:01:17 +1100, Chris Angelico wrote:
As I see it, a naive datetime simply does not have a timezone.
The distinction between aware and naive isn't whether the .tzinfo member
is None, but whether self.utcoffset() returns None (which can occur either
if self.tzinfo is None or
On Sat, 09 Mar 2013 14:40:14 -0500, Roy Smith wrote:
Future scheduled activities (which I assume is what you
mean by appointments) should be kept in whatever timezone makes sense
for that activity. For example, I'm on NASA's mailing list to receive
alerts when the ISS is going to be
On Fri, 08 Mar 2013 13:41:27 -0500, Roy Smith wrote:
So, the question is, WHY aren't aware and naive datetimes separate
classes? They share many attributes and methods, but not all.
They share all attributes and methods.
You could just as well ask why positive and negative floats aren't
On Sat, 02 Mar 2013 18:52:19 +0100, Kwpolska wrote:
Also, you can do `except:` for a catch-all, but it is discouraged unless
you have REALLY good reasons to do this. And, most of the time, you
don’t.
Most of the time you probably want to catch either Exception (which
excludes GeneratorExit,
On Fri, 01 Mar 2013 17:24:05 +0800, Honghe Wu wrote:
Thanks! Cause I need sorted returnd list, and the arbitrary list makes the
other procedure go wrong. Maybe the I/O speed is more important in other
cases.
You can sort the lists of files and subdirectories with e.g.:
for root,
of objects provided that either the left-hand operand has an
__add__ method or the right-hand operand has a __radd__ method.
Or is it actually possible to do, but so much work that nobody does it?
It's not that it's so much work as much as the fact that the resulting
executable wouldn't be any faster
On Wed, 13 Feb 2013 11:00:15 -0800, stephenwlin wrote:
Would it be feasible to modify the Python grammar to allow ':' to generate
slice objects everywhere rather than just indexers and top-level tuples of
indexers?
If you need to be able to easily construct indexing objects, create a
helper
On Fri, 15 Feb 2013 11:47:33 -0800, Gary Herron wrote:
Floating point calculations on a computer (ANY computer, and ANY
programming language) can *never* be expected to be exact!
never is incorrect. There are many floating-point calculations
which can reasonably be expected be exact[2].
On Fri, 08 Feb 2013 21:04:33 -0800, Victor Hooi wrote:
I have a Python script that I'd like to spawn a separate process (SSH
client, in this case), and then have the script exit whilst the process
continues to run.
I looked at Subprocess, however, that leaves the script running, and it's
On Tue, 05 Feb 2013 21:01:56 +, Walter Hurry wrote:
Hooray for common sense! Python is great, but it's silly to use Python
(unless there is good reason) when a simple shell script will do the job.
A shell script is only the better option if (almost) the *only* thing the
script needs to do
Hi,
I have a client program Client.py which has a statement of sockobj.connect(),
the port number 6 is used, so no problem from port permission.
I am puzzled because I can run Client.py from command line in my user account
or apache user account without any problems.
But if I run it
Hi,
I have a class ClientHandler(asyncore.dispatcher_with_send), it was running
fine without calling any of my own classes. But it got following exception when
I called my own class GetMyResponse inside the def handle_read(self). Not sure
why it causes disturbance to
On Mon, 21 Jan 2013 07:25:06 -0400, Tom Borkin wrote:
It opens the first song and hangs on subsequent songs. It doesn't open the
next song or execute the print until I have closed the first one. I want it
to open all in the list, one after another, so I have all those songs
available. Please
On Thu, 17 Jan 2013 07:02:24 -0800, Utpal Sarkar wrote:
I was assuming that sys.stdout would be referencing the same physical
stream as iostreams::cout running in the same process, but this doesn't
seem to be the case.
At startup, it refers to the same FILE* as C's stdout. This initially
On Wed, 02 Jan 2013 00:49:36 +0100, someone wrote:
In [11]: del format
---
NameError Traceback (most recent call last)
ipython-input-11-028e6ffb84a8 in module()
1 del format
On Tue, 11 Dec 2012 13:25:36 +, andrea crotti wrote:
But actually why do I need to move away from the current directory of the
parent process?
It's not required, it's just best practice.
Often, the current directory is simply whichever directory it happened to
inherit from the shell which
On Thu, 29 Nov 2012 10:09:44 +0100, Thomas Rachel wrote:
The variant with shell=True is more os.popen()-like, but has security
flaws (e.g., what happens if there are spaces or, even worse, ;s in the
command string?
I think that you're conflating the shell= option with whether the command
is a
On Wed, 28 Nov 2012 04:30:25 -0800, Alasdair McAndrew wrote:
What I want to know is - what are the current standard libraries for
image processing in Python which are in active development?
NumPy/SciPy.
PIL is fine for loading/saving image files (although if you're using a GUI
toolkit, that
On Sun, 25 Nov 2012 04:11:29 -0800, ALeX inSide wrote:
How to statically type an instance of class that I pass to a method of
other instance?
Python isn't statically typed. You can explicitly check for a specific
type with e.g.:
if not isinstance(arg, SomeType):
raise
On Wed, 21 Nov 2012 03:24:01 -0800, danielk wrote:
import sys
sys.stdout.encoding
'cp437'
Hmmm. So THAT'S why I am only able to use 'cp437'. I had (mistakenly)
thought that I could just indicate whatever encoding I wanted, as long as
the codec supported it.
sys.stdout.encoding
On Mon, 19 Nov 2012 21:45:55 -0800, frednotbob wrote:
What I'm trying to do is set a persistent state for the levels generated
by make_map(), so the player can move between floors without generating a
totally new randomized floor each time.
You need to distinguish between immutable data (e.g.
On Sat, 17 Nov 2012 08:56:46 -0800, buck wrote:
Given that the only differences between the two are for code points
which are in the C1 range (0x80-0x9F), which should never occur in HTML,
parsing ISO-8859-1 as Windows-1252 should be harmless.
should is a wish. The reality is that documents
On Thu, 15 Nov 2012 20:07:38 -0500, Roy Smith wrote:
gethostbyname() and getaddrinfo() use the NSS (name-service switch)
mechanism, which is configured via /etc/nsswitch.conf. Depending upon
configuration, hostnames can be looked up via a plain text file
(/etc/hosts), Berkeley DB files, DNS,
On Fri, 16 Nov 2012 13:44:03 -0800, buck wrote:
When a user agent [browser] would otherwise use a character encoding given
in the first column [ISO-8859-1, aka latin1] of the following table to
either convert content to Unicode characters or convert Unicode characters
to bytes, it must
On Wed, 14 Nov 2012 20:49:19 -0500, Roy Smith wrote:
I'm slightly surprised that there's no way with the Python stdlib to
point a DNS query at a specific server
Me too, including the only slightly part. The normal high-level C
resolver routines (getaddrinfo/getnameinfo, or even the old
On Thu, 01 Nov 2012 19:16:17 -0700, Richard wrote:
I create child processes with subprocess.Popen().
Then I either wait for them to finish or kill them.
Either way these processes end up as defunct until the parent process
completes:
$ ps e
6851 pts/5Z+ 1:29 [python] defunct
You
On Thu, 25 Oct 2012 22:04:52 -0400, Terry Reedy wrote:
Containment of nan in collection is tested by is, not ==.
AFAICT, it isn't specific to NaN. The test used by .index() and in
appears to be equivalent to:
def equal(a, b):
return a is b or a == b
IOW, it always checks
On Sat, 27 Oct 2012 08:56:16 +0200, Thomas Rachel wrote:
Am 27.10.2012 06:48 schrieb Dennis Lee Bieber:
I don't know about the more modern calculators, but at least up
through my HP-41CX, HP calculators didn't do (binary) floating
point... They did a form of BCD with a fixed number of
On Sat, 27 Oct 2012 07:42:01 -0700, zlchen.ken wrote:
I have a DLL which written in C language, one of the function is to
allocate a structure, fill the members and then return the pointer of
the structure.
After Python called this function, and done with the returned structure,
I would
On Sat, 20 Oct 2012 13:43:16 -0700, Julien Phalip wrote:
I've noticed that the encoding of non-ascii filenames can be inconsistent
between platforms when using the built-in open() function to create files.
For example, on a Ubuntu 10.04.4 LTS box, the character u'ş' (u'\u015f')
gets encoded
On Thu, 18 Oct 2012 14:05:58 +0100, andrea crotti wrote:
Maybe a solution would be to redirect the stderr to file and watch that
instead..
Or otherwise I could use a thread for each shell command, but I would like
to avoid head-aches with possible race-conditions..
If you're running
On Thu, 18 Oct 2012 14:44:27 +0100, andrea crotti wrote:
Uhh I see thanks, I guess I'll use the good-old .lock file (even if it
might have some problems too).
In which case, you don't see. A lock file is also advisory, i.e. it only
affects applications which explicitly check for a lock file.
On Tue, 16 Oct 2012 08:51:46 -0500, Pradipto Banerjee wrote:
I am trying to define class, where if I use a statement a = b, then
instead of a pointing to the same instance as b, it should point to a
copy of b, but I can't get it right.
It cannot be done.
Name binding (variable = value) is a
On Fri, 12 Oct 2012 12:28:17 -0400, Dave Angel wrote:
Using bare excepts is almost never a good idea. If it works you get no
clues what went wrong. For example, a typo in source code can trigger a
bare exception, as can a user typing Ctrl-C. So when you're using bare
excepts, you have
On Mon, 08 Oct 2012 12:28:43 -0700, mooremathewl wrote:
import itertools
x = [1, 2, 3]
y = list(itertools.chain.from_iterable(('insertme', x[i]) for i in
range(len(x y
['insertme', 1, 'insertme', 2, 'insertme', 3]
[i for j in [1,2,3] for i in ('insertme', j)]
On Fri, 28 Sep 2012 11:48:23 -0600, Kristen J. Webb wrote:
NOTE: I am a C programmer and new to python, so can anyone comment
on what the st_ctime value is when os.stat() is called on Windows?
The documentation[1] says:
st_ctime - platform dependent; time of most recent metadata change on
On Fri, 28 Sep 2012 06:12:35 -0700, 陈伟 wrote:
what is the difference between st_ctime and st_mtime one is the time of
last change and the other is the time of last modification, but i can
not understand what is the difference between 'change' and 'modification'.
st_mtime is updated when the
On Fri, 21 Sep 2012 15:23:41 -0700, Paul Rubin wrote:
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes:
Have I got this right? Is there a way to work out the gap between one
float and the next?
Yes, 53-bit mantissa as people have mentioned. That tells you what ints
can be
On Fri, 21 Sep 2012 17:29:13 +, Steven D'Aprano wrote:
The question is, what is the largest integer number N such that every
whole number between -N and N inclusive can be represented as a float?
If my tests are correct, that value is 9007199254740992.0 = 2**53.
Have I got this right?
On Thu, 20 Sep 2012 23:06:46 +0200, Gelonida N wrote:
I'd like to implement the equivalent functionality of the unix command
/usr/bin/which
The function should work under Linux and under windows.
Note that which attempts to emulate the behaviour of execvp() etc. The
exec(3) manpage will
On Sun, 16 Sep 2012 12:40:18 +0200, Hans Mulder wrote:
But you should get into the habit of using shell=False whenever
possible, because it is much easier to get it right.
More accurately, you should get into the habit of passing a list as the
first argument, rather than a string.
On
On Sat, 15 Sep 2012 04:36:00 +, jyoung79 wrote:
I am working in both OS X Snow Leopard and Lion (10.6.8 and 10.7.4).
I'm simply wanting to move folders (with their content) from various
servers to the hard drive and then back to different directories on the
servers.
I want to be
On Wed, 29 Aug 2012 19:39:15 -0400, Piet van Oostrum wrote:
Reading from stdin/a file gets you bytes, and not a string, because
Python cannot automagically guess what format the input is in.
Huh?
Oh, it can certainly guess (in the absence of any other information, it
uses the current
On Sun, 19 Aug 2012 14:01:15 -0700, Giacomo Alzetta wrote:
You can obtain the working directory with os.getcwd().
Maybe. On Unix, it's possible that the current directory no longer
has a pathname. As with files, directories can be deleted (i.e.
unlinked) even while they're still in use.
On Mon, 06 Aug 2012 21:02:33 -0700, Larry Hudson wrote:
for i in range(N,N+100):
for j in range(M,M+100):
do_something(i % 100 ,j % 100)
Emile
How about...
for i in range(100):
for j in range(100):
do_something((i + N) % 100, (j + M) % 100)
On Mon, 06 Aug 2012 06:32:13 -0700, S.B wrote:
Does anyone know if it's possible to pickle and un-pickle a file across
a network socket. i.e: First host pickles a file object and writes the
pickled file object to a client socket. Second host reads the pickled
file object from the server
On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote:
consider a nested loop algorithm -
for i in range(100):
for j in range(100):
do_something(i,j)
Now, suppose I don't want to use i = 0 and j = 0 as initial values, but
some other values i = N and j = M, and I want to iterate
On Fri, 03 Aug 2012 04:49:46 -0700, Subhabrata wrote:
I am trying to call the values of one function in the another function
in the following way:
def func1():
num1=10
num2=20
print The Second Number is:,num2
return
def func2():
num3=num1+num2
On Fri, 03 Aug 2012 13:48:08 -0700, Tobiah wrote:
I have a bunch of classes from another library (the html helpers
from web2py). There are certain methods that I'd like to add to
every one of them. So I'd like to put those methods in a class,
and pass the parent at the time of
On Mon, 23 Jul 2012 06:01:23 -0700, Sarbjit singh wrote:
proc = subprocess.Popen(cp -i a.txt b.txt, shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,)
stdout_val, stderr_val = proc.communicate()
print stdout_val b.txt?
proc.communicate(y)
Now in
On Sun, 08 Jul 2012 22:57:56 +0200, Laszlo Nagy wrote:
Yes, this is much better. Almost perfect. Don't forget to consult your
system documentation, and check if the rename operation is atomic or not.
(Most probably it will only be atomic if the original and the renamed file
are on the same
On Wed, 04 Jul 2012 20:10:47 -0700, self.python wrote:
2. after this, I typed like cd .. but I/O is already closed so I
can't do another things..
Don't use .communicate() if you want to keep the child process alive.
Write to p.stdin and read p.stdout and p.stderr.
In general, you'll need to
On Wed, 06 Jun 2012 05:50:02 -0700, loial wrote:
I have a requirement to test the creation time of a file with the current
time and raise a message if the file is more than 15 minutes old.
Platform is Unix.
I have looked at using os.path.getctime for the file creation time and
On Thu, 24 May 2012 13:22:43 -0700, Scott Siegler wrote:
is there a way to do something like:
[(x,y-1), (x,y+1) for zzz in coord_list]
or something along those lines?
[(xx,yy) for x, y in coord_list for xx, yy in [(x,y-1),(x,y+1)]]
or:
[(x,yy) for x, y in coord_list for yy in
On Sat, 26 May 2012 11:34:19 -0400, Roy Smith wrote:
The Rasberry Pi certainly looks attractive, but isn't quite available
today. Can you run Python on an Arduino? Things like
http://www.embeddedarm.com/products/board-detail.php?product=TS-7250 are
more than I need, and the $129 price
On Sat, 19 May 2012 11:30:46 +0200, Johannes Bauer wrote:
import ctypes
libc = ctypes.cdll.LoadLibrary(/lib64/libc-2.14.1.so)
print(libc.strchr(abcdef, ord(d)))
In 3.x, a string will be passed as a wchar_t*, not a char*. IOW, the
memory pointed to by the first argument to strchr() will
On Thu, 26 Apr 2012 11:31:39 -0700, John Nagle wrote:
I would suggest that is raise ValueError for the ambiguous cases.
If both operands are immutable, is should raise ValueError. That's the
case where the internal representation of immutables shows through.
This breaks one of the most
On Mon, 23 Apr 2012 10:01:24 -0700, Paul Rubin wrote:
I can't think of a single case where 'is' is ill-defined.
If I can't predict the output of
print (20+30 is 30+20) # check whether addition is commutative print
(20*30 is 30*20) # check whether multiplication is commutative
On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote:
can I somehow overload operators like =, - or something like that?
(I'm searching for appropriate overload for logical implication if a then
b)
You cannot create new operators, but you can control how existing
operators work on types which
On Sun, 08 Apr 2012 04:11:20 -0700, Xah Lee wrote:
Ok no problem. My sloppiness. After all, my implementation wasn't
portable. So, let's fix it. After a while, discovered there's the
os.sep. Ok, replace / to os.sep, done. Then, bang, all hell
went lose. Because, the backslash is used as
On Fri, 06 Apr 2012 12:21:51 -0700, Dubslow wrote:
It's just a short test script written in python, so I have no idea how
to even control the buffering
In Python, you can set the buffering when opening a file via the third
argument to the open() function, but you can't change a stream's
On Sat, 07 Apr 2012 14:15:09 -0700, KRB wrote:
I would like to be able to pass a list of variables to a procedure, and
have the output assigned to them.
Use a dictionary or an object.
If the variables are globals (i.e. attributes of the current module), you
can pass the result of globals()
On Thu, 05 Apr 2012 23:57:49 -0700, bunslow wrote:
Okay, I've been trying for days to figure this out, posting on forums,
Googling, whatever. I have yet to find a solution that has worked for me.
(I'm using Python 3.2.2, Ubuntu 11.04.) Everything I've tried has led to
buffered output being
On Thu, 05 Apr 2012 22:28:19 -0700, rusi wrote:
All this mess would vanish if the string-literal-starter and ender
were different.
You still need an escape character in order to be able to embed an
unbalanced end character.
Tcl and PostScript use mirrored string delimiters (braces for Tcl,
On Fri, 06 Apr 2012 06:22:13 -0700, rusi wrote:
But are not such cases rare?
They exist, therefore they have to be supported somehow.
For example code such as:
print ''
print str(something)
print ''
could better be written as
print '%s' % str(something)
Not if the text between the
On Wed, 04 Apr 2012 08:14:18 -0400, Roy Smith wrote:
And sparse files are really hard to reproduce, at least on Unix: on
Linux even the system's cp doesn't guarantee sparseness of the copy (the
manual mentions a crude heuristic).
I imagine the heuristic is to look for blocks of all zeros.
On Mon, 02 Apr 2012 16:19:05 -0700, Astan Chee wrote:
and I'm trying to convert this into python and I'm rather stuck with
pycrypto as there is no example on how to make the public key with a mod
and exponent (or I've probably missed it).
from Crypto.PublicKey import RSA
mod =
On Wed, 28 Mar 2012 11:31:21 +0200, Jabba Laci wrote:
Is the following function correct? Is the input file closed in order?
def read_data_file(self):
with open(self.data_file) as f:
return json.loads(f.read())
Yes.
The whole point of being able to use a file as a context
On Fri, 17 Feb 2012 16:53:00 +0900, Zheng Li wrote:
def method1(a = None):
print a
i can call it by
method1(*(), **{'a' : 1})
I am just curious why it works and how it works?
and what do *() and **{'a' : 1} mean?
In a function call, an argument consisting of * followed by an
On Thu, 16 Feb 2012 17:15:59 -0800, Stodge wrote:
Does anyone know of a library to generate class definitions in memory,
at runtime, from XSD or JSON? I know about PyXB, generateDS and some
others, but they all rely on generating python source files at the
command line, and then using those
On Fri, 20 Jan 2012 08:42:16 -0600, skip wrote:
The library documentation doesn't talk a lot about long-lived subprocesses
other than the possibility of deadlock when using Popen.wait(). Ideally, I
would write to the subprocess's stdin, check for output on stdout and
stderr, then lather,
On Wed, 18 Jan 2012 09:05:42 +0100, Peter Otten wrote:
Python has a special errorhandler, surrogateescape to deal with
bytes that are not valid UTF-8.
On Wed, 18 Jan 2012 11:16:27 +0100, Olive wrote:
But is it safe even if the locale is not UTF-8?
Yes. Peter's reference to UTF-8 is
On Tue, 03 Jan 2012 15:45:20 +1000, Ashton Fagg wrote:
I'm working with an embedded machine, which is using a Python script to
oversee the acquisition of some data. The supervisor script, which is
run by crontab every 5 minutes, relies on an environment variable to be
set. I've tried to
On Sat, 24 Dec 2011 23:09:50 -0800, GZ wrote:
I run into a weird problem. I have a piece of code that looks like the
following:
f(, a=None, c=None):
assert (a==None)==(c==None)
The problem is that == is not implemented sometimes for values in a
and c, causing an exception
On Sun, 11 Dec 2011 22:02:23 -0800, Chris Rebert wrote:
p = subprocess.Popen(['du', '-sh'], cwd='/Users/jay/.Trash/',
stdout=subprocess.PIPE)
Alternatively, you can opt to use the shell by passing shell=True as
an argument.
Except that the OP is talking about a directory passed to the cwd=
On Fri, 09 Dec 2011 01:55:28 -0800, Massi wrote:
Thank you all for your replies, first of all my Sum function was an
example simplifying what I have to do in my real funciton. In general
the D dictionary is complex, with a lot of keys, so I was searching
for a quick method to access all the
On Mon, 05 Dec 2011 00:20:32 -0800, Mark Dickinson wrote:
May be, yes, but since calcsize() is returning 12 when the elements
are put in the other order, it would seem to be not counting such
padding.
Indeed. That's arguably a bug in the struct module,
There's no arguably about it. The
On Mon, 05 Dec 2011 16:23:55 +, Grant Edwards wrote:
Emitting \b \b is one very common way to do a destructive backspace.
Inelegant? Perhaps, but a common inelegance.
That's pretty much the only way I've seen it done for the past 25
years.
... before which, it was BS-DEL-BS.
DEL being
On Tue, 06 Dec 2011 10:19:55 +0430, Sergi Pasoev wrote:
I wonder if it is realistic to get a single key press in Python
without ncurses or any similar library.
On Unix, you need to use termios.tcsetattr() to disable canonical mode.
Otherwise, the tty driver will only pass data up to the
On Sat, 19 Nov 2011 15:32:18 -0600, nivashno wrote:
I always thought that xml was very precisely split up into nodes,
childnodes, etc, no matter what the whitespace between them was. But
apparently not, or am I missing something?
XML allows mixed content (an element's children can be a
On Thu, 03 Nov 2011 14:16:50 +, Grant Edwards wrote:
in my python application I am calling functions from a C library via
`ctypes` interface. Some fns from that C library calls `exit()` on
error.
Just curious, which library is that?
I'm reasonably sure that he's talking about the GRASS
On Thu, 27 Oct 2011 01:57:55 -0700, faucheuse wrote:
I get this error : OSError : [Errno 8] Exec format error.
The most likely reason for this error is a missing or invalid
shebang, e.g.:
#!/usr/bin/python
or:
#!/usr/bin/env python
The #! must be the first two bytes in the
On Thu, 27 Oct 2011 12:08:45 +0200, candide wrote:
I realize that built-in types objects don't provide a __dict__ attribute
and thereby i can't set an attribute to a such object, for instance
Note that possession or absence of a __dict__ attribute doesn't
necessarily mean that you can or
On Wed, 12 Oct 2011 13:28:35 +0200, Laurent wrote:
from __future__ import division
1/2
0.5
Wohaw. This means that this behavior is going to be default in a
foreseeable future ?
It's the default in 3.x. I can't imagine it ever being the default in 2.x.
--
101 - 200 of 724 matches
Mail list logo