错误一:
File "D:\Program Files\Python37\lib\site-packages\pwnlib\term\term.py", line 167
SyntaxError: invalid syntax
原因:
python3不再支持元组作为函数参数。
解决方案:
打开term.py,修改部分代码,去除元组参数。
def goto(r, c): #改了这里 do('cup', r - scroll + height - 1, c)
def render_from(i, force = False, clear_after = False): e = None # `i` should always be a valid cell, but in case i f***ed up somewhere, I'll # check it and just do nothing if something went wrong. if i < 0 or i >= len(cells): return goto(cells[i].start[0],cells[i].start[1]) #改了这里 for c in cells[i:]: if not force and c.start == e: goto(cells[-1].end[0],cells[-1].end[1]) #改了这里 break elif e: c.start = e render_cell(c, clear_after = clear_after) e = c.end if clear_after and (e[0] < scroll or e[1] < width - 1): put('\x1b[J') flush()
错误二:
import fcntl
ModuleNotFoundError: No module named 'fcntl'
原因:
windows中的python不自带fcntl而且这个模块
解决方案:
python路径下的Lib中新建一个fcntl.py文件,并写入:
def fcntl(fd, op, arg=0): return 0 def ioctl(fd, op, arg=0, mutable_flag=True): if mutable_flag: return 0 else: return "" def flock(fd, op): return def lockf(fd, operation, length=0, start=0, whence=0): return
待续。。。
文章来源: https://blog.csdn.net/polaris_119/article/details/90521800