Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Python Scripts and Modules Explained - Programming Example

  • Appficial
  • 2021-08-27
  • 7795
Python Scripts and Modules Explained - Programming Example
pythonpython scriptpython moduleappficialscriptmodulepython programs in different filespython filespython programpython modulesmodulesscriptspython scriptshow to import a python scriptimport scriptimporting in pythonpython importpython programmingpython examplelearn pythonfree python__main__python mainmain functionPython interpreter
  • ok logo

Скачать Python Scripts and Modules Explained - Programming Example бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Python Scripts and Modules Explained - Programming Example или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Python Scripts and Modules Explained - Programming Example бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Python Scripts and Modules Explained - Programming Example

The interactive Python interpreter lets programmers run code a line at a time, which is typically used for short programs or just practicing python syntax. More commonly, programmers write Python program code in a file called a script, and execute the code using a Python interpreter.

Programmers may write lots of separate script files, and even import code into other scripts. A module is a file that contains Python code that may be used by other modules or scripts. An import statement makes a module available for use via dot notation. Ex: math.pi

When writing large programs, putting code into smaller modules makes managing it easier. There are many useful pre-installed modules that are part of the Python standard library that you can use in your programs. They typically contain useful functions, which we will learn in a future video.

When you import a module, all code in the module is executed immediately. Python programs typically use the built-in special name _name_ to determine if the file was executed as a script by the programmer. Files may also be imported by another module.

The code belonging to the following if statement executes only if file run as a script (i.e. running the file: python user.py)

name = 'Bob'age = 20
if _name_ == '__main__':
print(name, 'is', age, 'years old’)

If you wanted to import the objects found in demo.py, then in another file, write the statement to the top of the program:

import demo

print(demo.name, 'is', demo.age, 'years old')

Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]