Skip to content

Running "Hello World!" in Python ACT R

githubjimmyd edited this page Jun 9, 2023 · 10 revisions

At this point you should have Python3 and Python ACT-R installed on your machine. If you do not, or don't know if you do, please go back to Installing Python 3 and Python ACT-R on Your Machine

Next we will download a simple "Hello World!" model to see if Python ACT-R is running properly.

If you do not already have a folder for models, you might want to make one now. Download this code to it:

Hello World! Python ACT-R code

Now that you have it downloaded, you need to run it. Go to your code editor and open it. If you don't have a code editor that you already use, you can use "idle," which is the code editor that comes with Python. This tutorial will assume you are using idle.

Open idle. tk how to open idle. Go to file/open. Select hello_world.py

Idle has two windows. One is the idle command line (a Python command line) and there will be at least one other with the code in it. Make sure the focus is on the code window (click it), then hit F5 or use the mouse and go to Run/Run Module. This runs whatever code is in the focus window.

You should get some output (in the idle command line window) that looks like this:

>>> 
= RESTART: /Users/JimDavies/Dropbox/Jimmy/code/python-acr-r/examples/hello_world.py
hello world!
>>> 

If you got that, then congratulations, you have successfully run a simple Python ACT-R model, and everything is working.

Now it's time to learn about Python ACT-R and begin the tutorial proper. To do this, we will talk about the code in the hello world model and what it means.

Next: Understanding the "Hello World!" Model

Back to the Tutorials main page.