如果从数据文件 c:\data.txt 中读取数据时,以下打开文件方式中,正确的是( ).
A: Open c:\data.txt For Input As
B: 1
C: Open c:\data.txt For Output As
D: 1
E: Open "c:\data.txt" For Input As
F: 1
G: Open "c:\data.txt" For Output As
H: 1
A: Open c:\data.txt For Input As
B: 1
C: Open c:\data.txt For Output As
D: 1
E: Open "c:\data.txt" For Input As
F: 1
G: Open "c:\data.txt" For Output As
H: 1
举一反三
- 下面哪个指令可以将data写入文件d:/data.txt? A: write.table(data,"d:/data.txt") B: write.csv(data,"d:/data.txt") C: library(readr)write_csv(data,"d:/data.txt") D: 以上都可以
- 下列代码中能够正确实现追加写入的是( )。 A: with open("d:\\python\\data.txt",'w') as f: f.write('Hello!') B: with open("d:\\python\\data.txt",'a') as f: f.write('Hello!') C: with open("d:\\python\\data.txt",'r+') as f: f.write('Hello!') D: with open("d:\\python\\data.txt",'wb+') as f: f.write('Hello!')
- 为了读取数据,需要打开顺序文件“D:\data5.txt”,以下正确的命令是。 A: Open "E:\UserData.txt" For Input As B: 2 C: Open "E:\UserData.txt" For Output As D: 2 E: Open E:\UserData.txt For Output As F: 2 G: Open E:\UserData.txt For Input As H: 1
- 为了读取数据,需打开顺序文件“D:\data5.txt”,以下正确的命令是 A: Open D:\data5.txt For Input As #1 B: Open "D:\data5.txt"For Input As #2 C: Open D:\data5.txt For Output As #1 D: Open "D:\data5.txt"For Output As #2
- 下列哪一种是以顺序文件方式打开文件并进行写操作( ). A: Open "c:\file1.dat" For Output as B: 1 C: Open "c:\file1.dat" For Input as D: 1 E: Open "c:\file1.dat" For Print as F: 1 G: Open "c:\file1.dat" For Write as H: 1