单项选择题
使用python打开my.txt文件的代码如下:
File=open(“my.txt”,”a”)
假如在“my.txt”中写入”abcd”,下列操作不正确的是()
A.file.write(“abcd”)
B.file.write(list(“abcd”))
C.file.writelines(“abcd”)
D.file.writelines(list(“abcd”))
相关考题
-
单项选择题
设a.txt文件内容的第一行为“计算机视觉”(有回车换行符),读取该文件第一行“计算”内容正确的是()
A.file=open(“a.txt”);print(file.read(2))
B.file=open(“a.txt”);print(file.read(4))
C.file=open(“a.txt”);print(file.readlines(2))
D.file=open(“a.txt”);print(file.readlines(4)) -
单项选择题
复制是我们日常生活中经常用到的一个操作,那么对一个文件,下列属于可以直接复制到这个文件的内容以及权限的shutil模块是()。
A.shutil.copy()
B.shutil.copy2()
C.shutil.copyfile()
D.shutil.copytree() -
单项选择题
有img0、img1、img2、img3四张图合成一张图img,现要img3呈现在img的左下角方位,下列可以实现的是()
A.matplotlib.pyplot.subplot(222);matplotlib.pyplot.imshow(img3);matplotlib.pyplot.title(‘img’)
B.matplotlib.pyplot.subplot(223);matplotlib.pyplot.imshow(img3);matplotlib.pyplot.title(‘img3’)
C.matplotlib.pyplot.subplot(222);matplotlib.pyplot.imshow(img3);matplotlib.pyplot.title(‘img3’)
D.matplotlib.pyplot.subplot(224);matplotlib.pyplot.imshow(img3);matplotlib.pyplot.title(‘img’)
