Greg Lindstrom <[EMAIL PROTECTED]> writes:
> Hello-
> I am writing an application where I need to recognize when a file
> arrives in a given directory. Files may arrive at any time during the
> course of the day. Do I set up a cron job to poll the directory every
> few minutes? Write a daemo
This might be hack-ish, more elegant solutions are likely to exist, but this
is the general idea:
LINEFEED = "\n" # or whatever
EOR = "?"# or whatever
def fixEOR(filename):
f = open(filename,"r+")
byte = True
# loops through whole file
while True:
# loops through record
Greg Lindstrom wrote:
> Hello-
>
> I have a task which -- dare I say -- would be easy in
> Perl but would rather do in Python (our primary
> language at Novasys). I have a file with varying length records.
All
> but the first record, that is; it's always 107 bytes long. What I
would
> like to d
Greg Lindstrom wrote:
I have a task which -- dare I say -- would be easy in
Perl but would rather do in Python (our primary
language at Novasys). I have a file with varying length records. All
but the first record, that is; it's always 107 bytes long.
I intuit that you are dealing with EDI
untested
def my_getter(m, i, f):
try:
return m[i]
except (KeyError, IndexError):
return f()
my_getter(d, 'x', bigscaryfunction)
my_getter(d, 'y', lambda: scaryinlineexpresion)
pgp04VRKFqQL1.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python
Survey says.
...wxYield()
;)
M.E.Farmer
--
http://mail.python.org/mailman/listinfo/python-list
Stefan Waizmann wrote:
I would like the distutils are creating a binary distribution only - means
create the distribution file with *.pyc files WITHOUT the *.py files. Any
ideas?
You will need to create your own command. You can either specialize the
build command, to not copy the source code (mor
Steve Horsley wrote:
It is my understanding that the BOM (U+feff) is actually the Unicode
character "Non-breaking zero-width space".
My understanding is that this used to be the case. According to
http://www.unicode.org/faq/utf_bom.html#38
the application should now specify specific processing,
rbt wrote:
More of an OS question than a Python question, but it is Python related
so here goes:
When I do os.walk('/') on a Linux computer, the entire file system is
walked. On windows, however, I can only walk one drive at a time (C:\,
D:\, etc.). Is there a way to make os.walk() behave on Wi
Michael Hoffman wrote:
Greg Lindstrom wrote:
I have a file with varying length records. All but the first record,
that is; it's always 107 bytes long. What I would like to do is strip
out all linefeeds from the file, read the character in position 107
(the end of segment delimiter) and then re
Thomas Philips:
> I've just downloaded and installed ActivePython and am trying to
> customize the PythonWin editor. Its line spacing seems to default to 2,
> and consequently, I cannot see many lines of code on a screen. How do I
> set the line spacing to 1?
I presume you are talking about th
When I do os.walk('/') on a Linux computer, the entire file system is
walked. On windows, however, I can only walk one drive at a time (C:\,
D:\, etc.).
If this is a personal utility for one computer, and if you run XP on
that computer, then you have the ability to mount secondary drives
on to
I don't think what you want would even work. You can't walk A:
unless a floppy is present, O/S will bark at you. You can't
walk D: (cdrom drive) unless a CDROM is present. What about
network drives??? Unlike Linux where these directories appear
to be empty if nothing is mounted Windows tries to
On Tue, 2005-03-08 at 14:27, [EMAIL PROTECTED] wrote:
> Earl Eiland wrote:
> > Anyone know how to capture text from GUI output? I need to process
> > information returned via a GUI window.
> >
> > Earl
>
> Assuming Windows, then these guys have an interesting tool:
> http://www.skesoft.com/te
I've noticed that using set_charset() on an email.Message instance will not
replace any existing Content-Transfer-Encoding header but will install one
if it isn't yet present.
Thus, if you initially create a message without a charset, it defaults to
us-ascii, and creates both Content-Type and Cont
Ah, unfortunately it looks like this program uses something called
gcvs, a gtk cvs interface written in C++, for interfacing to low level
cvs routines. So it probably won't work for me. Oh well. Anyone else
have any suggestions?
--
http://mail.python.org/mailman/listinfo/python-list
Thanks, M.E.Farmer.
I continue to be impressed with how quickly and nicely one can get help
here.
Brent
"M.E.Farmer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Survey says.
> ...wxYield()
>
> ;)
> M.E.Farmer
>
--
http://mail.python.or
Hello folks:
(This message is also posted on the help forum at the pexpect
sourceforge page, but all indentation in the code got stripped away
when I submitted the post.)
For some time I've wanted to make use of the ANSI.py module in the
pexpect package to handle screen-based telnet sessions in P
Tobiah wrote:
When I do os.walk('/') on a Linux computer, the entire file system is
walked. On windows, however, I can only walk one drive at a time (C:\,
D:\, etc.).
If this is a personal utility for one computer, and if you run XP on
that computer, then you have the ability to mount secondar
I've used profile before, but wanted to get more information so I
thought I'd try hotshot instead. It works fine when used like profile.
But when I run it using this line,
prof = hotshot.Profile('ScanHot.prof', lineevents=1)
though it runs all right, when I try to load the resulting file I get
Fyi, I found the
answer ( at least one that still works )
def PrintThread(myThread):
while myThread.isAlive() == True:
line = p.stdout.readline()[:-1] if
line ==
"":
continue if line ==
'\0':
break print line
Dave.
-
I need a HTTP server handling long lasting requests e.g. 10-30 seconds.
Below is a pice of the code. In order to make the server reponsive while
handling othere requests I use SocketServer.ThreadingMixIn.
However the problem is the it does not work out. I checked thet a new
thread is created fo
Does BaseHTTPServer.BaseHTTPRequestHandler support HTTP protocol chunking?
Thanks, Andy
--
http://mail.python.org/mailman/listinfo/python-list
so e.g.
x={}
x['a']=1
x['A']=2
print x['a'] #prints 2
Thx, A.
--
http://mail.python.org/mailman/listinfo/python-list
Andy Leszczynski wrote:
so e.g.
x={}
x['a']=1
x['A']=2
print x['a'] #prints 2
Thx, A.
http://www.google.com/search?&q=python+case+insensitive+dictionary
Michael
--
http://mail.python.org/mailman/listinfo/python-list
Andy Leszczynski wrote:
Does BaseHTTPServer.BaseHTTPRequestHandler support HTTP protocol chunking?
No. Hardly any HTTP 1.1 features are supported.
regards
Steve
--
http://mail.python.org/mailman/listinfo/python-list
Earl Eiland wrote:
> This sounds like just what I need. What is COM, and where do I get
it?
Also worth checking out:
Simon Brunning's WinGuiAuto - control/query of windows and controls,
including the function getEditText to read the text in an edit control.
See http://www.brunningonline.net/simo
Dear all,
Following are some codes:
from myClass import * # some user define classes, which will catch
the exception within its function
thread_function():
myClass myclass
while (1):
returnValue = myclass.myfunction();
print "Return Value %s" % returnValue
Lucas Raab wrote:
flupke wrote:
Hi,
i capture a movie from mividv to an avi containing the dv video. I
found a program that reads the timestamp from the avi so you know the
exact date and time the video was shot. However, the source of that
program is not available and it doesn't allow to batch
101 - 129 of 129 matches
Mail list logo