Conditions | 4 |
Total Lines | 18 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import sys |
||
6 | def _check_if_executed_with_python(): |
||
7 | if not sys.argv: |
||
8 | return |
||
9 | |||
10 | if sys.argv[0] == "-m": |
||
11 | return |
||
12 | |||
13 | match = re.search("pypen", sys.argv[0]) |
||
14 | if match: |
||
15 | return |
||
16 | |||
17 | print() |
||
18 | print("It seems like you are trying to run a PyPen sketch using the python command.") |
||
19 | print("Try instead running it with 'pypen {}'!".format(" ".join(sys.argv))) |
||
20 | print() |
||
21 | print("Run 'pypen --help' for more information.") |
||
22 | print() |
||
23 | settings._is_executing_with_python = True |
||
24 | |||
55 | return grid(1, 0, 0) |