These days I am trying to write a remote shell with python. I used winpwn module, which based on threading and standard io. Now I want to improve these things and found a quesion:
sys.stdin.read() is unavaliable in IPython Console.
this problem might relate to another quesion:
Unsupported operation sys.stdout.fileno() in IPython Console
because of these questions, I cannot use standard io by os.read or os.write in IPython Console, which is meaningful to my continued work
Now I am using Spyder 5.1.5 | Python 3.9.7 64-bit | Qt 5.9.7 | PyQt5 5.9.2 | Windows 10 | IPython 7.29.0
I tried the same operations above in pycharm's IPython Console (7.29.0), and it all work in pycharm.What steps reproduce the problem?
What is the expected output? What do you see instead?
- import sys and input "sys.stdin.read()"
- input "sys.stdout.fileno()"
Paste Traceback/Error Below (if applicable)
- it should be like input function but I got flash and no input.
- it should return an integer about file descriptor (1 if stdout) according to pycharm but I got Exception.
In : sys.stdout.fileno()
Traceback (most recent call last):
File "C:\Users\10310\AppData\Local\Temp/ipykernel_24744/2810973561.py", line 1, in <module>
File "C:\Users\10310\anaconda3\lib\site-packages\ipykernel\iostream.py", line 308, in fileno
- Spyder version: 5.1.5
- Python version: 3.9.7
- Qt version: 5.9.7
- PyQt version: 5.9.2
- Operating System name/version: Windows 10