[Tutor] how to clear contents of a file

2010-02-09 Thread sudhir prasad
hi, how to clear contents of a file with out actually deleting it, basically wat im trying to do is copy a source file into a common file ,run the common file,after that i need to copy another source file into the common file,i ant to clear the contents of the common file before copying

[Tutor] callable objects

2010-02-02 Thread sudhir prasad
hi, in my porgram i have two modules say module 1 and module 2,module 2 consists of two sub modules say sm1 and sm2, i run module1 ,first it calls sm1 in module 2 and a list gets updated,now i again pass the same list to sm2 in module2 but im getting an error 'list' object is not callable so i

[Tutor] keeping track of the present line in a file

2010-01-20 Thread sudhir prasad
hi, is there any other way to keep track of line number in a file other than fileinput.filelineno() ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] what is the equivalent function to strtok() in c++

2010-01-10 Thread sudhir prasad
hi, what is the equivalent function to strtok() in c++, what i need to do is to divide a line into different strings and store them in different lists,and write them in to another file ___ Tutor maillist - Tutor@python.org To unsubscribe or change

[Tutor] (no subject)

2010-01-09 Thread sudhir prasad
hi, iam a beginner. sample_file = file(/home/ee08m082/Desktop/python/123.txt,w) sample_file.write(About Pythons\n) in the above two line code,123.txt is being created but About Pythons is not being written in the file. my OS is redhat linux and python version is 2.3.4 thanks