On 06/05/2012 02:54 PM, hassan wrote:
Dear ALL ,

what is the equivalent to the php fputs in python


regards,

Hello,

Have you tried something like this (I'll be passing the filename as an argument):


from sys import argv

script, dest_file = argv


data_to_write = raw_input()

output = open(dest_file, 'w')

output.write(data_to_write)



You can execute it this way:

python <script_name.py> <file_you_want_to_create>

e.g:

python script.py data.txt




--
~Jugurtha Hadjar,
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to