Welcome to
Mod The Sims
Online: 1661
Have an account? Sign in:
If you don't have an account, why not sign up now? It's free!
Other sites: SimsWiki
Reply  Replies: 0 (Who?), Viewed: 4176 times.
Search this Thread
Old 18th Jul 2018, 3:10 AM DefaultInteractive Python Console Mod #1
Original Poster

Test Subject

Join Date: Jul 2018
Posts: 1
Thanks: 5 in 1 Posts

Hi there. I created a little tool to help explore the Sims 4's Python API, an interactive Python console.

After installing this mod, launch the game, pause, and use the cheat "python_console.start" to start the Python console. A new browser window will be opened which will allow you to interact with the Sims 4's Python API.

When you're done playing God, the command "python_console.stop" will kill the Python console's HTTP server.

The operation of the console is pretty straight forward. Type your code into the text box at the bottom of the screen. Press Ctrl+Enter to execute and Ctrl+Up and Ctrl+Down to navigate the history. After execution, the output will be displayed on the screen. When an exception occurs, it will be displayed in bold, red text.

WARNING: I would not recommend using this tool with save games that you actually care about. Just probing data is probably fine, but modifying anything could seriously screw up your game.

Also, the Python console HTTP server is run in a separate thread and there is no synchronization, so race conditions can occur if the simulation is running while playing with the Python console. That's why I recommend pausing the game before launching the console.

Hope someone finds this useful. Happy modding!
Click image for larger version

Name:  01.png
Views: 0
Size:  31.5 KB   Click image for larger version

Name:  02.png
Views: 0
Size:  31.2 KB  
Download - please read all instructions before downloading any files!
File Type: zip TS4 Python Console v0.1.zip (3.7 KB, 26 downloads) - View custom content
5 users say thanks for this.
[ Click here to view a longer list ]

Section jump:

Powered by MariaDB Some icons by http://dryicons.com.