> > > Can some one *please* splain me why str(obj) works but not print obj,
> >
> > May have something to do with escape chars... I tried with:
> >def __str__(self):
> > return repr(self)
Yes, that appears to be correct. Experiments indicated that it's an
issue with escaping.
> > What
Thanks very much for the reply. I'll give that a shot and post back
with the result.
--
matthew
Bruno Desthuilliers wrote:
> [EMAIL PROTECTED] a écrit :
> > I'm working with the following code. I included some tests to make it
> > easy to see--if you run the code--what troubles I'm having.
> >
>
Just thought I'd mention it. As stated in some posts I put on the list
in the last few days, I'm working on a FastCGI server for python. Of
course its not as fast as lighttpd, but I think it still has many
applications. I've currently got a *very* simple prototype, but I
expect the finished module
I'm working with the following code. I included some tests to make it
easy to see--if you run the code--what troubles I'm having.
Can some one *please* splain me why str(obj) works but not print obj,
and why obj.__int__() works, but not int(obj). I just don't get it. :(
BTW: The reason I'm going
Greetings, I'm now merrily on my way developing a FastCGI Server in
python.
Thanks to help of others on this list I've got a proof of concept up
and
running.
Herein lies my question: My goal is to make this module as flexible as
possible,
so that it can receive requests from SimpleHTTP, or Cherrpy
> Are those not the four octets you wanted to send?
Yes. My understanding of struct was broken. Sukanta corrected it for
me.
thank you
--
matthew
--
http://mail.python.org/mailman/listinfo/python-list
> It will send the 4 bytes, binary, and not the string as you assumed. If
> you want to satisfy yourself, run tcpdump (or ethereal) to observe what
> is being sent.
Thanks very much for the prompt reply. I'll take your word for it. I
actually tried ethereal to verify my hypothesis before posting,
> Python strings are binary data and can contain
> - in oppostion to e.g. C-strings - null-bytes.
>
> So it is perfectly alright to send "only" strings over a socket.
Agreed. I wasn't trying to imply it was 'wrong' just that the receiving
application wouldn't interpret strings correctly.
--
ht
Greetings, since there was no reponse to my previous post about an
existing FastCGI server in python, I've taken to writing my own. (which
of course I'll share--*if* there's something to share ;)
My problem now, is that I need to send certain binary data over a
socket. That is, I want to make some
Does any one know of a fcgi SEVER implementation for python?
I've seen lots of great stuff for the client/application side, but not
a server. By server, I mean the program that accepts requests from the
browser and passes them to the web app over fcgi. Usaually this is done
by Apace or Lightttpd,
Thanks for a detailed reply.
> Firewall and filter are two things totally separated!
Sorry for being to general. I want to create a filter like
dansgaurdian. I was thinking of it also as a firewall because is
restricts traffic on a port based on content, but you're correct, they
aren't the same t
I thought speed might be an issue. At this point I'm not interested in
much more than toying around, so *if* there's a way to do it, I'd like
to explore the options.
--
matthew
Diez B. Roggisch wrote:
> > 2) Is this even reasonable in python and how might I get started? (e.g.
> > win32 COM?)
>
>
Greetings,
I'm interested in a simple content-based internet firewall/filter,
similar to dansguardian (http://dansguardian.org/), but written in
python, and for windows. I assumed such a project would already exist,
but my searches on freshmeat, and google turned up empty. I would be
interested in
Graham Fawcett wrote:
> You might want to look into PCAP (a.k.a libpcap), which is the
> network-sniffing libary used by Ethereal, among other programs. Much
> more portable than COM, and there are Python wrappers for it, IIRC.
>
> You could also implement an HTTP proxy server in Python; Google s
Greetings, I have a question I hope some one with more back ground can
give me a little help with.
I want to write a simple internet monitoring script for windows that
watches out bound http traffic and keeps a list of all the site visited.
I am thinking that I might be able to use pywin32 and
Jarek Zgoda wrote:
> Matthew Thorley napisał(a):
>
>> The output I get shows xmla as nicely formatted text, with elements on
>> different lines and everything all tabbed and pretty. Inverly, xmlb is
>> one long string on one line.
>>
>> Is that because
Greetings, perhaps someone can explain this. I get to different styles
of formatting for xmla and xmlb when I do the following:
from elementtree import ElementTree as et
xmla = et.ElementTree('some_file.xml')
xmlb = et.Element('parent')
et.SubElement(xmlb, 'child1')
et.SubElement(xmlb, 'child2')
thanks thats perfect!
Grant Edwards wrote:
> On 2005-05-23, Matthew Thorley <[EMAIL PROTECTED]> wrote:
>
>
>>I wrote a simple python program that scrapes a web page every
>>30 secons and dumps the result in a data base. I want to use
>>my linux distros build i
hangs, waiting for my program to exit 1 or 0. My program
never does exits because its looping every 30 seconds.
Is there a way I can pass an exit value with out actualy exiting? or is
there are better way to do this?
Thanks
--
Matthew Thorley
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the reply I am understanding it better now. Please forgive my
ignorance. So the xsi is just an arbitrary name space prefix, I get that
now. And it make sense to me why it gets converted to an xmlns.
What I really need to know is why it is not inherited by the child
elements? From what I
Why does ElementTree.parse convert my xsi to an xmlns?
When I do this
from elementtree import ElementTree
# Sample xml
mgac ="""
http://www.chpc.utah.edu/~baites/mgacML";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.chpc.utah.edu/~baites/mgacML
Thanks Andrew & Oren, that should do the trick.
--
http://mail.python.org/mailman/listinfo/python-list
Does any one know if there a way to force the ElementTree module to
print out name spaces 'correctly' rather than as ns0, ns1 etc? Or is
there at least away to force it to include the correct name spaces in
the output of tostring?
I didn't see anything in the api docs or the list archive, but befo
So is elementtree a module of modules? I didn't know you could do that.
I just assumed that from elementtree import ElementTree imported a class
from the module elementtree.
It works now. Thanks guys.
Fredrik Lundh wrote:
> Matthew Thorley wrote:
>
>
>>I am trying to inhe
I am trying to inherit from ElementTree so I can add some methods. This
is the code I am trying to make work, and the following is the error I
am getting.
from elementtree import ElementTree
class AcidTree(ElementTree):
def write_string(self):
File "/home/hope/var/proj/acid/serve
I've been using tarfile like this
import tarfile
tar = tarfile.open('path_to_tar_archive', 'r:gz')
But I need to use it like this:
archive = open('path_to_tar_archive', 'r')
tar = tarfile.open(archive.readlines())
or something similar. In essence I need to use tarfile to manipulate an
already
Peter Otten wrote:
> Matthew Thorley wrote:
>
>
>>Esben Pedersen wrote:
>>
>>>Matthew Thorley wrote:
>>>
>>>
>>>>I'm writing a web app whereby a user uploads a tar acrhive which is then
>>>>opened and pr
Esben Pedersen wrote:
> Matthew Thorley wrote:
>
>> I'm writing a web app whereby a user uploads a tar acrhive which is then
>> opened and processed. My web form reads the file like this:
>>
>> while 1:
>> data = value.file.read(1024 * 8) # Read b
John Abel wrote:
> Matthew Thorley wrote:
>
>> I'm writing a web app whereby a user uploads a tar acrhive which is then
>> opened and processed. My web form reads the file like this:
>>
>> while 1:
>>data = value.file.read(1024 * 8) # Read blocks
I'm writing a web app whereby a user uploads a tar acrhive which is then
opened and processed. My web form reads the file like this:
while 1:
data = value.file.read(1024 * 8) # Read blocks of 8KB at a time
if not data: break
which leaves me with data as a string obj. The problem that I ha
lugal wrote:
> Is anyone aware if there's a Utah-based Python User Group? If not, does
> any else from Utah have any interest in forming a Utah-based Python
> User Group?
>
I'm in Utah, I don't know of any groups but I might be interested.
-Matthew
--
http://mail.python.org/mailman/listinfo/pyth
Steve Holden wrote:
> Indeed, they will probably just need to pass "self" as an argument to
> the child object's creator (it will become an argument to the __init__()
> method). This will be pretty cheap, since the additional attribute will
> be bound to an already-existing value.
>
>> On the oth
Steve Holden wrote:
> I think that since each Datapoint appears to be unique, the simplest
> thing to do is to include a reference to the parent object as an
> attribute of the datapoint. Presumably when you create the Datapoint you
> already know which Device and Mib it's going to be stored in, s
Scott David Daniels wrote:
> Matthew Thorley wrote:
>
>> This may be a very rudimentary question, but here goes:
>
> From your questions, I believe you are not thinking of values as
> being distinct from the names and data structures that refer to them.
>
> What
Steve Holden wrote:
while not impossible (using Python's excellent
> introspection facilities) is way beyond what most people would consider
> practical. Obviously the garbage collector has to solve this problem,
> but you *really* don't want to be doing this stuff in Python unless you
> absolutely
Axel Straschil wrote:
>
> For unique values, I did something like that couple of weeks ago, the
> thing you would need is the getKey thing, it's fast, but needs much
> memory for big structures becouse I use two dicts.
Thanks for the tip, I may give that a try. I'll be interested to see
what kind
Can you please elaborate on this?
-Matthew
Diez B. Roggisch wrote:
>>keeping a additional mapping between values and keys.
>
--
http://mail.python.org/mailman/listinfo/python-list
This may be a very rudimentary question, but here goes:
If I have a simple dictionary, where the value is a class or function,
is there an interface through which it can discover what its key is?
Similar to index() for list.
For a list, assuming I new what the parent list was I could do something
Diez B. Roggisch wrote:
I tried it but I got a syntax error. The interpreter didn't like the
equals sign in the lambda. I am using python 2.3.4. Is there another way
of writing that?
Strange. This script works and shows the desired behaviour - python is also
2.3.4:
def foo(x):
print x
fs = [la
Diez B. Roggisch wrote:
Hi,
button = Button(self.songWin, text=verse, command=(lambda num=verseNum:
self.showVerse(num)) )
should do the trick. The reason is basically that your version kept a
reference to verseNum - and when executed, the value verseNum points to is
the lasts one stored.
Rebinding
Greetings, Maybe someone out there can lend me an eye? I've been
stumped, banging my head against the wall trying to figure out why my
script doesn't work. I've tried every thing I could think of, even
unecessarily complicated mumbo-jumbo. Let me show you a snippet and then
I'll explain what's
Erik Max Francis wrote:
Matthew Thorley wrote:
Greetings, I just downloaded the python2.4 source from python.org and
built it the usual way, i.e. ./configure && make. What I don't
understand is that the resulting binary, when run, prints this line
Python 2.3.4 (#1, Nov 15 2004, 10:
Greetings, I just downloaded the python2.4 source from python.org and
built it the usual way, i.e. ./configure && make. What I don't
understand is that the resulting binary, when run, prints this line
Python 2.3.4 (#1, Nov 15 2004, 10:29:48) at the top of its banner.
Further more, the poplib mo
43 matches
Mail list logo