Is there a script that causes this problem, without using mod_python or
jepp? If so, please attach it to the sourceforge bug.
http://sourceforge.net/tracker/index.php?func=detail&aid=1163563&group_id=5470&atid=105470
pgpiWdvwwFmcD.pgp
Description: PGP signature
--
http://mail.python.org/mailman
You may want to use the 'numeric' or 'numarray' extensions for this.
The page on numarray is here:
http://www.stsci.edu/resources/software_hardware/numarray
numarray doesn't support "complex 16-bit integer" as a type, but you can
get a complex, floating-point valued array from your integer val
You may want to read
http://www.python.org/peps/pep-0754.html
Part of the text reads
The IEEE 754 standard defines a set of binary representations and
algorithmic rules for floating point arithmetic. Included in the
standard is a set of constants for representing special values,
in
probably something like this: (untested)
def make_ftplib_callback(f):
def callback(block): f.write(block)
return callback
img = cStringIO.StringIO()
retrbinary( "get ???", make_ftplib_callback(img))
Jeff
pgpaecaxnsqYB.pgp
Description: PGP signature
--
http://mail.pyt
I'm sorry that this is going to come out sounding like a flame, but it
seems to me that there today only a few technical problems remaining
with Python when built with mingw32.
If one of the people who has expressed such deep concern about this
"msvcr71.dll" problem would simply install the Free t
The answer has to do with a concept Tk calls "transient".
wm transient window ?master?
If master is specified, then the window manager is informed that
window is a transient window (e.g. pull-down menu) working on
behalf of master (where master is the path name for
On Tue, Apr 12, 2005 at 08:25:58PM +, Bengt Richter wrote:
> But credit where due. Someone has stepped up to a large chunk of the problem:
>
>http://jove.prohosting.com/iwave/ipython/pyMinGW.html
Yay. I'm glad somebody *is* doing this. Maybe all that is needed is to
"get the word out".
It's not clear to me what you mean by "the first line" (gzip does not
output a file composed of lines, its output is byte-oriented).
Printing tst.getvalue() is probably not a very useful thing to do, since
it won't do anything useful when the output is a terminal, and it will
add an extra newline
On Mon, Apr 18, 2005 at 01:40:43PM -0700, Xah Lee wrote:
> i have rewrote the Python's re module documentation.
> See it here for table of content page:
> http://xahlee.org/perl-python/python_re-write/lib/module-re.html
For those who have long ago consigned Mr. Lee to a killfile, it looks
like he'
It looks like the automatic build of the 'fpectl' module was broken
somewhere along the line, perhaps when the transition from Modules/Setup
to setup.py took place.
Once I made the change below and rebuilt, I got the fpectl module.
Furthermore, it appeared to "do something" on my Linux/x86 system:
The "type" field is related to the definition of different events in
X11. In Xlib, the event structure is a "C" union with the first
(common) field giving the type of the event so that the event-dependant
fields can be accessed through the proper union member.
Generally, you won't use this field
On Tue, Apr 19, 2005 at 02:05:11AM -0700, Sébastien Boisgérault wrote:
> Thanks for this answer.
>
> Did you forward this info to python-dev ?
I created a patch on the sf tracker. It's been responded to by several
developers. You can read what they said there.
http://python.org/sf/1185529
Jef
This variation works:
#
class Tee:
def __init__(self, *args):
self.files = args
def write(self, data):
for f in self.files:
result = f.write(data)
return result
def writelines(s
In that case, it looks like you won't be able to get what you want
without modifying CPython. PRINT_ITEM calls PyFile_SoftSpace,
PyFile_WriteString, and PyFile_WriteObject, which all use
PyFile_Check(). It might be as simple as changing these to
PyFile_CheckExact() calls in PyFile_WriteString / P
This issue was discussed in another recent python-list thread, called
"Writing to stdout and a log file".
My second post includes a patch to Python's "fileobject.c" that made the
code that started that thread work, but for reasons I mentioned in that
post I didn't want to push for inclusion of my
It looks like php's implode(sep, seq) is like sep.join(seq) in Python.
But this is a lousy way to write database queries. You should use the
Python's DB-API interface's execute(statement, parameters) instead.
Assuming that paramstyle is 'qmark', I think it ends up looking
something like this:
On Tue, Apr 26, 2005 at 09:59:29PM -0500, Mike Meyer wrote:
> Jeff Epler <[EMAIL PROTECTED]> writes:
>
> > items = query_param.items()
> > keys = [item[0] for item in items]
> > values = [item[1] for item in items]
>
> Is there some reason not to
I don't think that Tk's menus ever use more than one column. They
certainly don't on Unix.
Jeff
pgpsVnvjgm3Qy.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
One poster suggests 'ldd' for executables. You can also use this on shared
libraries:
$ ldd /usr/lib/python2.3/lib-dynload/_tkinter.so
libtix8.1.8.4.so => /usr/lib/libtix8.1.8.4.so (0x009b6000)
libtk8.4.so => /usr/lib/libtk8.4.so (0x00111000)
libtcl8.4.so => /usr/lib/libtc
You could write something like
class ThreadSpecificFile:
def set_stdout(f):
self.files[thread_id] = f
def write(data):
self.files[thread_id].write(data)
sys.stdout = ThreadSpecificFile()
where you'll have to fill out a few more things like thread_id,
As your 'for' loop shows, the number of items in the slice [2:5] is only
3, not 4.
Maybe you want the slice [2:6] instead.
>>> x = "xx\xb6/\0\0"
>>> struct.unpack('i', x[2:6])
(12214,)
Jeff
pgprzSG2OzoK4.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
Are there only a few, unchanging templates? If so, (dynamiclly) create
a function for each template. This will be nearly the fastest you can
go in Python, excluding the time to create and byte-compile the nesting
function.
# This code is in the public domain
def make_nesting_expression(l, s):
On Wed, May 04, 2005 at 09:14:18AM -0700, Sébastien Boisgérault wrote:
>
> Yup ?!? Weird ... especially as:
>
> >>> id(c.f) == id(C.__dict__['f'].__get__(c,C))
> True
Here, c.f is discarded by the time the right-hand-side of == is
executed. So the object whose id() is being calculated on the
ri
Your question is answered in the tutorial:
http://docs.python.org/tut/node6.html#SECTION00674
4.7.4 Unpacking Argument Lists
The reverse situation occurs when the arguments are already in a list or
tuple but need to be unpacked for a function call requiring separate
positional arg
To add to what others have said:
* Typos and lack of spell-checking, such as "occurances" vs "occurrences"
* Poor grammar, such as "Other characters that has special meaning
includes:"
* You dropped version-related notes like "New in version 2.4"
* You seem to love the use of s, while docs.py
Tk, the library that Tkinter wraps, does not offer a way to "minimize to
the taskbar".
Jeff
pgp3ATXnxg0dO.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
While I've never used it, there *is* a Tix module in Python which
appears to wrap the widgets provided by Tix. In Fedora Core 2, Python
doesn't seem to be configured to use Tix OOTB but a one-liner (that
should be harmless elsewhere) does make it work.
These classes are defined in the Tix module:
At the interactive prompt, a result is printed when both these things
are true:
* The entered code is an expression, not any other kind of statement
* The result of the expression is not 'None'
If an expression occurs, information about it will be printed instead.
So the interpreter won't
If you want to do decimal arithmetic, use the decimal module which is
new in Python 2.4.
Python 2.4 (#1, Jan 22 2005, 20:45:18)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from decimal import Decimal as D
>>> D(
Most versions of gcc should be just fine to compile Python. Python is
targeted at ANSI/ISO C compilers, but does not yet use any C99 features.
I don't think there was ever such a thing as "gcc 3.5";
http://gcc.gnu.org/ lists 4.0 as the "current release series" and 3.4.3
as the "previous release s
One way to get a handle on some Tcl variables from Python is to create
Tkinter.Variable instances with the names of the existing Tcl variables
(normally, the variable names are chosen arbitrarily). Once you've done
this, you can do things like add variable traces (the trace_variable
method) on the
this isn't about the "sign bit", it's about assumed encodings for byte
strings..
In iso_8859_1 and unicode, the character with value 0xb0 is DEGREE SIGN.
In other character sets, that may not be true---For instance, in the
Windows "code page 437", it is u'\u2591' aka LIGHT SHADE (a half-tone patte
In Python, "chr" gives a 1-byte string from a small integer, "ord" does
the reverse. Strings are concatenated with "+" and substrings are taken
with the slice operator, s[pos1:pos2].
I'm not a visual basic expert, but it looks like these are the
operations the code below performs.
Jeff
pgpWpqb
I wrote the following code:
import Tkinter
t = Tkinter.Label()
t.configure(
text=u"As the function approaches \N{INFINITY}, \N{HORIZONTAL
ELLIPSIS}")
t.pack()
t.mainloop()
It worked for me on Windows NT 4.0 with Python 2.4, and on RedHat 9 with
a self-compiled Python 2.
On Thu, May 19, 2005 at 12:56:12PM -0500, phil wrote:
> Why is it so slow? (RH Linux, 2.4.20, 1.6Ghz AMD)
> 3/4 second slower to display widget w/unicode,
> even if I encode u'\u221e'
u'\u221e' vs u'\N{INFINITY}' should make no noticible run-time
difference--they both specify exactly the same stri
I think you do something like this (untested):
import codecs
def transcode(infile, outfile, incoding="shift-jis",
outcoding="utf-8"):
f = codecs.open(infile, "rb", incoding)
g = codecs.open(outfile, "wb", outcoding)
g.write(f.read())
# If the file is so large that it can't be
On Fri, May 20, 2005 at 12:16:15AM -0700, [EMAIL PROTECTED] wrote:
> Hello, I think the answer is basically correct but shift-jis is not a
> standard part of Python 2.3.
Ah, I was fooled --- I tested on Python 2.3, but my packager must have
included the codecs you went on to mention.
Jeff
pgp4q
This may be relevant to the problems you're seeing:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=774665&group_id=5470
The short story, as the tracker item paints it, is that setting
LC_NUMERIC to anything other than 'C' can give results like the ones you
describe---Python itse
You might want
os.spawnv(os.P_WAIT, "a.exe", ["a.exe"])
os.system("a.exe")
Jeff
pgpp3Fxdo0nYA.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
I wanted to have a Python program make my browser do a POST. I am using
Firefox on Linux.
Here's what I did:
* Prepare a HTML page on the local disk that looks like this:
http://www.example.com/cgi-bin/example.cgi";>
Submitting form.
First off, I just have to correct your terminology. "exec" is a
statement, and doesn't require parentheses, so talking about "exec()"
invites confusion.
I'll answer your question in terms of eval(), which takes a string
representing a Python expression, interprets it, and returns the result.
In
This isn't an option in the stock Tk listbox or any of the alternatives
I know of offhand (bwidget ListBox, TixTList). The TkTable widget,
which can also display multiple columns, can select different
justifications, either for the whole table, or for single cells.
I've never used TkTable with Pyt
You're not going to find a single portable "unix" way of doing this.
The format of /etc/fstab and /etc/mtab are pretty portable, but they
only list mountable/mounted partitions, not all partitions.
In addition to the linux possibilities mentioned in another reply, there
is also /proc/partitions.
I suspect that getting the threads to die will be tricky, and as written
the thread holds a reference to the 'primegen' instance (this part can
be cured, but it still doesn't ever make the thread exit).
Instead of figuring out how to get this to clean itself up, why not make
sure you only make one
On Sat, Jun 04, 2005 at 10:43:39PM +, John J. Lee wrote:
> 1. In derived classes, inheritance doesn't work right:
Did you expect it to print 'moo'? I'd have been surprised, and expected
the behavior you got.
> 2. At least in 2.3 (and 2.4, AFAIK), you can't pickle classes that do
>this.
300KB/s sounds dreadfully low.
I simply ran "python /usr/lib/python2.3/SimpleHTTPServer.py &", then
"wget -O /dev/null http://0.0.0.0:8000/70megfile";. On the best of 4
runs (when the file was cached) wget measured 225.20MB/s.
The hardware is a Pentium-M laptop with 768MB RAM runnng at 1.5GHz.
On Sun, Jun 05, 2005 at 02:38:16PM -0500, Mike Meyer wrote:
[...]
> The first, and most obvious, thing that GUI builders do is force the
> developer to specify an exact position - if not size - for the
> graphical elements of the UI.
[...]
Certainly some---or even most---builders work like this.
I tried to recreate the problem based on what you described in your
message. I was unable to recreate the problem.
I wrote the following file "sjh.c":
#include
PyObject *f(PyObject *self, PyObject *args) {
PyObject *ob = NULL;
if(!PyArg_ParseTuple(args, "O", &ob)) return NULL;
Py_I
The machines with the 100mbps ethernet link are slightly
different---Pentium 4, 2.8GHz, Python 2.2, RedHat 9.
File size: 87490278
Best of 4 runs: 7.50 MB/s reported by "wget".
There was other network activity and system load at the time.
Jeff
pgpNVPeW3ghJL.pgp
Description: PGP signature
--
h
You may want to use a standalone program to do this. "xwit" has the
ability to iconify a window which can be selected in a variety of ways.
http://hpux.connect.org.uk/hppd/hpux/X11/Misc/xwit-1.0/man.html
There's a direct Python interface to the X protocol in python-xlib. You
could re-write t
For me, an 'is' test works to find out what widget the event is taking
place on.
#
import Tkinter
def display_event(e):
print "event received", e.widget, e.widget is t
t = Tkinter.Tk()
t.bind("", display_event)
w = Tkint
On Sun, Jun 12, 2005 at 04:55:38PM -0700, Xah Lee wrote:
> if i have
> mytext.replace(a,b)
> how to find out many many occurances has been replaced?
The count isn't returned by the replace method. You'll have to count
and then replace.
def count_replace(a, b, c):
count = a.count(b)
retur
Using /proc/partitions is probably preferable because any user can read
it, not just people who can be trusted with read access to drives, and
because the format of /proc/partitions is probably simpler and more
stable over time.
That said, what you do is
import commands
fdisk_output = comm
[sent to python-list and poster]
Did you follow the direction that Python.h be included before any system
header?
This is mentioned at least in
http://docs.python.org/ext/simpleExample.html
It's a crummy thing for Python to insist on, but if you can re-organize
your headers to do this it sho
When using os.system(), files that are open in the parent are available
in the child, as you can see here in Linux' listing of the files open by
the child program:
[EMAIL PROTECTED] jepler]$ python -c 'f = open("/tmp/test", "w"); print
f.fileno(); import os; os.system("ls -l /proc/self/fd")'
3
to
Based on the location where the user clicked, you can find the
associated tags. Then you must loop through them to find the one that
gives the "href" value.
Jeff
:r /tmp/link.py
import Tkinter
app = Tkinter.Tk()
text = Tkinter.Text(app)
text.pack()
def click(event):
#this doesn't work
You may find the third-party modules "ClientForm" and "ClientCookie" to
be useful.
Using ClientForm, the following code uploads a file to a particular web form:
forms = ClientForm.ParseResponse(urllib2.urlopen(url))
f = forms[0]
f.add_file(open(local, "rb"), filename=remote, name="file
101 - 157 of 157 matches
Mail list logo