import os

freenetdir = '\Freenet'
hops = 10
filename = 'foo.txt'
key = 'gpl.txt'
#win32
fileout = ("\Snarfzilla\%s" % filename)
print fileout
frequest = (r"c:\Freenet\Frequest.exe")
cmd = ('"%s" -h %s %s %s' % (frequest, hops, key, fileout))
#cmd = ('"%s" -h %s %s' % (finsert, hops, key))
print cmd
i, o, result = os.popen3(cmd)
print "OPEN"
l = result.readline()
print "READ FIRST LINE"
print "L", l
good = 0
filesize = 0
ttlFileSize = 0
while l:
    l = result.readline()
    print "while", l
