题目内容

test.txt文件中有下面内容:HelloworldHelloPython执行下列代码后f=open("c:\\test.txt","a")f.write("IamlearningPython")f.close()test.txt文件中的内容是:

A. HelloworldHelloPythonIamlearningPython
B. HelloworldHelloPython
C. Helloworld
D. HelloPython

查看答案
更多问题

打开文件后,移动文件指针可以用seek(offset[,whence])函数,whence参数可以为0、1或2。要把文件指针移动到文件尾,()语句可以实现。

A. f.seek(0,0)
B. f.seek(0,1)
C. f.seek(0,2)
D. f.seek(5,2)

文件的属性中有创建时间、读取时间、修改时间,这三个时间用从()到现在的秒数来表示。

A. 1900年1月1日 00时00分00秒
B. 1970年1月1日 00时00分00秒
C. 1970年1月1日 8时00分00秒
D. 0001年1月1日 00时00分00秒

Python中复制文件可以使用下列命令():

A. os.copy("c:\\test.txt","d:\\test.bak")
B. shutil.copy("c:\\test.txt","d:\\test.bak")
C. os.cp("c:\\test.txt","d:\\test.bak")
D. shutil.cp("c:\\test.txt","d:\\test.bak")

Python对文件进行写操作时,可以使用( )函数。

A. write()
B. append()
C. writeline()
D. insert()

答案查题题库