The easiest way (and with best shell integration) to install Python is to get it from Microsoft Store. The latest version is Python 3.12
VS Code (or Visual Studio Code) is also available in Microsoft Store. VS Code is one of the best IDEs for many programming languages. It manage language specific intelligences via extensions. Please install the following two extensions for better Python programming experience:
If not installed, VS Code will prompt you to install these extensions when you start writing your first python code.
Read this online resource:
for answers to these questions:
You don't need to read all at once.
Run the following simple code (from Credits) to demonstrate a simple stock charting.
Notes: You will need to install plotly and pandas Python packages using pip. Reference to this if you don't know how.
import plotly.express as px df = px.data.stocks() fig = px.line(df, x='date', y=["MSFT","GOOG",'FB',"AMZN"]) fig.show()
Watch this Official Video to learn how to use Git in VS Code.
Note: Create a .gitignore
file to exclude Python virtual environment folder.
Try out the following simple example - getting Amazon stock price data by reading this resource.
# IMPORT THE LIBRARY import yfinance as yf from datetime import datetime # CREATE TICKER INSTANCE FOR AMAZON amzn = yf.Ticker("AMZN") # GET TODAYS DATE AND CONVERT IT TO A STRING WITH YYYY-MM-DD FORMAT (YFINANCE EXPECTS THAT FORMAT) end_date = datetime.now().strftime('%Y-%m-%d') amzn_hist = amzn.history(start='2022-01-01',end=end_date) print(amzn_hist)
Combining Step 2 and Step 3 to plot Amazon stock price and volume over the past two years.