Getting Started with Glowscript

Glowscript encounters some problems when using Safari. Please use Google Chrome as your browser when using Glowscript. If you encounter any issues with Glowscript, log out and close your browser, then log back in and try again.

Throughout the course of this PD series, we will be using the Integrated Development Environment (IDE) Glowscript. Glowscript is a free, online server where users can write and compile Visual Based Python (VPython) code. In order to use Glowscript, follow the steps below:

  • In the upper right-hand corner of the page, there is a location to “Sign In.” You do not need to create a user account to use Glowscript. Glowscript uses your existing google account as your user information. If you do not have an existing google account (gmail account), you will need to make one. If you do have an existing google account, sign in with that and click “Allow” when prompted.
  • Once logged in, the main display will change and show you are logged in. To access programs, click on “here” located at the end of the sentence, “You are signed in as username and your programs are here.”

  • You are now in your programs menu. Here, your programs will be organized by folders (tabs). Each time you begin a new computational problem, you should make a new folder. To do this, select “Add Folder,” and make sure you select “Public.” When you make a program in Glowscript, it is stored in the users account you wrote the program in. In order for your group mates to be able to access the program later, you need to make the folder public.
  • Then, select “Create New Program.” You should be taken to a new screen where you will actually write the code. Important: at the top of the program, it will have the following line, “GlowScript 2.9 VPython.” DO NOT DELETE THIS LINE. This is what imports the necessary functionality into the programming environment. If you delete this line, your code will not work.
  • To make sure you are set to go, type the following code into a Glowscript code and run the program.
sphere( )
  • Your display should now show a white sphere. You can now navigate between running the code (Run this Program) and editing the code (Edit this Program). Use two finger scrolling to zoom in, and use hold control while clicking to rotate the visuals once you run.
  • If you want to make your program display some text, edit your program by adding the following line of code, and then run your program again.
print("Hello, World!")
  • It is good practice to comment each line of code you write to remind yourself what it does and why you wrote it. You can comment code by using the pound (#) symbol. It is important that you and others understand each line of code. The comments are meant to externalize that understanding.
# This is a commented line in Glowscript
  • Make sure at the end of each computational day, you navigate back to the folder your code is in and copy and paste the URL into an email and send it to your team. This will allow them to access your code at a later date.

For more information and some example programs, see the “Example Programs” section on the main Glowscript page. http://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/

Once logged in, the Help button in the upper right hand corner of the screen contains a useful introduction along with tutorials and extensive descriptions.

  • summer_2019/getting_started.txt
  • Last modified: 2020/02/12 04:33
  • by tallpaul