【问题标题】:How to run my python code from shell script file如何从 shell 脚本文件运行我的 python 代码
【发布时间】:2023-02-08 01:00:56
【问题描述】:

我正在尝试从 (build.sh) 运行我的 python 代码 (mycode.py) 我在 kali 中的程序像这样接受 2 个参数($python3 mycode.py system.exe 0x12345) 但我想像这样运行它 (./mycode system.exe 0x12345) 我在 kali Linux 中使用 python3

build.sh的包含: #!/bin/庆典 易于获取更新 apt-get 安装 python3 -y apt-get 安装 python3-pip dos2unix mycode

任何想法?

【问题讨论】:

    标签: python shell kali-linux


    【解决方案1】:

    mycode.py 重命名为 mycode 并添加 shebang:

    #! /usr/bin/env python3
    ...
    

    然后

    chmod +x mycode
    

    你将能够执行

    ./mycode system.exe 0x12345
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-06
      • 2018-09-08
      • 1970-01-01
      • 2019-12-29
      • 2011-04-16
      • 2014-11-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多