Linux中可执行文件的不正确路径
我需要在Linux中运行 exe 文件,该文件具有Python代码:
import os
dirname = os.path.normpath(os.getcwd())
print(dirname)
当我使用命令python code.py 运行代码时,它运行良好
并为我提供输出:\ root \ path \ to \ file
。
但是,当我尝试使用具有相同python代码的命令wine64 code.exe
运行exe文件时
,它会给我输出:z:\ root \ path \ to \ file
。
我尝试通过添加dirname = dirname.replace('z:','')
来解决它,
但是它不起作用,该怎么做?
I need to run an exe file in Linux which has the Python code:
import os
dirname = os.path.normpath(os.getcwd())
print(dirname)
When I run the code with the command python code.py
, it runs fine
and gives me the output : \root\path\to\file
.
But when I try to run the exe file with the command wine64 code.exe
,
which has the same python code, It gives me the output : Z:\root\path\to\file
.
I tried to fix it by adding dirname = dirname.replace('Z:', '')
,
but it doesn't work, How to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论