Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tutorials:pycram:repl [2021/04/23 12:31] – created jdech | tutorials:pycram:repl [2023/02/23 12:33] (current) – [Setup IPython as a PyCRAM Repl] jdech | ||
---|---|---|---|
Line 23: | Line 23: | ||
robot = bullet_world.Object(" | robot = bullet_world.Object(" | ||
floor = bullet_world.Object(" | floor = bullet_world.Object(" | ||
- | milk = bullet_world.Object(" | + | milk = bullet_world.Object(" |
world.robot = robot | world.robot = robot | ||
Line 44: | Line 44: | ||
Now the BulletWorld window should show up and load all objects specified in the setup file. After everything is loaded you are presented with a prompt where you can now type python code as well as use the objects which are initialized in the executed code. | Now the BulletWorld window should show up and load all objects specified in the setup file. After everything is loaded you are presented with a prompt where you can now type python code as well as use the objects which are initialized in the executed code. | ||
+ | |||
+ | ==== Enable autoreload ==== | ||
+ | To use changes made in the Python file while the Repl is running you need to enable the iPython extension autoreload. This can be done using the iPython startup files, these are files which are always run if iPython is started. | ||
+ | The startup files are located in ~/ | ||
+ | In this directory create a file called 00-autoreload.ipy and enter the following code to the file. | ||
+ | < | ||
+ | %load_ext autoreload | ||
+ | %autoreload 2 | ||
+ | </ | ||
+ | |||
+ | The first line loads the extension to iPython and the second line configures autoreload to reload all modules before the typed in code is executed. | ||
+ | |||
+ | **Tip** | ||
+ | If you use iPython only as a Repl for PyCRAM you can create a symbolic link in the startup directory which links to your setup.py file. | ||