problems about in ipython console

Skip to first unread message

YuFei Duan

Dec 11, 2021, 4:29:25 PM12/11/21
to spyder
Problem Description

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: 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 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?
  1. import sys and input ""
  2. input "sys.stdout.fileno()"
What is the expected output? What do you see instead?
  1. it should be like input function but I got flash and no input.
  2. it should return an integer about file descriptor (1 if stdout) according to pycharm but I got Exception.
Paste Traceback/Error Below (if applicable)
import sys 
Out[2]: ''

In [3]: sys.stdout.fileno() 
Traceback (most recent call last): File "C:\Users\10310\AppData\Local\Temp/ipykernel_24744/", line 1, in <module> sys.stdout.fileno() 
 File "C:\Users\10310\anaconda3\lib\site-packages\ipykernel\", line 308, in fileno 
raise io.UnsupportedOperation("fileno") 
UnsupportedOperation: 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
Reply all
Reply to author
0 new messages