JohnV wrote:
> I have a txt file that gets appended with data over a time event. The
> data comes from an RFID reader and is dumped to the file by the RFID
> software. I want to poll that file several times over the time period
> of the event to capture the current data in the RFID reader.
>
> W
Here is the latest version of the code:
currentdata_file = r"C:\Users\Owner\Desktop\newdata.txt" # the latest
download from the clock
lastdata_file = r"C:\Users\Owner\Desktop\mydata.txt" # the prior
download from the clock
output_file = r"C:\Users\Owner\Desktop\out.txt" # will hold delta
clock dat
The below code does the trick with one small problem left to be solved
import shutil
import string
currentdata_file = r"C:\Users\Owner\Desktop\newdata.txt" # the current
download from the clock
lastdata_file = r"C:\Users\Owner\Desktop\mydata.txt" # the prior
download from the clock
output_file =
En Wed, 18 Mar 2009 21:02:42 -0200, Emile van Sebille
escribió:
JohnV wrote:
> What I want to do is compare the old data (lets day it is saved to a
file called 'lastdata.txt') with the new data (lets day it is saved to
a file called 'currentdata.txt') and save the new appended data to a
va
JohnV wrote:
> What I want to do is compare the old data (lets day it is saved to a
file called 'lastdata.txt') with the new data (lets day it is saved to
a file called 'currentdata.txt') and save the new appended data to a
variable
You may get away with something like: (untested)
newdata=op
Maybe something like this will work though I am not sure of my quotes
and what to import
import shutil
f = open(r'C:\Users\Owner\Desktop\mydata.txt', 'r')
read_data1 = f.read()
f.close()
shutil.copy('C:\Users\Owner\Desktop\newdata.txt', 'C:\Users\Owner
\Desktop\out.txt')
file = open(r'C:\Users\O
On Wed, Mar 18, 2009 at 2:30 PM, JohnV wrote:
> I have a txt file that gets appended with data over a time event. The
> data comes from an RFID reader and is dumped to the file by the RFID
> software. I want to poll that file several times over the time period
> of the event to capture the curre
but what if
case 1:
no.of keys in f1 > f2 and
case2:
no.of keys in f1 < f2.
Should'nt we get 1.1 if case 1 and 0.9 if case 2?? it errors of with a
keyerror.?
--
http://mail.python.org/mailman/listinfo/python-list
PyPK wrote:
> I have two files
> file1 in format
>
> 'AA' 1 T T
> 'AB' 1 T F
>
> file2 same as file1
>
> 'AA' 1 T T
> 'AB' 1 T T
>
> Also the compare should be based on id. So it should look for line
> starting with id 'AA' (for example) and then match the line so if in
> second case.
S
Not for homework. But anyway thanks much...
--
http://mail.python.org/mailman/listinfo/python-list
Sounds a little like "homework", but I'll help you out.
There are lots of ways, but this works.
import sys
class fobject:
def __init__(self, inputfilename):
try:
fp=open(inputfilename, 'r')
self.lines=fp.readlines()
except IOError:
print "Una
Note that the code i wrote wont do the compare based on id which i am
looking for..it just does a direct file to file compare..
--
http://mail.python.org/mailman/listinfo/python-list
12 matches
Mail list logo