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
30 matches
Mail list logo