So I made this script call auto ascii encrypter and it basically goes character by character through a script and converts it to ascii numbers. It makes a new a script using the ascii numbers. But I get an error no matter how simple the script is. 'invalid syntax.' Heres the code and thanks for the help.
import os
import sys
import glob
result = ""
for script_to_convert in glob.glob1(sys.path[0],'*.py*'):
if str(sys.path[0])+'\\'+script_to_convert != sys.argv[0]:
print 'converting', script_to_convert, '...'
opened_script = open(script_to_convert, 'r')
for eachline in opened_script:
for eachletter in eachline:
for eachchar in range(0, 256):
if chr(eachchar) == eachletter:
result = result+"chr("+str(eachchar)+")+"
result = result[0:-1]
opened_script.close()
os.rename(sys.path[0]+'\\'+script_to_convert, 'c:\python25\custom scripts'+'\\'+script_to_convert)
print 'moved', script_to_convert, 'to c:\python25\custom scripts'
ascii_file = open('ascii_'+script_to_convert, 'w')
ascii_file.write('eval('+result+')')
ascii_file.close()
print 'ascii_'+script_to_convert, 'has been created.'
raw_input('conversion completed. Press enter to exit')
sys.exit()
else:
print 'No other files found.'