MRAB wrote:
Andrew Robert wrote:
Hi Everyone,
We have a process that does a copy of a share from one location to
another.
This usually works fine but can occasionally bomb if a file is opened
by a user somewhere.
Is there a way to code detection of open files and force a close?
The files in
Hi Everyone,
We have a process that does a copy of a share from one location to another.
This usually works fine but can occasionally bomb if a file is opened by
a user somewhere.
Is there a way to code detection of open files and force a close?
The files in question are typically PDF files
Two issues regarding script.
You have a typo on the file you are trying to open.
It is listed with a file extension of .in when it should be .ini .
The next issue is that you are comparing what was read from the file
versus the variable.
The item read from file also contains and end-of-line
a.m. wrote:
> If I type this in shell
>
> $ ./yourfile.py 12:34 PM &
>
> What does '$', '.', '/' and '& means in this succession? Note: 12:34
> PM is a argument to the yourfile.py.
>
This not python syntax but Unix shell.
$ = shell prompt
./= look for the program in my
[EMAIL PROTECTED] wrote:
> John Salerno wrote:
>> Is it possible to get vim-python for Windows, or is that just a Linux build?
>
>
> It builds for windows.
>
When installed, you may also want to consider the python add-on located at
http://www.vim.org/scripts/script.php?script_id=790
Enhanced
Simon Forman wrote:
> Andrew Robert wrote:
>> Simon Forman wrote:
>>> Paul Rubin wrote:
>>>> "EP" <[EMAIL PROTECTED]> writes:
>>>>> Given that I am looking for matches of all files against all other
>>>>> files (of s
Simon Forman wrote:
> Paul Rubin wrote:
>> "EP" <[EMAIL PROTECTED]> writes:
>>> Given that I am looking for matches of all files against all other
>>> files (of similar length) is there a better bet than using re.search?
>>> The initial application concerns files in the 1,000's, and I could use
>>>
Hi everyone,
Could someone help explain what I am doing wrong in
this code block?
This code block is an excerpt from a larger file that receives
transmitted files via IBM WebSphere MQSeries an drops it to the local
file system.
Transmission of the file works as designed but it has a flaw.
If th
Saint Malo wrote:
> I am new to programming, and I've chosen python to start with. I wrote
> a simple program that asks several questions and assings each one of
> them a variable via raw_input command. I then combined all the
> variables into one like this a = b + c + d. After this I wrote these
If I remember correctly, this behavior depends on how the class is
created (classic mode versus modern).
Modern
class foo(object):
pass
Classic ( pre python 2.2 I believe )
class foo():
pass
The modern method of specifying object in the class def
I use python and the pymqi module to work with IBM WebSphere MQSeries
and IBM WebSphere Message broker.
--
http://mail.python.org/mailman/listinfo/python-list
Hi Everyone,
Thanks for all of your patience on this.
I finally got it to work.
Here is the completed test code showing what is going on.
Not cleaned up yet but it works for proof-of-concept purposes.
#!/usr/bin/python
import re,base64
# Evaluate captured character as hex
def ret_hex(va
Max Erickson wrote:
> Try getting rid of the lamba, it might make things clearer and it
> simplifies debugging. Something like(this is just a sketch):
>
>
> max
>
Yeah.. trying to keep everything on one line is becoming something of a
problem.
To make this easier, I followed something from
Hi everyone,
I have two test scripts, an encoder and a decoder.
The encoder, listed below, works perfectly.
import re,sys
output = open(r'e:\pycode\out_test.txt','wb')
for line in open(r'e:\pycode\sigh.txt','rb') :
output.write( re.sub(r'([^\w\s])', lambda s: '%%%2X' %
ord(s.group()), line)
Andrew Robert wrote:
> I have two Perl expressions
>
>
> If windows:
>
> perl -ple "s/([^\w\s])/sprintf(q#%%%2X#, ord $1)/ge" somefile.txt
>
> If posix
>
> perl -ple 's/([^\w\s])/sprintf("%%%2X", ord $1)/ge' somefile.txt
>
Dennis Lee Bieber wrote:
> On Wed, 24 May 2006 14:45:55 GMT, John Salerno
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
>> I just right-clicked on My Computer --> Properties --> Advanced -->
>> Environment Variables, and added a new one called PYTHONPATH. I don't
>> know i
I have two Perl expressions
If windows:
perl -ple "s/([^\w\s])/sprintf(q#%%%2X#, ord $1)/ge" somefile.txt
If posix
perl -ple 's/([^\w\s])/sprintf("%%%2X", ord $1)/ge' somefile.txt
The [^\w\s] is a negated expression stating that any character
a-zA-Z0-9_, space or tab is ignored.
The ()
Hey Bruno,
Although I have not tested it, this appears to be it exactly.
Some confusion though.
> import struct
>
> class TriggerMessage(object):
> def __init__(self,data):
> """
> Unpacks the passed binary data based on the
> MQTCM2 format dictated in
>
wes weston wrote:
> Andrew Robert wrote:
>> Hi Everyone,
>>
>> I am having a problem with a class and hope you can help.
>>
>> When I try to use the class listed below, I get the statement that self
>> is not defined.
>>
>> test=TriggerMes
Hi Everyone,
I am having a problem with a class and hope you can help.
When I try to use the class listed below, I get the statement that self
is not defined.
test=TriggerMessage(data)
var = test.decode(self.qname)
I would have thought that self would have carried forward when I
Hi Everyone,
Is there a way to test if a file is binary or ascii within Python?
I'd prefer not to text against file extension.
Any help you can provide would be greatly appreciated.
Thanks,
Andy
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> hello --
>
> i'm running python/pygame on maemo (nokia 770). my situation is that
> i'm continually scouring this one directory for incoming files. if i
> see if there's a new file (coming in via wireless scp), i proceed to
> load it and process it.
>
> however, i think
Hi everyone,
I am in the process of creating a file transmit/receiver program using
MQSeries.
The way it works is through creation of an XML message.
Elements within the XML message contain things such as file name, size,
and the file contents.
The file contents are encoded, currently using Bas
r.e.s. wrote:
> I have a million-line text file with 100 characters per line,
> and simply need to determine how many of the lines are distinct.
>
> On my PC, this little program just goes to never-never land:
>
> def number_distinct(fn):
> f = file(fn)
> x = f.readline().strip()
> L
Peter Otten wrote:
> Andrew Robert wrote:
>
>> format='4s 4s 48s 48s 64s 4s 256s 128s 128s 48s'
>
> You are trying to squeeze 10 items into just
>
>> d1,d2=struct.unpack(format,data)
>
> two variables (d1 and d2)
>
>> ValueError: too man
Hey everyone,
Maybe you can see something I don't.
I need to convert a working piece of perl code to python.
The perl code is:
sub ParseTrig {
# unpack the ibm struct that triggers messages.
my $struct = shift;
my %data;
@data{qw/StructID Version QName ProcessName TriggerData ApplType
Gary Herron wrote:
> Andrew Robert wrote:
>
>
> The windows CreateProcess call has many of the same semantics as the
> Unix fork, i.e., a new process is created sharing all the resources of
> the original process. The "subprocess" modules uses CreateProcess, but
bruno at modulix wrote:
> Andrew Robert wrote:
>> Hi everyone,
>>
>>
>> I have a python program that will need to interact with an MQSeries
>> trigger monitor.
>>
>> It does this fine but it hogs the trigger monitor while it executes.
>>
>>
Hi everyone,
I have a python program that will need to interact with an MQSeries
trigger monitor.
It does this fine but it hogs the trigger monitor while it executes.
I'd like to fork the program off and terminate the parent process so
that the trigger monitor frees up.
Does anyone how this c
Tim N. van der Leeuw wrote:
> Andrew Robert wrote:
>> Hi Everyone.
>>
>>
>> I tried the following to get input into optionparser from either a file
>> or command line.
>>
>>
>> The code below detects the passed file argument and prints the file
Max Erickson wrote:
> I don't know much about optparse, but since I was bored:
>
help(o.parse_args)
> Help on method parse_args in module optparse:
>
> parse_args(self, args=None, values=None) method of
> optparse.OptionParser instance
> parse_args(args : [string] = sys.argv[1:],
>
Max Erickson wrote:
> Andrew Robert <[EMAIL PROTECTED]> wrote in
> news:[EMAIL PROTECTED]:
>
<\snip>
> Check parser.usage, it is likely to look a lot like your infile.
>
> I'm not sure, but I think you need to pass your alternative arguments
> to par
Hi Everyone.
I tried the following to get input into optionparser from either a file
or command line.
The code below detects the passed file argument and prints the file
contents but the individual swithces do not get passed to option parser.
Doing a test print of options.qmanager shows it una
When I run the script, I get an error that the file object does not have
the attribute getblocks.
Did you mean this instead?
def getblocks(f, blocksize=1024):
while True:
s = f.read(blocksize)
if not s: return
yield s
def getsum(self):
Roy Smith wrote:
>>
>> However this does not appear to be actually returning the checksum.
>>
>> Does anyone have insight into where I am going wrong?
>
> After calling update(), you need to call digest(). Update() only updates
> the internal state of the md5 state machine; digest() returns the
Actually, I think I got it but would like to confirm this looks right.
import md5
checksum = md5.new()
mfn = open(self.file_name, 'r')
for line in mfn.readlines():
checksum.update(line)
mfn.close()
cs = checksum.hexdigest()
print
Good evening,
I need to generate checksums of a file, store the value in a variable,
and pass it along for later comparison.
The MD5 module would seem to do the trick but I'm sketchy on implementation.
The nearest I can see would be
import md5
m=md5.new()
contents = open(self.file_name,"rb").
Hi everyone,
Has anyone developed a pymqi module based file transfer method for use
with WebSphere MQSeries v5.3?
If so, would it be possible to point me towards examples of how this was
done?
Any help that can be provided would be greatly appreciated.
Thanks
--
http://mail.python.org/mailma
Hi Everyone,
Has anyone done any Python coding to manage/interact/customize BMC Patrol?
If anyone has, could you please point me to where I can find
documentation/guides on this?
I checked the Python SIGs and Vault of Parnasus but didn't see anything
available.
Any insight you might have on thi
x_freeze.
Details on it can be found at
http://starship.python.net/crew/atuining/cx_Freeze/
Binaries are available for Linux and Windows.
Alternately, source code is available if you need to compile it for a
different platform.
--
Thank you,
Andrew Robert
E-mail: [EMAIL PROTECTED]
Ur:
ainst the resident OS the program is running
against and set the clear command based on that.
--
Thank you,
Andrew Robert
E-mail: [EMAIL PROTECTED]
Ur: http://shardservant.no-ip.info
--
http://mail.python.org/mailman/listinfo/python-list
What about a dead camel?
--
http://mail.python.org/mailman/listinfo/python-list
42 matches
Mail list logo