Avatar ·

Python how to output result (works in console, but not in Pycharm)

📁 Advanced Python Topics, question, python3, pip, work

When running in the console, everything works, everything outputs,

> python3.4 t1.py

outputs:

signal8 - 0  signal9 -  0  signal11 -  0  signal22 -  0 signal22 -  0 signal25 -  0

But in Pycharm, it doesn't. It probably forms it as an object. The question is how to output what I get: subprocess, stdout?

t1.py

import subprocessprint (""Start program"")
Avatar ·

Everything works.

  1. In files, specify import and from without leading dots:

    from package2.ext import var

    instead of

    from ..package2.ext import var
  2. You need to run the following command from the your_project folder:

    python -m package1.code

You can specify the full path to python, like usr/bin/python. It's important to specify -m and a dot . between package1 and code, not /, and after

Log in to leave an answer

Blogs