==> ftype /?
Displays or modifies file types used in file extension associations
fileType Specifies the file type to examine or change
openCommandString Specifies the open command to use when launching files
of this type.
…
==> assoc /?
Displays or modifies file extension associations
ASSOC [.ext[=[fileType]]]
.ext Specifies the file extension to associate the file type with
fileType Specifies the file type to associate with the file extension
…
测试(请根据您的情况更改路径):
示例photon.py脚本以二进制模式读取文件并将其内容打印到控制台:
import sys
if len( sys.argv) > 1:
file_name = sys.argv[1]
else:
file_name = 'D:\\test\\test.photon' # if no file name supplied
with open( file_name, 'rb') as f:
file_data = f.read()
print( file_data)
input( "Press Enter to continue...")
您可能对FTYPE和ASSOC命令感兴趣:
测试(请根据您的情况更改路径):
示例
photon.py
脚本以二进制模式读取文件并将其内容打印到控制台:在提升的命令提示符下,仅运行一次:
然后,从任何命令提示符(或双击
.photon
文件)运行以下所有操作:使用
raw_input()
表示python2,input()
表示python3。你知道吗将输出存储到变量,并在需要时使用它。这将通过双击帮助您使用它。你知道吗
相关问题 更多 >
编程相关推荐