python - 如何执行python文件?
问题描述
我做了test.py
并跑了chmod u+x test.py
。如果我运行python test.py
但不运行,它会起作用./test.py
。我究竟做错了什么?
./test.py: line 1: syntax error near unexpected token `"HelloWorld"'
./test.py: line 1: `print ("HelloWorld")'
解决方案
推荐阅读
- scala - Spark 结构化流 + Kafka 集成:MicroBatchExecution PartitionOffsets 错误
- php - Laravel - /laravel/framework/src/Illuminate/Foundation/helpers.php 中的解析错误
- c++ - 如何创建一个函数来计算并返回平均值、最大值和最小值?
- ios - ld:未找到架构 arm64 的符号 clang:错误:链接器命令失败,退出代码为 1,”
- powershell - Powershell 脚本未通过 Informatica Powercenter 运行
- python - 使用 PyTesseract 从图像中识别文本时出现问题
- kubernetes - kubectl get nodes 显示 NotReady
- java - 同时播放多个扬声器
- xamarin - 如何解决,当我们使用多个视图时,键盘会自动隐藏?
- python - 从存储在变量中的类创建的模拟实例