Important Notice:

Python Script Mode

Python Script Mode

2 views 2 min read

Script Mode (Python Script Mode) / स्क्रिप्ट मोड (पायथन स्क्रिप्ट मोड) :-

Script Mode (स्क्रिप्ट मोड) Python को चलाने का वह तरीका है जिसमें Program को पहले Python File (.py) में लिखा जाता है, फिर उसे Save (सहेज) करके Run (चलाया) जाता है।

यह Mode विशेष रूप से बड़े Programs (Large Programs) बनाने, बार-बार उपयोग (Reuse) करने तथा Project Development (प्रोजेक्ट विकास) के लिए उपयोग किया जाता है।

Python में Script Mode का उपयोग सामान्यतः Python IDLE Editor, Visual Studio Code (VS Code), PyCharm आदि Editors में किया जाता है।

English

Script Mode is a way of running Python in which the program is first written in a Python file (.py), then saved, and finally executed.

This mode is mainly used for large programs, code reuse, and project development.

Script Mode is commonly used in editors such as Python IDLE Editor, Visual Studio Code (VS Code), and PyCharm.

Working of Script Mode / स्क्रिप्ट मोड की कार्यप्रणाली -

  1. Python IDLE खोलें।
  2. File → New File पर क्लिक करें।
  3. Editor Window में Python Program लिखें।
  4. Program को .py Extension के साथ Save करें।
  5. Run → Run Module (F5) पर क्लिक करें।
  6. Program Execute होगा और Output Python Shell में दिखाई देगा।

English

  1. Open Python IDLE.
  2. Click File → New File.
  3. Write the Python program in the Editor Window.
  4. Save the program with the .py extension.
  5. Click Run → Run Module (F5).
  6. The program is executed and the output is displayed in the Python Shell.

Example / उदाहरण Program (Script File)

a = 10
b = 20
sum = a + b
print("Sum =", sum)
 
 

Output

Sum = 30
 

Features of Script Mode / स्क्रिप्ट मोड की विशेषताएँ :- 1. Program is Saved (प्रोग्राम सहेजा जाता है)

Program को .py File में Save किया जाता है, इसलिए उसे भविष्य में दोबारा उपयोग किया जा सकता है।

English:
The program is saved as a .py file, so it can be used again later.

2. Suitable for Large Programs (बड़े प्रोग्रामों के लिए उपयुक्त) :-

Script Mode बड़े तथा जटिल (Complex) Programs बनाने के लिए उपयुक्त है।

English:
Script Mode is suitable for writing large and complex programs.

3. Easy Editing (आसानी से संशोधन) -

Program को Edit, Modify और Update करना आसान होता है।

English:
Programs can be edited, modified, and updated easily.

4. Code Reusability (कोड का पुनः उपयोग)

एक बार लिखे गए Program को कई बार Run किया जा सकता है।

English:
The same program can be executed multiple times without rewriting it.

5. Better for Project Development (प्रोजेक्ट विकास के लिए उपयुक्त)-

बड़े Software एवं Projects विकसित करने के लिए Script Mode का उपयोग किया जाता है।

English:
Script Mode is widely used for software and project development.

Related Notes