Re: This code not working, need suggetions

2012-04-23 Thread Anirudh Srinivasan
Thanks Min and Chris for your ideas and suggestion, i understood my mistake. This code is working fine now. On Mon, Apr 23, 2012 at 2:51 AM, Min Yu wrote: > try this code out. The lsdir function and cat function are both used in > main(). > > The bash commands are as following: > > yumin@yumin-t

Re: This code not working, need suggetions

2012-04-23 Thread Min Yu
try this code out. The lsdir function and cat function are both used in main(). The bash commands are as following: yumin@yumin-think:~/src/test/python/community$ python list.py `pwd` /home/yumin/src/test/python/community list.py file1 file2 Which file would you like to browse ?file1 This is file

Re: This code not working, need suggetions

2012-04-23 Thread Chris Rebert
On Sun, Apr 22, 2012 at 11:16 PM, Anirudh Srinivasan wrote: > > My code lists the files and directory under a folder and if we want to > read the file it uses the function  cat. > > But the function cat(get_file) is not working , any suggetions? Please specifically state exactly how it's deviatin

This code not working, need suggetions

2012-04-22 Thread Anirudh Srinivasan
My code lists the files and directory under a folder and if we want to read the file it uses the function cat. But the function cat(get_file) is not working , any suggetions? Here is my code: #!/usr/bin/python import os import sys import commands #import cat def listdir(s): try: file =