Unit - VII - Advance Python - Session - I - Jupyter notes and other Python development
Home Page
Unit - VII - Advance Python
Session - I - Jupyter notes and other Python development
Python programs can be written and developed on platforms such as Jupyter Notes and Spyder IDE.
IDE full form is Integrated Development Environment
Working in Python Before working in Python, we need to install python on our computers.
- Default installation available from www.python.org is called CPython installation and comes with Python Interpreter, Python IDLE(Python GUI) and Pip (package installer).
- Anaconda Python distribution is one such highly recommended distribution that comes preloaded with many packages and libraries (e.g- Numpy, SciPy, Matplotlib, Panda libraries, etc)
- Popular IDEs are Spyder IDE, Pycharm IDE, etc
Python can be worked in two different ways:-
i) Interactive mode (also called immediate mode)
ii) In script mode
Interactive Mode in Python
Definition:
Interactive mode allows us to type Python commands line by line and see immediate results. You typically access it via the Python shell (>>>
) or an interactive environment like Jupyter Notebook or IPython.
Advantages of Interactive Mode:
-
Immediate Feedback
-
You see the result of each command instantly.
-
Useful for learning, experimenting, and debugging small code snippets.
-
-
Great for Beginners
-
Helps understand how Python works step-by-step.
-
Easy to try out simple functions, variables, and expressions.
-
-
Quick Testing
-
Perfect for testing a function or logic quickly without writing a full program.
-
-
Useful in Data Science
-
Ideal for tasks like data exploration, visualization, and analysis using libraries like pandas, matplotlib, etc.
-
-
Easy to Use
-
No need to save files. Just open Python and start typing.
-
Script Mode in Python
Definition:
Script mode involves writing Python code in a file with .py
extension and then running the whole file. This is done in editors like VS Code, PyCharm, or using the terminal.
Advantages of Script Mode:
-
Reusability of Code
-
Code is saved in a file, so it can be reused or modified later.
-
-
Better for Large Programs
-
Organizes complex code into readable, structured scripts.
-
-
Easier Debugging and Maintenance
-
Errors and logic can be identified and fixed in a structured way.
-
-
Version Control
-
Code files can be managed using Git or other version control tools.
-
-
Suitable for Automation
-
You can schedule and run Python scripts as automated tasks (e.g., using cron jobs).
-
-
Professional Development
-
Script mode is used in real-world applications, web development, software projects, etc.
-
Working in Script Mode (Python IDLE)
Step 1:
i) Click start button ----> All Programs ----> Python 3.6.x -----> IDLE
ii) Click File ----> New in IDLE Python Shell
iii) In new window typing the commands we want to save in the form of program
iv) Click File -------> Save and saving file extension with .py
Step 2 :
Run Module/Script/Program File
i) File -----> Open command
ii) Click Run ------> Run Module
iii) Program executed
Python Shell - The interactive interpreter of Python is also called Python Shell.
Comments
Post a Comment