🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 2 Min Lesezeit
0

Modules

↗ Quelle (dev.to)
🗣️ Stimme:




Modules :



Every python file is a module.

To create a module just save the code you want in a file with the file extension .py

Modules have special variables.

example:

file (file---->The file path of the module)

name (name---->Name of the module)

doc (documtation string of the module) ("""abcd""" or '''abcd''')



input




CODE
#current module name - vara.py

""" The nature is beautiful"""
print(__name__)
print(__file__)
print(__doc__)






output

__main__

C:\Users\Lakshmipriya\OneDrive\Desktop\VARATHARAJAN\vara.py

The nature is beautiful



The import statement

The import statement in Python is used to bring code from one module into another.

example :




CODE
#num.py

def add(no1,no2):
print(no1+no2)


def subtract(no1,no2):
print(no1-no2)


def multiply(no1,no2):
print(no1*no2)


def divide(no1,no2):
print(no1/no2)






input




CODE
#vara.py

import num

num.add(10,20)
num.subtract(50,25)






*output *




30

25



If we need specific functions alone from one module means then no need to import whole module,instead we can use "from" to take specific function



example

input




CODE
#vara.py

from num import add,subtract

add(10,20)
subtract(50,25)
multiply(10,20) #this function is not defind






output





30

25

Traceback (most recent call last):

File "C:\Users\Lakshmipriya\OneDrive\Desktop\VARATHARAJAN\vara.py", line 7, in <module>

multiply(10,20)

NameError: name 'multiply' is not defined



help()

To see all details about the particular module like functions, file location, including documentation string.





num.py



''' This module contain some functions'''



def add(no1,no2):

print(no1+no2)



def subtract(no1,no2):

print(no1-no2)



input




CODE
import num
print(help(num))






output




CODE
NAME
num - This module contain some functions

FUNCTIONS
add(no1, no2)

divide(no1, no2)

multiply(no1, no2)

subtract(no1, no2)

FILE
c:\users\lakshmipriya\onedrive\desktop\varatharajan\num.py


None


Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Modules

Thematisch verwandte Begriffe: Modules · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...