Conditions | 4 |
Total Lines | 18 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import sys |
||
7 | def _check_if_executed_with_python(): |
||
8 | if not sys.argv: |
||
9 | return |
||
10 | |||
11 | if sys.argv[0] == "-m": |
||
12 | return |
||
13 | |||
14 | match = re.search("pypen", sys.argv[0]) |
||
15 | if match: |
||
16 | return |
||
17 | |||
18 | print() |
||
19 | print("It seems like you are trying to run a PyPen sketch using the python command.") |
||
20 | print("Try instead running it with 'pypen {}'!".format(" ".join(sys.argv))) |
||
21 | print() |
||
22 | print("Run 'pypen --help' for more information.") |
||
23 | print() |
||
24 | settings._is_executing_with_python = True |
||
25 | |||
63 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.