will return the complex result. It may not be
what van Brakel wants here, but it's an alternative to keep in mind.
And I find it easier to type.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
, but also suggests you may
be playing hopscotch in a minefield. This is a helpful group. Give
us more to go on, and you are likely to receive thousands of
dollars worth of consulting for free.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
is the
other way. The recv in
leng = ntoh(socket.recv(2))
might return one byte of data, not two. The latter recv is similar.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
measurements still isn't a
bad idea (but don't tell my algorithms students).
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
' % ANT_CMD)
There you don't want the quotes within the string. On my MS-Win box:
import os
os.path.isfile(r'C:\Program Files\Windows NT\dialer.exe')
True
print os.path.isfile(r'C:\Program Files\Windows NT\dialer.exe')
False
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python
common cases where their own software choked on the paths. I
got into the habit of installing everything under c:\bin rather than
C:\Program Files. I still do that just to avoid writing essays into
my PATH variable.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
is doing. If he's testing
network throughput just by creating this file on a remote server,
the seek-way-past-end-then-write trick won't serve his purpose.
Even if the filesystem has to write all the zeros, the protocols
don't actually send those zeros.
--
--Bryan
--
http://mail.python.org/mailman
a particularly good and easily accessible
source to recommend on SQL?
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
Robert Bossy wrote:
Bryan Olson wrote:
Robert Bossy wrote:
Robert Bossy wrote:
Indeed! Maybe the best choice for chunksize would be the file's buffer
size...
That bit strikes me as silly.
The size of the chunk must be as little as possible in order to minimize
choice.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
, or to create another thread (or process) to be an
active reader or writer.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
descriptors. (MS-Windows async mechanisms are
not as well exposed by the Python standard library.)
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
XML Schema validation, this may seem tedious
but it is likely to be less tedious than relying on any APIs to agree
in the wide wonderful world of Soap based WebServices.
Cheers,
Bryan Rasmussen
On Tue, Mar 11, 2008 at 10:38 PM, Paul Watson
[EMAIL PROTECTED] wrote:
Has anyone successfully
raised
only if some calling frame has arranged to catch it.
The if-exception-would-be-unhanded-then-pass logic strikes me as
interesting. It would be a huge change to Python, so I doubt it
will get traction here. Still, I'd say it's worth more
consideration and discussion.
--
--Bryan
--
http
(self). We want an
implementation where the find_by's run in O(1 + k) where k is
the length of the returned sequence.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
.
I think this works:
from math import frexp, ldexp, floor
def round_mantissa(x, nbits):
shifter = 1 nbits
(m, e) = frexp(x)
m = floor(m * shifter + 0.5) / shifter
return ldexp(m, e)
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
the browser to look for the jpg
one directory above.
Failing that, can look at the web server's log?
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Bryan Olson wrote:
How can we efficiently implement an abstract data type, call it
'DoubleDict', where the state of a DoubleDict is a binary
relation, that is, a set of pairs (x, y); and the operations on
a DoubleDict are those on a Python set, plus
of the CGI script is the path to the script, not the
path to the html file.
If server logs are hard to get or read, try my runcgi.py script:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/550822
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
,
checking the referrer is a weak solution; the better method is
based on cookies.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
that are loaded from the file conform to Unicode
regular expressions. What problems can be expected using Unicode Regex
with Python, is there a library I should be using?
Cheers,
Bryan Rasmussen
--
http://mail.python.org/mailman/listinfo/python-list
New submission from Bryan Silverthorn:
Attached is a very short patch against r59568 which asserts tp_traverse
on (the types of) objects allocated in PyType_GenericAlloc(). As far as
I'm aware, tp_traverse should always be set at this point. Catching that
error early, even if only in debug
I am working on a task to display a wireless network nodes using Google Earth
(GE) with KML network links. I am using a simple python webserver (see code
below) to serve up the python scripts as KML output to GE for this.
import BaseHTTPServer
import CGIHTTPServer
class
Could we name Stackless Die, microthread! Die! then?
Cheers,
Bryan Rasmussen
On Dec 4, 2007 4:04 PM, Shane Geiger [EMAIL PROTECTED] wrote:
Die, thread! Die!
grflanagan wrote:
On Dec 4, 11:53 am, [EMAIL PROTECTED] wrote:
On Dec 4, 11:36 am, MarkE [EMAIL PROTECTED] wrote:
Ithon
whitespace between arguments.
Cheers,
Bryan Rasmussen
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I need to read in a system of files and write them to an iso 9660, any
libraries suited to this task that are up to date? Python 2.4 or 2.5
should be assumed.
Cheers,
Bryan Rasmussen
--
http://mail.python.org/mailman/listinfo/python-list
Treatment = Dynamic Dose
Last Name = Fodness
First Name = Bryan
Patient ID = 0001
Number of Fields = 4
Number of Leaves = 120
Tolerance = 0.50
Field = 10
Index = 0.
Carriage Group = 1
Operator =
Collimator = 0.0
Leaf 1A = 0.00
Leaf 2A = 0.00
Leaf 3A = 0.00
Leaf 4A = 0.00
Leaf 5A
in multiple threads,
that's a different issue.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
socket, they can feed us a *poison* pickle. The
marshal module is at least as bad.
The marshaling in RPC facilities tends to be much safer.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
]+', c)
print re.findall('[^ce ]+', c)
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
not breaking client code.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
Lawrence D'Oliveiro wrote:
Bryan Olson wrote:
Lawrence D'Oliveiro wrote:
In Bryan Olson wrote:
coldpizza wrote:
It turned out that the method above ('SELECT * FROM TABLE LIMIT L1,
L2') works ok both with mysql and sqlite3, therefore I have decided to
stick with it until I find something
trees,
or skip-lists.
Implementing these is non-trivial, but easily within the
ability of many people here. Don't worry about the coding.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
http://en.wikipedia.org/wiki/Squid_proxy
Web apps tend to scale just great, except when they need
data that is both shared and modifiable.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
the mysql syntax (LIMIT NN, 10) for compatibility reasons.
A more reliable form is along the lines:
SELECT keyfield, stuff
FROM table
WHERE keyfield ?
ORDER BY keyfield
LIMIT 10
With the right index, it's efficient.
--
--Bryan
--
http://mail.python.org/mailman/listinfo
Lawrence D'Oliveiro wrote:
In Bryan Olson wrote:
coldpizza wrote:
It turned out that the method above ('SELECT * FROM TABLE LIMIT L1,
L2') works ok both with mysql and sqlite3, therefore I have decided to
stick with it until I find something better. With Sqlite3 you are
supposed to use
Alex Martelli wrote:
Bryan Olson [EMAIL PROTECTED] wrote:
...
YouTube (one of Google's most valuable properties) is essentially
all-Python (except for open-source infrastructure components such as
lighttpd). Also, at Google I'm specifically Uber Tech Lead, Production
Systems: while I
of
these days I want to get around to writing a patch.
Windows can do it, but differently. What a surprise.
I just looked it up: WSADuplicateSocket() is the key.
Windows and Unix modules with the same Python interface
would rock.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli wrote:
Bryan Olson wrote:
[...]
How does Google use Python? As their scripting-language
of choice. A fine choice, but just a tiny little piece.
Maybe Alex will disagree with me. In my short time at
Google, I was uber-nobody.
YouTube (one of Google's most valuable properties
propose.
The web frameworks that use those toolkits try to do
things in robust and portable ways.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
does not offer.
Possibly the study used a bias sample.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
of the last evaluation; it
is stored in the __builtin__ module. When not in interactive
mode, _ has no special meaning and is not defined.
[Python Reference Manual; 2.3.2 Reserved classes of
identifiers. http://docs.python.org/ref/id-classes.html]
--
--Bryan
--
http
, or choose another term that clues one
in to the meaning. I'd have caught on much quicker given a
a hint to read:
lambda x, y: x + y
as: the function of two variables, call them x and y, that
returns x + y.
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
Bryan Olson [EMAIL PROTECTED] writes:
[EMAIL PROTECTED] wrote:
There are already anonymous functions in Python.
lambda x, y, z: x + y + z
is the same as:
def _(x, y, z): return x + y + z
They are the same only in special cases:
The special identifier _ is used
[EMAIL PROTECTED] wrote:
Bryan Olson wrote:
One surprising result was that more of the Python
programmers surveyed use bitwise operators than are aware
of the exponentiation operator, which C does not offer.
On that subject, I'd suggest that the pow() builtin (not the **
operator - just
New submission from Bryan Henderson:
There's some inconsistency among the code and documentation as to the
required level of Berkeley DB. I don't know what the proper
resolution, but I'm sure someone familiar with the history of this code
does. Something needs to be done to reduce
of the old state, but the object's equality test will
compare against the current state.
Bummer. Sorry.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
does GWS invoke a Java app? The Google way.
How does Google use Python? As their scripting-language
of choice. A fine choice, but just a tiny little piece.
Maybe Alex will disagree with me. In my short time at
Google, I was uber-nobody.
--
--Bryan
--
http://mail.python.org/mailman/listinfo
want to implement slicing.
Bad news: Python 3000 has no immutable type for byte-strings.
The new bytes type cannot serve for dict keys or set members.
Many things one would want to hash are unhashable -- for
example, the results of the hash functions in hashlib.
--
--Bryan
--
http
++ FAQ.
Follow-ups to comp.lang.c++
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
Rustom Mody asked:
[...] why does
(yield(x) for x in si(l) if x % p != 0)
not work? I would have expected generator expression to play better
with generators.
You have a statement, yield(x), where the construct requires
an expression.
--
--Bryan
--
http://mail.python.org/mailman
to long shots. Still, hosts that support Perl
but will not support Python are getting to be the rare.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
J. Cliff Dyer wrote:
Bryan Olson wrote:
Scott David Daniels wrote:
C, which was designed as a high level assembly language, does not
tightly define the results of / and % for negative numbers. Instead
it defines the result for positive over positive, and constrains the
result
Context switches are generally more expensive than acquiring
and release locks. Most systems' run-queues are protected by
locks. The context switches at issue all involve the
dedicated core, so I do not see any parallelism advantage.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
?
Generally, most experts seem to prefer:
#!/usr/bin/env python
You might try changing the the extension of your script from .py
to .cgi. Windows uses the .py to choose the executable, but Unix
does not care; it used the shebang line.
--
--Bryan
--
http://mail.python.org/mailman/listinfo
rounds. In C, integer
division rounds toward zero. In Python, integer division rounds
downward.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
’’.
[International Standard ISO/IEC 9899:1999, Section 6.5.5
Multiplicative operators, Paragraph 6 and footnote 87]
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
exhibited a SHA-1 collision?
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
a result with the same sign
as its second operand (or zero)
[http://docs.python.org/ref/binary.html]
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
Dotan Cohen wrote:
On 10/09/2007, Bryan Olson [EMAIL PROTECTED] wrote:
Not according to the C standard:
When integers are divided, the result of the / operator is
the algebraic quotient with any fractional part discarded.(87)
If the quotient a/b is representable
.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
The expression faint praise comes to mind.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
list of 300 references to the same
5-element list. A reduced example:
lst = [[[],[],[],[],[]]] * 3
lst[1][1].append(42)
print lst
[[[], [42], [], [], []], [[], [42], [], [], []], [[], [42], [], [], []]]
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
an explanation
of complex numbers to the point of omitting the imaginary unit
helps lead people to a conceptual *misunderstanding*. I don't
like feeling confused, but where I really screw up is where I
think I understand what I do not.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python
. Python has no threadicide method, and its
absence is not an oversight. Can you arrange for your threads
to check a flag periodically, or might they be hung? Your
other choice is to end the entire process.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
and flexibility
are laudable, while duck-typing is a convenience that will
always make it less reliable than more type-strict languages.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
for the host means INADDR_ANY,
which does not really make sense for the client. On my Win-XP
system, the client fails with
socket.error: (10049, Can't assign requested address)
For the loop-back adapter, 'localhost' or '127.0.0.1' should
work.
--
--Bryan
--
http://mail.python.org/mailman/listinfo
interpreters serving multiple connections.
The only hard part is shared data. Scalability is all about
the database.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
reference semantics, there
are object request brokers.
Say more about your problem, and there's a good chance you'll
get more useful answers.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I just started with python, and have a for loop question
In c++ (or a number of other languages) I can do this:
for (int i=0, j=0; i i_len, j j_len; ++i, ++j) {}
If I have this in python:
l = ['a', 'b', 'c']
I want to get the value and also an iterator:
for i,v in len(l), l:
, but I'll see
if I can find some time to look into it.
If you want to lead fixing Python's threading, consider
first delivering a not-so-grand but definite
improvement. Have you seen how the 'threading' module
in Python's standard library implements timeouts?
--
--Bryan
--
http://mail.python.org
Somehow on my linux box I scrood things up and I lost my python path info.
If I check sys.exec_prefix or sys.prefix it shows '/usr/local/', where
it should show '/usr/'.
Is there a config file somewhere that I can change to fix this, or do I
need to do a rebuild/reinstall? Hope not.
Thanks,
Bryan wrote:
Somehow on my linux box I scrood things up and I lost my python path info.
If I check sys.exec_prefix or sys.prefix it shows '/usr/local/', where
it should show '/usr/'.
Is there a config file somewhere that I can change to fix this, or do I
need to do a rebuild/reinstall
so taking advantage of other peoples experiences seems like a
good idea.
Bryan
--
http://mail.python.org/mailman/listinfo/python-list
if anybody has any good filters
worked up that will work in Gmail for reading python-list.
Cheers,
Bryan Rasmussen
On 5/22/07, Joel Hedlund [EMAIL PROTECTED] wrote:
Does anyone know why we get so much spam to this group? It's starting to
get embarrasing to read at work and that's just not how
coupled then
use Python and WMI to do it, using the same method.
http://tgolden.sc.sabren.com/python/wmi.html
Cheers,
Bryan Rasmussen
On 4/21/07, Martin v. Löwis [EMAIL PROTECTED] wrote:
well i tried reading that but that way i'll have to make the program
monitor each and every directory.
when
another is
writing to it? What stops it from being full duplex?
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
a Phyton Commandant movie.
Cheers,
Bryan Rasmussen
--
http://mail.python.org/mailman/listinfo/python-list
Here's the initial release of my personal open source project to
create a Python CD ripper in Linux.
Punit is a Audio CD ripper for Linux using cdparanoia, LAME and
CDDB.py (http://cddb-py.sourceforge.net/)
http://www.programmingmind.com/bryan/punit.html
--
http://mail.python.org/mailman
Hi,
I'm trying to make a Audio CD ripper using python.
is there a way (library, module, etc) to detect when a CD was inserted
or ejected?
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 13, 11:07 am, Larry Bates [EMAIL PROTECTED] wrote:
Mark Bryan Yu wrote:
Hi,
I'm trying to make a Audio CD ripper using python.
is there a way (library, module, etc) to detect when a CD was inserted
or ejected?
That is going to be OS dependent, so please share with us
what OS
threads can claim to get as close as
anything.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
variable so that you only get the file name. It is weird
because this had been working just fine until about 2 months ago then it
just started not parsing anything. If anyone can help please help:-)
Thanks,
Bryan Leber
Developer
Fischer International Corporation
www.fischerinternational.com
[EMAIL PROTECTED] wrote:
Any news on starship.python.net? It still seems to be down.
Yes. Unfortunately, there may be a hardware problem. Stefan, the admin
who owns the hosted machine, is working with the host company to
determine what's going on. I think that they are still in the
of
individual characters but not whole words.
Cheers,
Bryan Rasmussen
--
http://mail.python.org/mailman/listinfo/python-list
One of the system administrators had to reboot starship.python.net last
night, but it appears that the machine did not come back up properly.
starship.python.net is currently down while we investigate.
---Tom
--
http://mail.python.org/mailman/listinfo/python-list
the WTC and been killed. This would
explain why trolling duties have been recently taken up by
[EMAIL PROTECTED] on this list.
Cheers,
Bryan Rasmussen
On 1/31/07, soutjhyDin [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
http://portland.indymedia.org/en
See, if the python list mail server was written in Lisp Paul Graham
would already have been able to write up a spam filter to ban this
guy.
Seriously though, shouldn't Thermate be banned by now.
Cheers,
Bryan Rasmussen
On 26 Jan 2007 10:56:44 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote
ago.
Cheers,
Bryan Rasmussen
--
http://mail.python.org/mailman/listinfo/python-list
require any of these features, but extra browny points for any of
the following:
interactive interpreter
batteries included
can integrate with c
compiles to native code
can use a gui toolkit such as wx
doesn't take 60 hour weeks over years to master
thanks,
bryan
--
http://mail.python.org
be like.
http://www.mozilla.org/hacking/working-with-seamonkey.html
i know python is currently using buildbot... are there any differences or
simplifications in the processes using buildbot?
thanks,
bryan
--
http://mail.python.org/mailman/listinfo/python-list
at:
http://docs.python.org/lib/lib.html
In this case, see 14.1.4, 11.1, and 11.10.
Happy hacking.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
files and zip files
containing .pyc files.
bryan
--
http://mail.python.org/mailman/listinfo/python-list
Jean-Paul Calderone wrote:
On Tue, 31 Oct 2006 07:33:59 GMT, Bryan Olson [EMAIL PROTECTED]
wrote:
Snor wrote:
I'm attempting to create a lobby game server for a multiplayer game,
and have hit a problem early on with the server design. I am stuck
between using a threaded server, and using
really is a limiting factor.
Is the only solution to use a threaded server to let my clients make
their requests and receive a response in the fastest possible time?
Maybe. Probably not. It's all good -- multi-threading is your friend.
--
--Bryan
--
http://mail.python.org/mailman/listinfo
We are now ready to start re-enabling user accounts on starship.python.net.
If you had an account on the machine, then you should have received an
e-mail about it already. If you didn't, you should send e-mail to
webmaster. If you did, expect it to take at least 24 hours for your
account to be
global dictionary, because i lost all my global variables. the article
assumes you have one c thread per python thread state, but i want multiple
c threads per python thread state. Is there a c api function that will
associate a c thread without resetting the global dictionary?
thank you,
bryan
' % traceback.format_exc())
try:
opener.close()
except:
pass
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
, the memory gets allocated as needed,
and 150 threads is not be a problem.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
it to local variable. On the next turn the variable is
Consider using asyncore or the Twisted framework instead of threads.
But those won't play nice with urllib2.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
401 - 500 of 824 matches
Mail list logo