我正在尝试从python中的特定位置读取文件内容,在输入选项后,它没有显示任何内容而且它刚出来的程序,任何人都可以指导我这个代码有什么问题?
import os
print('Please Enter the Choice and Press Enter')
print (' 1. Check for Version.xml \n 2. Check for PatchTool.log \n 3. Check for Logger ')
choice = input('Enter your choice: ')
if (choice == 1):
version=open('d:\\pyhton\\abc.txt', 'r')
ver = version.read()
print(ver)
elif (choice == 2):
xyz=open('d:\\pyhton\\xyz.txt', 'r')
xyz1 = xyz.read()
print(xyz1)
elif (choice == 3):
de=open('d:\\pyhton\\def.txt', 'r')
de1 = de.read()
print(de1)
else:
print('You entered the wrong Choice')