Question on File Input and AST

joy99 subhakolkata1234 at gmail.com
Sun Sep 6 09:53:43 CEST 2009


Dear Group,

I have a file "test1.txt". Now, as I do the file handling, i try to do
any one of the following operations.

1. open_file=open("/python26/test1.txt","r") # FOR READING
2. open_file=open("/python26/test1.txt","r+") # FOR READING AND
WRITING BOTH
[Either of 1 or 2 to open as the need be]
3. read_file=open_file.read()
etc...

But how to work with "fileinput" or "ast".

I tried to read python docs and some backlog question answer in the
group but it did not help much.

If any one can kindly give one or two small examples. It would help me
much.

Best Regards,
Subhabrata.



More information about the Python-list mailing list