skip to Main Content

OS : macOS Monterey 12.4 but someone had same issue with Ubuntu
EDI : Thonny
Installation : by pip3 command to use my already installed Python interpreter 3.9

In the Thonny console:

help(print)

no output but python seems waiting for something as with the input function, I press return and:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1892, in __call__
    return self.func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 814, in callit
    func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/thonny/running.py", line 548, in _poll_backend_messages
    if self._pull_backend_messages() is False:
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/thonny/running.py", line 561, in _pull_backend_messages
    msg = self._proxy.fetch_next_message()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/thonny/plugins/cpython_frontend/cp_front.py", line 138, in fetch_next_message
    msg = super().fetch_next_message()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/thonny/running.py", line 1218, in fetch_next_message
    if msg.event_type == "ProgramOutput":
AttributeError: 'InputSubmission' object has no attribute 'event_type'

Any idea?

2

Answers



  1. The help function works on -objects-, which may not be clear to all.
    In your case, you want help on the object that is the built-in ‘print’ function.

    You get the results you are looking for by entering
    help(‘print()’)
    PS: This works for instances like help(‘while’)

    Here’s the output for help on print():

    Help on built-in function print in module builtins:

    print(…)
    print(value, …, sep=’ ‘, end=’n’, file=sys.stdout, flush=False)

    Prints the values to a stream, or to sys.stdout by default.
    Optional keyword arguments:
    file:  a file-like object (stream); defaults to the current sys.stdout.
    sep:   string inserted between values, default a space.
    end:   string appended after the last value, default a newline.
    flush: whether to forcibly flush the stream.
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search