求助,关于python的command not found问题
# -*- coding: utf-8 -*-
# Simple Gopher Client with file-like interface - Chapter 1
# gopherclient3.py
import socket,sys
port = 70
host = sys.argv[1]
filename = sys.argv[2]
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect((host,port))
# 程序需要既读又写,关闭缓存模式
fd = s.makefile('rw',0)
fd.write(filename + "\r\n")
for line in fd.readlines():
sys.stdout.write(line)
以上为源代码,运行时输入sudo ./gopherclient3.py quux.org /,提示”command not found",但是同一目录下的其他python文件可以正常运行。
相关推荐
覆盖原先的PATH导致命令失效提示command not found的解决方法
本文主要讨论了在Linux服务器上遇到“command not found”错误的原因,以及如何解决由于覆盖系统PATH变量导致命令失效的问题。作者分享了一个具体案例,其中一位同事在 `/etc/pr
Ubuntu18.04安装ROS Melodic(Command not found E:无法获得锁,rosdep init初始化失败问题(网上种办法均解决不了,不是网络问题,我来教你安装))
Command not found E:无法获得锁,rosdep init初始化失败问题(网上种办法均解决不了,不是网络问题,我来教你安装)↵安装Melodic新手第一次装melodic的时候根据安装
Python代码解决RenderView窗口not found问题
### Python代码解决RenderView窗口not found问题#### 概述在进行三维动画或视觉效果制作过程中,使用Maya软件时经常会遇到一个常见错误:“RenderView not found
/bin/sh: python: not found 问题的解决
原因python 可能被 python2 或者 python 3 代替了导致映射不到。解决方法命令行执行: ls -l /usr/bin/python*然后会出现:lrwxrwxrwx 1 root
Python中出现IndentationError:unindent does not match any outer indentation level错误的解决方法
### Python中的IndentationError: unindent does not match any outer indentation level错误详解及解决方案#### 错误概述在Python


