RUVIDEO
Поделитесь видео 🙏

sys module in python

📁 Обучение 👁️ 19 📅 02.12.2023

In this video you will learn about various variables and functions of sys module in python.

sys module python

The sys module is a built in module in python. It provides several functions and variables to manipulate the python runtime environment. To use its functions we have to import it. The commonly used functions and variables of sys module are as follows:
• exit(): This function is used to terminate a program when needed. It can also be used to exit from the python terminal.
import sys
print("Hello World")#prints Hello World
sys.exit()#Terminate program here
print("Bye World")#It will not run

• path: This variable shows the value of PYTHON PATH environment variable which is set in the current system.
import sys
print(sys.path)#prints path, where the python modules are searched.

• platfom: This variable is used to identify the host operating system which we are using.
import sys
print(sys.platform)#prints os name

• executable : This specifies the path of python executable file.
import sys
print(sys.executable)#prints python executable’s path

• modules: Returns the list of available modules.
import sys
print(sys.modules)#prints all modules

• copyright : This shows the copyright info.
import sys
print(sys.copyright)#prints copyright info

• argv : This is actually a list which stores the command line arguments. The command line arguments or CLA are the parameters which are passed from command prompt while executing a python program. They are similar to command line arguments of C/C++/Java.
import sys
for x in sys.argv:
print(x)
The first command line argument is the name of the python file itself.

Besides the above, the sys module also provides various properties like stdin, stdout, and stderr that can be used to redirect the standard input, output and error streams. You can find out complete details on following page:
https://docs.python.org/3/library/sys.html


#python_by_tarun_sir #tarun_sir #python #tarun_sir_python #python_video_58 #sys_module_in_python #python_tutorial #command_line_arguments_in_python #exit_function_in_python

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «sys module in python», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.