Hello!
I have simple gui gtk app. It has worker thread that populates list
with strings and gtk window with main loop which pops strings
from this list and shows them in TreeView.
Thread runs get_data_from_pcap to populate list with strings.
Gtk app calls update_store() with gobject.timeout_add
Hello!
I'm making gui gtk application. I'm using pypcap
(http://code.google.com/p/pypcap/) to sniff some network packets.
To avoid gui freezing I put pcap call to another thread.
Pypcap call looks like:
pc = pcap.pcap()
pc.setfilter('tcp')
for ts, pkt in pc:
spkt = str(pkt)
...
On Wed, Dec 30, 2009 at 16:18, aspineux aspin...@gmail.com wrote:
On Dec 30, 1:34 pm, Dmitry Teslenko dtesle...@gmail.com wrote:
Hello!
I'm making gui gtk application. I'm using pypcap
(http://code.google.com/p/pypcap/) to sniff some network packets.
To avoid gui freezing I put pcap call
On Wed, Dec 30, 2009 at 18:25, aspineux aspin...@gmail.com wrote:
On Dec 30, 3:07 pm, Dmitry Teslenko dtesle...@gmail.com wrote:
On Wed, Dec 30, 2009 at 16:18, aspineux aspin...@gmail.com wrote:
On Dec 30, 1:34 pm, Dmitry Teslenko dtesle...@gmail.com wrote:
Hello!
I'm making gui gtk
On Wed, May 14, 2008 at 8:18 AM, Gabriel Genellina
[EMAIL PROTECTED] wrote:
En Tue, 13 May 2008 11:57:03 -0300, Dmitry Teslenko [EMAIL PROTECTED]
Is the code above contained in a function? So all references are released
upon function exit?
Yes, it's a function
If not, you could try using
On Wed, May 14, 2008 at 11:04 AM, Dmitry Teslenko [EMAIL PROTECTED] wrote:
When I've rewrite code something like that:
with open(backup_file_name, 'w') as backup_file:
.
filter.parse('updated file name')
del input, output, filter
Hello!
I use some script in python 2.5 from vim editor (it has python
bindings) that updates some file
and then launches another program (ms visual studio, for example) to
do something with updated file.
I faced problem when updated file is locked for writing until vim
editor is closed.
launch
Hello!
I have simple chat application with pygtk UI. I want some event (for
example update user list) to have place every n seconds.
What's the best way to archive it?
I tried threading.Timer but result is following: all events wait till
exit of gtk main loop and only then they occur.
Thanks in
2008/4/14 Jarek Zgoda [EMAIL PROTECTED]:
I have simple chat application with pygtk UI. I want some event (for
example update user list) to have place every n seconds.
What's the best way to archive it?
I tried threading.Timer but result is following: all events wait till
exit of gtk
Hello!
Here's my implementation of a function that executes some command and
drains stdout/stderr invoking other functions for every line of
command output:
def __execute2_drain_pipe(queue, pipe):
for line in pipe:
queue.put(line)
return
def execute2(command,
On Wed, Mar 5, 2008 at 1:34 PM, [EMAIL PROTECTED] wrote:
The Queue.get method by default is blocking. The documentation is not
100% clear about that (maybe it should report
the full python definition of the function parameters, which makes
self-evident the default value) but if you do
On Wed, Mar 5, 2008 at 3:39 PM, [EMAIL PROTECTED] wrote:
time.sleep() pauses ony the thread that executes it, not the
others. And queue objects can hold large amount of data (if you have
the RAM),
so unless your subprocess is outputting data very fast, you should not
have data loss.
Hello!
I've made a trivial xml filter to modify some attributes on-the-fly:
...
from __future__ import with_statement
import os
import sys
from xml import sax
from xml.sax import saxutils
class ReIdFilter(saxutils.XMLFilterBase):
def __init__(self, upstream, downstream):
Hello!
I've made some class that can be used with with statement. It looks this way:
class chdir_to_file( object ):
...
def __enter__(self):
...
def __exit__(self, type, val, tb):
...
def get_chdir_to_file(file_path):
return chdir_to_file(file_path)
...
Snippet with
On Dec 19, 2007 12:14 PM, Peter Otten [EMAIL PROTECTED] wrote:
def __enter__(self):
# ...
return self
should help.
That helps. Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Hello!
On 08/11/2007, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Take a look at the subprocess module.
Big thanks!
It's interesting what's happening with subprocess.Popen instance after
it has been instatiated and script's main thread exits leaving
Popen'ed application open.
--
Hello!
How to write portable (win32, unix) script that launches another
program and continues its execution?
I've looked at spawn*() but it doesn't look in PATH dirs on windows so
it's totally unusable when you don't know where exactly program is.
I've looked at fork() way but there's no fork
On 22/10/2007, Andy Kittner [EMAIL PROTECTED] wrote:
Are you running this on vim or gvim? If you are running on gvim, my
guess is that the handles that you are passing are not valid. In
either case, try creating explicit handles that are valid (such as for
/dev/null) and create the process
Hello!
I'm using subprocess.Popen in python script in vim.
It called this way:
def some_func():
p = subprocess.Popen( command , stdout = subprocess.PIPE,
stderr =
subprocess.STDOUT)
while True:
s = p.stdout.readline()
Hello!
On 24/09/2007, Tommy Nordgren [EMAIL PROTECTED] wrote:
Your problem is that you are not reading the standard output and
standard error streams in the correct way.
You need to do the reading of standard out and standard err in
parallell rather than sequentially.
The called
Hello!
I'm using os.popen to perform lengthy operation such as building some
project from source.
It looks like this:
def execute_and_save_output( command, out_file, err_file):
import os
def execute_and_save_output( command, out_file, err_file):
(i,o,e) = os.popen3( command )
21 matches
Mail list logo