diff options
| author | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-06-05 15:02:48 +0200 |
|---|---|---|
| committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-06-06 14:05:38 +0000 |
| commit | e58320653e3e455685636b58750088f806b98533 (patch) | |
| tree | be097fd52b4f57d22911abe8c1b06b18e966cafa /examples/tutorial/t5.py | |
| parent | b4d260cad13b9f65a7efd388bc16dcea9048496d (diff) | |
scriptableapplication: execution as one line
The previous approach executed the entered script line-by-line,
it was not possible to execute multi-line statements,
for example:
for i in range(0, 10):
print(i)
because PyRun_SimpleString was complaining about the colon.
To avoid all these extra steps we can concatenate all the lines
into one, and then execute it, instead of creating a temporary file.
This will delegate error handling to Python.
Change-Id: Idda572aa1b2e3daad2ba1ed9d70f0a8714b8c995
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/tutorial/t5.py')
0 files changed, 0 insertions, 0 deletions
