Thanks so much for writing this!
If you have a cell that contains more than one command, the output from Stata contains the full console, including each command. For example, here's what you get if you run two commands from one cell:
sysuse auto
tab foreign rep78
. sysuse auto
(1978 automobile data)
. tab foreign rep78
| Repair record 1978
Car origin | 1 2 3 4 5 | Total
-----------+-------------------------------------------------------+----------
Domestic | 2 8 27 9 2 | 48
Foreign | 0 0 3 9 9 | 21
-----------+-------------------------------------------------------+----------
Total | 2 8 30 18 11 | 69
.
But if you break up the commands to one per cell you don't get the echo:
| Repair record 1978
Car origin | 1 2 3 4 5 | Total
-----------+-------------------------------------------------------+----------
Domestic | 2 8 27 9 2 | 48
Foreign | 0 0 3 9 9 | 21
-----------+-------------------------------------------------------+----------
Total | 2 8 30 18 11 | 69
Based on the documentation for pystata.stata.run it looks like the way to fix this is to wrap what's passed as its code parameter in """, which will make Stata treat the cell like a do-file.
I'd write a PR for this but I don't know Python. Sorry!
Thanks so much for writing this!
If you have a cell that contains more than one command, the output from Stata contains the full console, including each command. For example, here's what you get if you run two commands from one cell:
But if you break up the commands to one per cell you don't get the echo:
Based on the documentation forpystata.stata.runit looks like the way to fix this is to wrap what's passed as itscodeparameter in""", which will make Stata treat the cell like a do-file.I'd write a PR for this but I don't know Python. Sorry!