Your Python setup is ready. Now it is time to create something yourself.
In this step, you will make a small project folder, create your first
.py file, run it, change one value, and run it again.
What you will finish:
a Python file named hello_alphesta.py will print a sentence that you changed yourself.
1. Create Your Alphesta Lab Folder
Open Windows File Explorer and go to your Documents folder.
Create a new folder named:
alphesta-lab
This folder will grow as you follow Alphesta. Today it will contain only one small file.
Open Visual Studio Code. Select File → Open Folder,
choose alphesta-lab, and select Select Folder.
If VS Code asks whether you trust the authors of the files in this folder, you can trust it because this is a folder you just created yourself.
2. Create Your First Python File
Look at the Explorer panel on the left side of VS Code. Select the New File button.
Name the file:
hello_alphesta.py
The ending .py tells VS Code that this is a Python source file.
3. Type Two Lines of Python
Copy these two lines into the file:
message = "Welcome to the Alphesta Python Lab."
print(message)
Before running the code, understand what each line does.
message = ... stores the sentence in a variable named
message.
print(message) tells Python to show the value stored in
message.
Press Ctrl + S to save the file.
4. Run the File
Look at the upper-right corner of the editor. Select the triangular Run Python File button.
VS Code will open a terminal at the bottom and run the file with the Python interpreter you selected in the previous article.
You should see:
Welcome to the Alphesta Python Lab.
5. Change One Value Yourself
Now change only the sentence:
message = "My first Alphesta experiment is running."
print(message)
Save the file and select Run Python File again.
This time you should see:
My first Alphesta experiment is running.
That small change matters. You did not just copy and run code. You changed an input and observed the result. This is the basic learning pattern we will keep using in Alphesta.
Check Your Result
You have completed this article if:
alphesta-labexists on your computer.hello_alphesta.pyis saved inside it.- The file runs without an error.
- The terminal shows the sentence you changed yourself.
One Common Problem: You Do Not See the Run Button
First, check the filename. It must end with:
.py
For example:
hello_alphesta.py
Also confirm that the Microsoft Python extension from the previous article is installed and that a Python interpreter is selected.
What You Just Learned
A Python script is simply a text file containing Python instructions. You save the file, Python reads the instructions, and the terminal shows the result.
More importantly, you have started the Alphesta learning loop:
Write → Run → Change → Observe.
In the next step, you will install the three packages we need for our first market-analysis experiments: FinanceDataReader, pandas, and matplotlib.
Source note: The run workflow follows current Microsoft Visual Studio Code Python documentation. The screenshot is from the official VS Code documentation and may show different example text. Visual Studio Code and Microsoft names and logos are trademarks of their respective owners.