gpt4 book ai didi

linux - Linux 中 ASSOC 和 FTYPE 的等价物?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:56:00 25 4
gpt4 key购买 nike

Linux 中是否有 ASSOC 和 FTYPE 的等价物?

在 Windows 上,我可以使用 ftype 定义文件类型。例如:

assoc .pl=PerlScript
ftype PerlScript=perl.exe %1 %*

完成后,我可以双击该文件,它将使用指定的程序运行。

在 Linux 中(我在使用 KDE 桌面的 Ubuntu 12.04 上)我无法通过双击打开 Python GUI 脚本,似乎是因为 GUI 级别的关联问题而不是终端(它运行正确,如果我从终端运行它,但如果我双击它则不会,在这种情况下显然没有任何反应)。

最佳答案

文件必须在 linux 上生成可执行文件:

$ chmod ugo+x my_file.py

http://ss64.com/bash/chmod.html

关于linux - Linux 中 ASSOC 和 FTYPE 的等价物?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26049824/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com