I am trying to upgrade my Python installation. After downloading
sources and building Python 2.3.4, I am unable to use the command
history editing feature in the interactive interpreter (where the
up-arrow would previously give you the last command line to edit,
it now just prints "^[[A".) Thi
"Davor" <[EMAIL PROTECTED]> wrote
> I do not hate OO - I just do not need it for the project size I'm
> dealing with - and the project will eventually become open-source and
> have additional developers...
If you think your project is valuable enough to eventually be "Open
Source",
you can b
advice on how to statically
link in this library so the Python build is happy?
Thanks,
-ej
- Original Message -
From: "Peter Maas" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
Sent: Wednesday, January 26, 2005 3:22 AM
Subject: Re: building Python: up arrow b
I don't know what metakit or the file you are looking for is, but a
simple search on google turns up the following article where a guy built it
for Python 2.2 and was willing to mail that to people. Try contacting him:
http://www.equi4.com/pipermail/metakit/2002-March/000560.html
HTH,
-ej
"
"Erik Johnson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> So I downloaded & built libreadline version 5.0. I have libreadline.a
> and shlib/libreadline.so.5.0 files. Having done Python & other scripting
> languages for a while, I have sort
"Peter Otten" <[EMAIL PROTECTED]> wrote...
> Have you ensured (with yast) that readline-devel is actually installed?
I had not previously, but (not surprisingly) version 4.3 is installed. :)
Good idea - I thought maybe I would be able to do an online update (YOU)
to it, but it is taking fore
- Original Message -
From: "Peter Otten" <[EMAIL PROTECTED]>
> According to http://cnswww.cns.cwru.edu/php/chet/readline/CHANGES the
> features you missed were introduced in readline 4.0 and 4.2, so version
4.3
> should be sufficient. So let me ask you again, you have both the readline
> a
I quickly browsed through section 9 of the Tutorial, tried some simple
Google searches: I'm not readily seeing how to test class type. Given some
object (might be an instance of a user-created class, might be None, might
be list, might be some other "standard" type object instance), how do yo
"Erick" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ah, you're running into the "old-style classes vs. new style classes".
> Try subclassing from "object".
>
> For example:
>
> >>> class A(object):
That works! :) I guess I am fortunate to be running 2.2 - looks kinda ugly
prior
Is it not possible to wrap your loop below within a loop doing
file.read([size]) (or readline() or readlines([size]),
reading the file a chunk at a time then running your re on a per-chunk
basis?
-ej
"Erick" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ack, typo. What I mea
> Steven Bethard <[EMAIL PROTECTED]> wrote:
> > py> class A:
> > ... pass
> > ...
> > py> class B:
> > ... pass
> > ...
> > py> a = A()
> > py> a.__class__ == A
> > True
> > py> a.__class__ == B
> > False
"Just" <[EMAIL PROTECTED]> wrote
> Uh, isinstance(a, A) works for both new-style
I want to draw some simple (dynamic) graphs and get these saved as a
JPEG file to reference in a web link. I am aware of PIL (Python Image
Library), but unfortunatley my system does not have it built. After looking
at the README for it and seeing it depends on two separate packages to
suppor
I am wanting to generate dynamic graphs for our website and would rather
not invest the time in developing the code to draw these starting from
graphics primitives. I am looking for something that is... "fairly robust"
but our needs are relatively modest: X-Y scatter plots w/ data point
symbol
There are a lot of things about PHP I was not too keen on and hence why
my company is primarily doing Python these days, but one thing I was quite
impressed with was the ease with which it provided session functionality...
And then in another CGI script do basically the same thing and g
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If I try to use y or z inappropriately when they are None, the program
> will stop. An alternative is to return an error flag in addition to y
> and z from function foo and check the value of the error flag in the
> calling program. Thi
Thank you both for your input. I will check them out. :)
-ej
--
http://mail.python.org/mailman/listinfo/python-list
I am trying to work with a program that is trying make an HTTP POST of text
data without any named form parameter. (I don't know - is that a normal
thing to do?) I need to write a CGI program that accepts and processes that
data. I'm not seeing how to get at data that's not a named form parameter.
I am looking for some input on GUI libraries. I want to build a
Python-driven GUI, but don't really understand the playing field very well.
I have generally heard good things about wxPython. I happen to already own
John Grayson's book about Tkinter programming, so that is rather handy if I
dec
> do yo have any idea of what is causing this problem?
> is it possible to do self.SortiesAnimeTitreLabel = [] to reset the var?
(it
> seems to work outside of the sub, but I believe that the var I'm erasing
is
> not the one I want but a local copy.
Yeah. I'm no Python guru, but I have a pre
"Sybren Stuvel" wrote:
> If the HTML document should really be attached, give it a
> Content-Disposition: Attachment
> header. Check out the accompanying headers as well, by simply emailing
> yourself an attached HTML file and examining the email source.
html = """\
...
"""
attachment = MI
"tobiah" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> SpreadTooThin wrote:
> > f = open('myfile.bin', 'rb')
> >
> > How do I know if there was an error opening my file?
> >
> try:
> open('noexist')
> except:
> print "Didn't open"
That's a way to trap any exc
> class MyNotebook(wx.Notebook):
> def __init__(self, parent):
> wx.Notebook.__init__(self, parent)
> So my question in general is, is it a good idea to default to an OOP
> design like my second example when you aren't even sure you will need
> it? I know it won't hurt, and is proba
There are arguments of preference to be made on both sides. I think the
question largely comes down to what is "workable" and "maintainable". To
answer the original question, I think it is not necessarily a bad idea to
have one class per file. But if your classes are small, or certain classes
a
"eldorado" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I am trying to get python to give me the PID of a process (in this case
> HUB). I have it working, except for the fact that the output includes
> \012 (newline). Is there a way to ask python not to give me a newli
"Stef Mientki" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a way to run the initialization code from a script(file) once,
> to achieve the same effect ?
Certainly. This is what Python modules are all about. You should probably
read up on those a bit here: http://docs.p
"eldorado" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >>> g = os.popen("ps -ef | grep HUB | grep -v grep | awk '{ print $2 }'")
> >>> h = g.readlines()
> >>> g.close()
> >>> h
> ['87334\012']
> >>> h = h[:-1]
> >>> h
> []
Oh, sorry... h is a list here because you are using rea
"Gal Diskin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
> On Dec 13, 3:47 pm, "Gal Diskin" <[EMAIL PROTECTED]> wrote:
> > Hi,
> > I am writing a code that needs to iterate over 3 lists at the same
> > time, i.e something like this:
> >
> > for x1 in l1:
> > for x2 in l2:
>
> but it's still not quit handy
>
> # initialization file (init1.py)
> import time;
> xx = 44
>
> # main file was
> print xx
> x=time.time()
>
> # main file should become
> print init1.xx
> x=init1.time.time()
>
> so even for the "standard" functions like "time" I've to include the
> preceeding mo
"Ben Finney" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Sebastian 'lunar' Wiesner" <[EMAIL PROTECTED]> writes:
>
> > Just a tip for you: In python you never use tabs for indentation.
>
> For some value of "you".
>
> > The python style guide [1] recommends four spaces per indent
"Ben" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This seems to work without any errors. But bizzarely I find that
> whatever my record number, the instance of "my_class" is appended to
> every list. So in this case
>
> self.mop_list[0].my_list.append(my_class(Some data for th
"Imbaud Pierre" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Now my points are:
> - how do I spot the version of a given library? There is a __version__
>attribute of the module, is that it?
Yes, the module maintainer should be incrementing this version for each new
release a
"Ben" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> class record:
> my_list =[]
> mops=[]
>
> def __init__(self,mops):
> self.mops=mops
Similar to the example I gave, the lists my_list and mops shown above are
executed just once: when your
"Ben" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Yes- I can see that my_list and mops, being outside def __init__()
> only get created once, hence the confusion.
>
> Surely def __init__() gets called each time an instance is created
> however? But the snag is that if they have
Aside from the obvious security issues such a program would represent
(and your name and signature are curious in that respect as well), you are
basically asking for functionality (i.e., a key logger) I believe to be
outside what is offered by Python and/or the API of most operating systems.
P
I ran into a problem I didn't understand at first. I got part of it figured
out. Let me first demonstrate the original problem:
> cat Super.py
class Super(object):
def __init__(self):
self._class = 'Super'
def hello(self):
print "%s says 'Hello'" % self._class
> cat Sub.py
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> [EMAIL PROTECTED] wrote:
>
> > After much head scrating and experimenting with dis.dis() I have found
> > that chaining comparisons (with is or ==) a == b == c in Python is
> > never a good idea. It is interpreted as
> >
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> - If I increase number of elements I am searching for, then I have
> more elif...elif. Is there a cleaner solution?
I'm not sure exactly what your lines look like, but this script implies that
every line that matches 'i_a/i_b/ROM' is
Sorry, I forgot to paste the modified version of my code in the post:. I
think this is the same behaviour:
for line in lines:
if "placed" in line:
if "i_a/i_b/ROM/" in line:
pos = (line.split()[4]).split("_")[1]
found = False
for (tag, (start, end))
"Dave Opstad" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is the lack of a struct.error when the byte-order mark is at the start
> of the format intentional? This seems like a bug to me, but maybe
> there's a subtlety here I'm not seeing.
I am by no means any sort of expert
> You can use ReportLab Graphics to generate the
> graphs as .JPG files and display them in a
> browser window with simple HTML.
That is one option. As best as I recall, CherryPy is a simple but fully
functional web framework. If your primary focus is programmatically
generating graphs from d
Sort of two questions here:
The first is about the internal view: are there Python introspection
functions that can be called such that a running script can keep tabs on how
much memory is being used?
And the second is about using either os or system calls on Windows such
that a Python
"Virgil Dupras" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > class Node:
> > > ... pass
> > > ...
> > node = Node()
> > nextnode = Node()
> > backup_node = node
> > node = node.next = nextnode
> > node.next is node
> > > True
> > hasattr(ba
Actually, after studying this a bit more:
http://docs.python.org/ref/assignment.html
I guess that makes sense. Sorry if I muddied the water for anyone else in my
boat:
n1 = n1.next = n2
The first thing that happens is the expression list is evaluated which is
the thing on the far right, n2. That
"Michael Bentley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> On Mar 22, 2007, at 10:34 AM, John Salerno wrote:
>
> > Hi guys. It's been a while since I've used Python, so I got a little
> > rusty, but I really want to start using it again, just out of habit
> > and
> > for fun
"James Stroud" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hawk this list and try to pick off easy answers before anyone else.
> That's what I do. The pressure is to be right, because if you're not,
> you hear about it in a hurry.
That is actually an excellent suggestion.
"spohle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi,
>
> i created an instance of a my own class which has methods and all. now
> i get an outside function called, which is unfortunatly not aware of
> the instace at all (i don't control how this outside function is
> called).
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> OK...
> I've been told that Both Fortran and Python are easy to read, and are
> quite useful in creating scientific apps for the number crunching, but
> then Python is a tad slower than Fortran because of its a high level
> language nat
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What do you mean by that? They can both load a pickled object, yes. But
they
> can't share it as a at-runtime object, where changes in one script are
> immediately are known to the other.
>
> To do such a thing, look
I am just starting to explore doing some scientific type data analysis
using Python, and am a little confused by the different incarnations of
modules (e.g., try Google("Python numeric").
There is SciPy, NumPy, NumArray, Numeric... I know some of these are
related and some are separate,
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Sheesh. Do Java developers go around telling everybody that Java is an
> interpreted language? I don't think so.
>
> What do you think the "c" in ".pyc" files stands for? "Cheese"?
On the contrary... Sun is very care
"Robert Kern" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> http://www.scipy.org/History_of_SciPy
>
> numpy is the current array package and supercedes Numeric and numarray.
scipy
> provides a bunch of computational routines (linear algebra, optimization,
> statistics, signal proc
"Achim Domma" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> is SimpleXMLRPCServer multithreaded or how does it handle multiple
> clients? I want to implement a simple server which will be queried by
> multiple processes for work to be done. The server will simply hold a
> q
The documentation for these two modules says that they were disabled in
Python 2.3 due to security holes not easily fixable. I have not worked with
them, but I can still import them under Python 2.4, so I'm not clear on
whether the security problems were fixed in Python itself, or whether the
I mean, of course, rexec (not recec) and Bastion
--
http://mail.python.org/mailman/listinfo/python-list
"7stud" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jack wrote:
> > I wonder what everybody uses for Python editor/IDE on Linux?
> > I use PyScripter on Windows, which is very good. Not sure if
> > there's something handy like that on Linux. I need to do some
> > development work
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How does one troubleshoot errors that happen three layers deep
> in the subprocess module?
I think the problem is more likely in how your py2exe is getting
bundled, rather than any real problem with the subprocess
"Daniel Nogradi" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > I have a function that returns a array{uint32}, is there any way to
output
> > that to screen in a more user friendly format? At the moment when I
print it
> > by itself it appears as [65541L], which isn't much used t
Maybe I just don't know the right special function, but what I am wanting to
do is write something akin to a __getattr__ function so that when you try to
call an object method that doesn't exist, it get's intercepted *along with
it's argument*, in the same manner as __getattr__ intercepts attribut
follow the error above though. Can you explain
exactly what happens with just the evaluation of f?
Thanks,
-ej
"Nick Smallbone" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Erik Johnson wrote:
> > Maybe I just don't know the right special functio
This has apparently been a problematic thing for a while now, as the
following article indicates. I first ran into the error message about
not being able to remap C:\cygwin\bin\tk84.dll to be the same address
as it's parent.
Using that information, Google helped me find this article:
http://blog.
THE GOAL: I need to send an email with a simple ASCII text body and an
attached HTML file.
I have scripts that send basic emails via the smtplib module that don't
have any attachements and that seems to work fine. I first looked at the
mimetools modules but it says it is depreceated sinc
"David Bear" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> my $klen = length($key);
> my $blen = 64;
> my $ipad = chr(0x36)x$blen;
> my $opad = chr(0x5c)x$blen;
>
> I don't know if I ever seen any way in python of created a fixed size
> string. Can anyone show me how to implem
62 matches
Mail list logo