Friday, April 10, 2026

About Jupyter Notebooks and other Environments

 

About Jupyter Notebooks and other Environments

Besides PyCharm, there are many ways to develop Python code.  You might use Idle, Xcode, Visual Studio, Jupyter Notebooks or many other environments.  The code you submit on github must have a .py extension and must run immediately on PyCharm.

You github repository will also include a free codespace account with an online editor modeled after Visual Studio. It's fine to write your code there, just be sure to commit and push your solution.

Coding in a Jupyter Notebook and using iPython is a fantastic way to learn, and as a data scientist it is a great way to maintain a lab notebook and also immediately see graphical results of your work.  I encourage you to try Jupyter, but I think it will be tough to make it work for this class, as we will be using GitHub.  You do need to know that I cannot grade anything that is written in iPython (.ipynp or similar extension). 


🎯 Main Rule (VERY IMPORTANT)

πŸ‘‰ You must submit a .py file
πŸ‘‰ Your code must run in PyCharm

❌ NOT allowed for submission:

  • .ipynb (Jupyter Notebook)
  • iPython files
  • screenshots or text files

🧠 What this means

Even though there are many coding tools like:

  • Jupyter Notebook
  • Visual Studio Code
  • PyCharm
  • IDLE

πŸ‘‰ Your instructor will ONLY grade code that works in PyCharm as a .py file


⚠️ Why Jupyter is NOT allowed

Jupyter Notebook files (.ipynb):

  • Run code in cells (not like normal programs)
  • May not follow main() structure
  • Don’t match assignment requirements
  • Hard to test automatically

πŸ‘‰ So even if your code works there, you will not get credit


✅ What you SHOULD do

Option 1 (Best)

Use PyCharm directly

Option 2

Use GitHub Codespaces / VS Code
πŸ‘‰ BUT you must:

  1. Save file as:
assignment1.py
  1. Make sure it runs like a normal program
  2. Upload (push) to GitHub

πŸ§ͺ How to double-check before submitting

Open your .py file in PyCharm and run it:

Please enter your name: Eric
Hi Eric, let's explore some historical temperatures.

πŸ‘‰ If it runs like this → ✅ You’re safe


🚨 Common mistakes students make

  • ❌ Submitting .ipynb file
  • ❌ Writing code outside main()
  • ❌ Using Jupyter-style output
  • ❌ Forgetting if __name__ == "__main__":

πŸ‘ Simple checklist before submission

  • ✔ File ends with .py
  • ✔ Runs in PyCharm
  • ✔ Uses main()
  • ✔ Output matches exactly
  • ✔ Uploaded to GitHub

No comments:

Post a Comment

  Good Morning! Welcome to Spring quarter and to CS 3A. I'm sorry for the late welcome, I've been making my way back from Asia but I...