2014-05-28

posted May 28, 2014, 7:52 AM by Samuel Konstantinovich   [ updated May 28, 2014, 7:52 AM ]
Adding to a file:

f=open("pass.dat",'a') #'a' mode is append. You use this to add to a file.
f.write("TEXT YOU WANT TO WRITE TO THE END OF THE FILE")
f.close()

#DO NOT use 'w' mode, or you ERASE the file and start from the beginning.

Calculating the address of the computer connecting to your website:

import os
ip = os.environ["REMOTE_ADDR"]

Comments