diff --git a/TEMA1/IDLE.png b/TEMA1/IDLE.png new file mode 100644 index 0000000..203f920 Binary files /dev/null and b/TEMA1/IDLE.png differ diff --git a/TEMA1/Pr0.py b/TEMA1/Pr0.py new file mode 100644 index 0000000..2ac7299 --- /dev/null +++ b/TEMA1/Pr0.py @@ -0,0 +1,5 @@ +#Программа по Теме 1 Филиппова Евгения +print('Hello') +h=input('Your name=') +import os +os.chdir('C:\\Users\\filip\\Desktop\\python-labs\\TEMA1\\') diff --git a/TEMA1/clock.png b/TEMA1/clock.png new file mode 100644 index 0000000..4259a23 Binary files /dev/null and b/TEMA1/clock.png differ diff --git a/TEMA1/color.png b/TEMA1/color.png new file mode 100644 index 0000000..c124c2c Binary files /dev/null and b/TEMA1/color.png differ diff --git a/TEMA1/compiler.png b/TEMA1/compiler.png new file mode 100644 index 0000000..dd816cc Binary files /dev/null and b/TEMA1/compiler.png differ diff --git a/TEMA1/font.png b/TEMA1/font.png new file mode 100644 index 0000000..e045bbc Binary files /dev/null and b/TEMA1/font.png differ diff --git a/TEMA1/help.png b/TEMA1/help.png new file mode 100644 index 0000000..491c311 Binary files /dev/null and b/TEMA1/help.png differ diff --git a/TEMA1/image.png b/TEMA1/image.png new file mode 100644 index 0000000..491c311 Binary files /dev/null and b/TEMA1/image.png differ diff --git a/TEMA1/index.png b/TEMA1/index.png new file mode 100644 index 0000000..5b242e1 Binary files /dev/null and b/TEMA1/index.png differ diff --git a/TEMA1/interpretator.png b/TEMA1/interpretator.png new file mode 100644 index 0000000..6a307b0 Binary files /dev/null and b/TEMA1/interpretator.png differ diff --git a/TEMA1/pr0.png b/TEMA1/pr0.png new file mode 100644 index 0000000..11559d9 Binary files /dev/null and b/TEMA1/pr0.png differ diff --git a/TEMA1/protokol.txt b/TEMA1/protokol.txt new file mode 100644 index 0000000..046bab4 --- /dev/null +++ b/TEMA1/protokol.txt @@ -0,0 +1,60 @@ +#Протокол по Теме 1 Филиппова Евгения Игоревна +import os +os.chdir('C:\\Users\\filip\\Desktop\\python-labs\\TEMA1\\') + +=========== RESTART: C:/Users/filip/Desktop/python-labs/TEMA1/Pr0.py =========== +Hello +Your name=zhenya +import Pr0 +Hello +Your name=zhenya + +=========== RESTART: C:\Users\filip\Desktop\python-labs\TEMA1\Pr0.py =========== +Hello +Your name=zhenya +import prb1 +Как Вас зовут? Женя +Привет, Женя + +help(print) +Help on built-in function print in module builtins: + +print(*args, sep=' ', end='\n', file=None, flush=False) + Prints the values to a stream, or to sys.stdout by default. + + sep + string inserted between values, default a space. + end + string appended after the last value, default a newline. + file + a file-like object (stream); defaults to the current sys.stdout. + flush + whether to forcibly flush the stream. + +help(print); help(input) +Help on built-in function print in module builtins: + +print(*args, sep=' ', end='\n', file=None, flush=False) + Prints the values to a stream, or to sys.stdout by default. + + sep + string inserted between values, default a space. + end + string appended after the last value, default a newline. + file + a file-like object (stream); defaults to the current sys.stdout. + flush + whether to forcibly flush the stream. + +Help on built-in function input in module builtins: + +input(prompt='', /) + Read a string from standard input. The trailing newline is stripped. + + The prompt string, if given, is printed to standard output without a + trailing newline before reading input. + + If the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError. + On *nix systems, readline is used if available. + +import tdemo_chaos diff --git a/TEMA1/report.md b/TEMA1/report.md new file mode 100644 index 0000000..5a75bc3 --- /dev/null +++ b/TEMA1/report.md @@ -0,0 +1,153 @@ +# Отчет по теме 1 + +Филиппова Евгения, А-01-23 + +## 1. Изучение среды IDLE + +## 1.1 Знакомство с интерпретатором + +Запущена программа-интерпретатор: + +![](interpretator.png) + +Ознакомилась с содержанием диалогового окна. + +После символов приглашения к диалогу были введены несколько инструкций: + +```py +>>> print('Hello') +Hello +>>> h=input('Your name=') +Your name=zhenya + +exit() - закрывает программу-интерпретатор +``` +## 1.2 Запуск интерактивной графической оболочки IDLE + +Изучение устройства главного командного окна среды + +![](IDLE.png) + +Настройка рабочего каталога среды: + +```py +import os +os.chdir('C:\\Users\\filip\\Desktop\\python-labs\\TEMA1\\') +``` +## 1.3 Визуальные настройки среды + +Установлен шрифт типа Arial CYR, размер 11: + +![](font.png) + +Размер начального окна - высота 50 символов, ширина 100 символов: + +![](window_size.png) + +Подкраска комментариев - коричневая: + +![](color.png) + +## 1.4 Создание и запуск файла Pr0.py + С помощью File/New File открыла окно текстового редактора оболочки IDLE. + Ввела комментарий и ранее использованные инстукции: + ![](pr0.png) + Сохранила программный файл Pr0.py в рабочем каталоге. + Запустила на выполнение с помощью Run module: + ``` +=========== RESTART: C:/Users/filip/Desktop/python-labs/TEMA1/Pr0.py =========== +Hello +Your name=zhenya +``` +Рассмотрим другой способ запуска программы на выполнение: +``` +import Pr0 +Hello +Your name=zhenya +``` +Третий способ запуска - с помощью клавиши F5. +Результат аналогичный 1-му. + +## 1.5 Запуск prb1.py +Поставив курсор на строку +```py +import Pr0 +``` +и нажав Enter получаем повтор строки. Редактируем её, заменив имя Pr0 на prb1. +Получаем: +```py +import prb1 +``` +и с помощью Enter запускаем программу. + +## 1.6 Продукты комплиляции +Используя в меню текстового редактора "Открыть",выбираем каталог_pycache_. Попытка открыть файл Pr0.cpython-34.pyc - результат работы компилятора среды. + +![](compiler.png) + +.pyc - это не текстовые файлы. Они содержат скомпилированный байт-код, а не читаемый текст. Так как IDLE это текстовый редактор, он не может правильно интерпретировать содержимое .pyc файла как текст. + +Компиляция программ производится, чтобы компьютер мог понять и выполнить инструкции, написанные программистом. Это необходимо, так как компьютер не понимает язык программирования высокого уровня (например, C++, Java, Python) напрямую. + +## 1.7 Изучение раздела help +Предлагаемые виды помощи: + +![](help.png) + +Обращение к оперативной помощи по функции print(): +```py +help(print) +Help on built-in function print in module builtins: + +print(*args, sep=' ', end='\n', file=None, flush=False) + Prints the values to a stream, or to sys.stdout by default. + + sep + string inserted between values, default a space. + end + string appended after the last value, default a newline. + file + a file-like object (stream); defaults to the current sys.stdout. + flush + whether to forcibly flush the stream. +``` +В одной строке можно ввести несколько инструкций, разделяя их точками с запятой: +```py +help(print); help(input) +Help on built-in function print in module builtins: + +print(*args, sep=' ', end='\n', file=None, flush=False) + Prints the values to a stream, or to sys.stdout by default. + + sep + string inserted between values, default a space. + end + string appended after the last value, default a newline. + file + a file-like object (stream); defaults to the current sys.stdout. + flush + whether to forcibly flush the stream. + +Help on built-in function input in module builtins: + +input(prompt='', /) + Read a string from standard input. The trailing newline is stripped. + + The prompt string, if given, is printed to standard output without a + trailing newline before reading input. + + If the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError. + On *nix systems, readline is used if available. +``` +Существует другой вариант обращения к оперативной помощи - нажатие на F1. Открывается окно справочной под системы и упорядоченный по алфавиту список терминов языка Python: +![](index.png) +При помощи Help - Python Docs появляется то же диалоговое окно. +## 1.8 Освоение предложения "Window" +![](window.png) +При помощи этого окна можно переходить между открытыми файлами. +## 1.9 Графические программы +Запуск на выполнение программы из файла tdemo_chaos.py: +![](tdemo.jpg) +## 1.10 Рассмотрение примеров использования графической составляющей среды Python +![](clock.png) +## 1.11 Работа со средой завершена \ No newline at end of file diff --git a/TEMA1/tdemo.jpg b/TEMA1/tdemo.jpg new file mode 100644 index 0000000..99b87a3 Binary files /dev/null and b/TEMA1/tdemo.jpg differ diff --git a/TEMA1/window.png b/TEMA1/window.png new file mode 100644 index 0000000..a1316f6 Binary files /dev/null and b/TEMA1/window.png differ diff --git a/TEMA1/window_size.png b/TEMA1/window_size.png new file mode 100644 index 0000000..cc22442 Binary files /dev/null and b/TEMA1/window_size.png differ