Re: extraction tool using CRF++

2013-10-01 Thread cerr
On Tuesday, October 1, 2013 3:04:00 PM UTC, Joost Molenaar wrote: Hi Ron, In the python/ subdirectory of the CRF++ source package there's a README with instructions on how to use the CRFPP python module. Joost, Hoops, didn't see that! Yes, Thanks! :) --

extraction tool using CRF++

2013-09-30 Thread cerr
Hi, I want to write an extraction tool using CRF++ (http://crfpp.googlecode.com/svn/trunk/doc/index.html). I have written a trainings file and a template: training: banana FOODB-NP bread FOODI-NP template: U01:%x[0,1] U02:%x[1,1] and now I want to go ahead and extract the foods from

replace only full words

2013-09-28 Thread cerr
Hi, I have a list of sentences and a list of words. Every full word that appears within sentence shall be extended by WORD i.e. I drink in the house. Would become I drink in the house. (and not I drink in the house.)I have attempted it like this: for sentence in sentences: for noun in

Re: replace only full words

2013-09-28 Thread cerr
On Saturday, September 28, 2013 4:54:35 PM UTC, Tim Chase wrote: On 2013-09-28 09:11, cerr wrote: I have a list of sentences and a list of words. Every full word that appears within sentence shall be extended by WORD i.e. I drink in the house. Would become I drink in the house

Re: replace only full words

2013-09-28 Thread cerr
On Saturday, September 28, 2013 11:07:11 AM UTC-7, MRAB wrote: On 28/09/2013 18:43, cerr wrote: [snip] Great, only I don't have the re module on my system :( Really? It's part of Python's standard distribution. Oh no, sorry, mis-nformation, i DO have module re available!!! All

Re: replace only full words

2013-09-28 Thread cerr
On Saturday, September 28, 2013 11:17:19 AM UTC-7, Tim Chase wrote: [mercy, you could have trimmed down that reply] On 2013-09-28 10:43, cerr wrote: On Saturday, September 28, 2013 4:54:35 PM UTC, Tim Chase wrote: import re Great, only I don't have the re module on my

question about posting data using MultipartPostHandler

2013-08-15 Thread cerr
Hi, I want to use http post to upload data to a webserver but I want to pass multiple arguments within the post i.e. I know that you can load one item (data)in there like this: data = {data:open(filename,rb)} response = opener.open(url, data,

http post goes into $_REQUEST instead into $_FILES

2013-08-15 Thread cerr
Hi, I have a Python script that is executing an http POST to transfer a file from the client to the server. I have achieved this with below code: from binascii import hexlify, unhexlify from httplib import HTTPConnection, HTTPException import os import hashlib import socket import urllib2

Re: HTTP post with urllib2

2013-08-07 Thread cerr
On Tuesday, August 6, 2013 5:14:48 PM UTC-7, MRAB wrote: On 06/08/2013 23:52, cerr wrote: Hi, Why does this code: #!/usr/bin/python import urllib2 from binascii import hexlify, unhexlify host = localhost uri=/test.php data =\x48\x65\x6C\x6C\x6F

HTTP post with urllib2

2013-08-06 Thread cerr
Hi, Why does this code: #!/usr/bin/python import urllib2 from binascii import hexlify, unhexlify host = localhost uri=/test.php data =\x48\x65\x6C\x6C\x6F\x57\x6F\x72\x6C\x64 #Hello World url=http://{0}{1}?f=test.format(host, uri) req = urllib2.Request(url, data,{'Content-Type':

Re: HTTP post with urllib2

2013-08-06 Thread cerr
On Tuesday, August 6, 2013 4:08:34 PM UTC-7, Joel Goldstick wrote: On Tue, Aug 6, 2013 at 6:52 PM, cerr ron.egg...@gmail.com wrote: Hi, Why does this code: #!/usr/bin/python import urllib2 from binascii import hexlify, unhexlify host = localhost uri

binary key in dictionary

2013-07-30 Thread cerr
Hi, In my application I have followingf lines: print curr_mac print hexlify(buf) binmac = unhexlify(curr_mac) tmpgndict[binmac] += buf curr_mac being a 3Byte MAVC address in ASCII and I want to populate a dictionary where the

dump a multi dimensional dictionary

2013-07-26 Thread cerr
Hi, Can I somehow use pickle.dump() to store a dictionary of lists to a file? I tried this: import pickle mylist = [] mydict = {} mylist = '1','2' mydict['3'] = mylist fhg = open (test, 'w') pickle.dump(fhg,mydict) Traceback (most recent call last):

Re: trigger at TDM/2 only

2013-06-07 Thread cerr
DaveA, Yep, that seems to just be about it! Much easier! Thanks for the hint! Much appreciated :) Ron On Thursday, June 6, 2013 5:43:11 PM UTC-7, Dave Angel wrote: On 06/06/2013 08:03 PM, cerr wrote: Hi, I have a process that I can trigger only at a certain time. Assume I have

Re: trigger at TDM/2 only

2013-06-07 Thread cerr
MRAB, Thanks for the hint! Yep, that's much easier! Thanks! :) Ron On Thursday, June 6, 2013 5:49:55 PM UTC-7, MRAB wrote: On 07/06/2013 01:03, cerr wrote: Hi, I have a process that I can trigger only at a certain time. Assume I have a TDM period of 10min, that means, I can only

trigger at TDM/2 only

2013-06-06 Thread cerr
Hi, I have a process that I can trigger only at a certain time. Assume I have a TDM period of 10min, that means, I can only fire my trigger at the 5th minute of every 10min cycle i.e. at XX:05, XX:15, XX:25... For hat I came up with following algorithm which oly leaves the waiting while loop

logger doesn't roll over

2012-11-21 Thread cerr
Hi, I'm using Python's logger for logging but it doesn't seem to roll over, my file is now 2.2MB and should've rolled over after ever 1MB. My code: logger = logging.getLogger() logger.setLevel(logging.DEBUG) handler = logging.handlers.RotatingFileHandler( LOGFILE,

trac.util

2012-04-11 Thread cerr
Hi, I want to install some python driver on my system that requires trac.util (from Image.py) but I can't find that anywhere, any suggestions, anyone? Thank you very much, any help is appreciated! Error: File /root/weewx/bin/Image.py, line 32, in module from trac.util import escape

upload file using post to https server

2010-09-23 Thread cerr
hi, I've been unsucessfully trying to upload a file using POST to an https server. I've succesfully logged in and gotten to read something from the server.. I have come up with something like this: authinfo = urllib2.HTTPBasicAuthHandler()

Re: socket.error: [Errno 98] Address already in use

2010-09-16 Thread cerr
On Sep 15, 5:51 pm, jipalaciosort...@gmail.com jipalaciosort...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 El 15/09/2010 20:58, Grant Edwards escribió: On 2010-09-15, cerr ron.egg...@gmail.com wrote: I get a socket error [Errno 98] Address already in use when i

Re: socket.error: [Errno 98] Address already in use

2010-09-16 Thread cerr
On Sep 15, 11:58 am, Grant Edwards inva...@invalid.invalid wrote: On 2010-09-15, cerr ron.egg...@gmail.com wrote: I get a socket error [Errno 98] Address already in use when i try to open a socket that got closed before with close(). How come close() doesn't close the socket properly

socket.error: [Errno 98] Address already in use

2010-09-15 Thread cerr
Hi There, I get a socket error [Errno 98] Address already in use when i try to open a socket that got closed before with close(). How come close() doesn't close the socket properly? My socket code : s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host, port)) s.listen(1) ...

Re: how to kill a subprocess

2010-09-10 Thread cerr
On Sep 9, 4:18 pm, MRAB pyt...@mrabarnett.plus.com wrote: On 09/09/2010 23:52, cerr wrote: On Sep 9, 3:29 pm, Alain Ketterlinal...@dpt-info.u-strasbg.fr wrote: cerrron.egg...@gmail.com  writes: I'm calling a python script from a php script which again calls a perl script

Re: how to kill a subprocess

2010-09-10 Thread cerr
On Sep 10, 11:45 am, Christian Heimes li...@cheimes.de wrote: Am 10.09.2010 19:51, schrieb cerr: Thanks for your suggestion, changed my code now to:   process=subprocess.Popen(commandlist)   ...   ...   process.kill()   os.waitpid(process.pid, 0) but it's not killing the process

Re: how to kill a subprocess

2010-09-10 Thread cerr
On Sep 10, 12:18 pm, Christian Heimes li...@cheimes.de wrote: Am 10.09.2010 20:56, schrieb cerr: But I wanna kill the child process I start from my python code. It's like PHP - Python - Perl and when the connection PHP - Python seems to work well! You have said that the Python process

how to kill a subprocess

2010-09-09 Thread cerr
Hi There, I'm calling a python script from a php script which again calls a perl script with subprocess.popen(). This seems to work fine so far only that once the python script completed it is becoming a zombie because the perl script in the background is still running... so before i exit the

Re: how to kill a subprocess

2010-09-09 Thread cerr
On Sep 9, 3:29 pm, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: cerr ron.egg...@gmail.com writes: I'm calling a python script from a php script which again calls a perl script with subprocess.popen(). This seems to work fine so far only that once the python script completed

listening socket

2010-09-08 Thread cerr
Hi, I'm trying to create a listening socket connection on port 1514. I tried to follow the documentation at: http://docs.python.org/release/2.5.2/lib/socket-example.html and came up with following lines: import socket host = '' # Symbolic name meaning all available interfaces

Re: listening socket

2010-09-08 Thread cerr
On Sep 8, 10:06 am, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Wed, Sep 8, 2010 at 12:59 PM, cerr ron.egg...@gmail.com wrote: Hi, I'm trying to create a listening socket connection on port 1514. I tried to follow the documentation at: http://docs.python.org/release/2.5.2/lib

executing script in fork

2010-09-08 Thread cerr
Hi There, I want to trigger another script and having it running forked to my mother process. I googled around and came up with following: commandlist=['./GPSsim.pl',proto,'files/gps.txt'] subprocess.Popen(commandlist) print GPS simulator started This however doesn't seem disconnect

Re: DeprecationWarning

2010-09-02 Thread cerr
On Sep 1, 5:04 pm, Chris Rebert c...@rebertia.com wrote: On Wed, Sep 1, 2010 at 8:58 AM, cerr ron.egg...@gmail.com wrote: Hi There, I would like to create an scp handle and download a file from a client. I have following code: snip but what i'm getting is this and no file is downloaded

Re: DeprecationWarning

2010-09-02 Thread cerr
On Sep 2, 4:25 pm, Chris Rebert c...@rebertia.com wrote: On Thu, Sep 2, 2010 at 4:19 PM, cerr ron.egg...@gmail.com wrote: On Sep 1, 5:04 pm, Chris Rebert c...@rebertia.com wrote: On Wed, Sep 1, 2010 at 8:58 AM, cerr ron.egg...@gmail.com wrote: Hi There, I would like to create an scp

DeprecationWarning

2010-09-01 Thread cerr
Hi There, I would like to create an scp handle and download a file from a client. I have following code: import sys, os, paramiko,time from attachment import SCPClient transport = paramiko.Transport((prgIP, 22)) try: transport.connect(username='root', password=prgPass) except

scp with paramiko

2010-09-01 Thread cerr
Hi There, I want to download a file from a client using paramiko. I found plenty of ressources using google on how to send a file but none that would describe how to download files from a client. Help would be appreciated! Thanks a lot! Ron --

huh??? weird problem

2010-05-14 Thread cerr
Hi There, I got following code: start=time.time() print 'warnTimeout '+str(WarnTimeout) print 'critTimeout '+str(CritTimeout) print 'start',str(start) while wait: passed = time.time()-start print 'passed ',str(passed) if passed = WarnTimeout: print ' Warning!' ... ... ...

Re: Broken pipe

2010-05-07 Thread cerr
, 2010 at 10:27 PM, cerr ron.egg...@gmail.com wrote: Hi There, I'm very new to Python and i wanna write a script that sends a certain string to a server. The code I came up with looks like this: #!/usr/bin/python import sys import string from socket import * usage

Broken pipe

2010-05-06 Thread cerr
Hi There, I'm very new to Python and i wanna write a script that sends a certain string to a server. The code I came up with looks like this: #!/usr/bin/python import sys import string from socket import * usage=USAGE: +sys.argv[0]+ server port; if len(sys.argv) != 3: print usage;