diff --git a/TEMA1/Pr0.py b/TEMA1/Pr0.py new file mode 100644 index 0000000..a14a1f9 --- /dev/null +++ b/TEMA1/Pr0.py @@ -0,0 +1,6 @@ +#Программа по Теме 1 Кузьменко Елена Алексеевна +print('Hello') +h=input('Your name=') +import os +os.chdir(r"C:\Users\u522-15\Desktop\python-labs\TEMA1") +os.getcwd() diff --git a/TEMA1/Pr100.py b/TEMA1/Pr100.py new file mode 100644 index 0000000..f475fc5 --- /dev/null +++ b/TEMA1/Pr100.py @@ -0,0 +1,33 @@ +# Протокол по Теме 1 Кузьменко Елена Алексеевна + +Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32 +Type "help", "copyright", "credits" or "license()" for more information. +import os +os.chdir('C:\Users\u522-15\Desktop\python-labs\TEMA1') +SyntaxError: incomplete input +os.chdir(r"C:\Users\u522-15\Desktop\python-labs\TEMA1") + + + +os.chdir(r"C:\Users\u522-15\Desktop\python-labs\TEMA1") +os.getcwd() +'C:\\Users\\u522-15\\Desktop\\python-labs\\TEMA1' +import os +os.chdir(r"C:\Users\u522-15\Desktop\python-labs\TEMA1") +os.getcwd() +'C:\\Users\\u522-15\\Desktop\\python-labs\\TEMA1' +# test + +========== RESTART: C:/Users/u522-15/Desktop/python-labs/TEMA1/p 10.py ========= +Hello +Your name=Lena +import Pr0 +Hello +Your name=Lena + +========== RESTART: C:/Users/u522-15/Desktop/python-labs/TEMA1/Pr0.py ========== +Hello +Your name=Lena +import prb1 +Как Вас зовут? Лена +Привет, Лена diff --git a/TEMA1/p 10 1.png b/TEMA1/p 10 1.png new file mode 100644 index 0000000..5686e52 Binary files /dev/null and b/TEMA1/p 10 1.png differ diff --git a/TEMA1/p 10.png b/TEMA1/p 10.png new file mode 100644 index 0000000..d72e42c Binary files /dev/null and b/TEMA1/p 10.png differ diff --git a/TEMA1/p 10.py b/TEMA1/p 10.py new file mode 100644 index 0000000..a14a1f9 --- /dev/null +++ b/TEMA1/p 10.py @@ -0,0 +1,6 @@ +#Программа по Теме 1 Кузьменко Елена Алексеевна +print('Hello') +h=input('Your name=') +import os +os.chdir(r"C:\Users\u522-15\Desktop\python-labs\TEMA1") +os.getcwd() diff --git a/TEMA1/p 12.png b/TEMA1/p 12.png new file mode 100644 index 0000000..4879cef Binary files /dev/null and b/TEMA1/p 12.png differ diff --git a/TEMA1/p 13.png b/TEMA1/p 13.png new file mode 100644 index 0000000..f61554c Binary files /dev/null and b/TEMA1/p 13.png differ diff --git a/TEMA1/p 14 1.png b/TEMA1/p 14 1.png new file mode 100644 index 0000000..f8b61d2 Binary files /dev/null and b/TEMA1/p 14 1.png differ diff --git a/TEMA1/p 14 2.png b/TEMA1/p 14 2.png new file mode 100644 index 0000000..fbbabf0 Binary files /dev/null and b/TEMA1/p 14 2.png differ diff --git a/TEMA1/p 14 3.png b/TEMA1/p 14 3.png new file mode 100644 index 0000000..7ae5609 Binary files /dev/null and b/TEMA1/p 14 3.png differ diff --git a/TEMA1/p 14.png b/TEMA1/p 14.png new file mode 100644 index 0000000..2b3f0dd Binary files /dev/null and b/TEMA1/p 14.png differ diff --git a/TEMA1/p 15 1.png b/TEMA1/p 15 1.png new file mode 100644 index 0000000..2463b23 Binary files /dev/null and b/TEMA1/p 15 1.png differ diff --git a/TEMA1/p 15 2.png b/TEMA1/p 15 2.png new file mode 100644 index 0000000..f020b56 Binary files /dev/null and b/TEMA1/p 15 2.png differ diff --git a/TEMA1/p 15 3.png b/TEMA1/p 15 3.png new file mode 100644 index 0000000..95c1f7e Binary files /dev/null and b/TEMA1/p 15 3.png differ diff --git a/TEMA1/p 15 4.png b/TEMA1/p 15 4.png new file mode 100644 index 0000000..1b2b5bc Binary files /dev/null and b/TEMA1/p 15 4.png differ diff --git a/TEMA1/p 15 5.png b/TEMA1/p 15 5.png new file mode 100644 index 0000000..1123823 Binary files /dev/null and b/TEMA1/p 15 5.png differ diff --git a/TEMA1/p 15.png b/TEMA1/p 15.png new file mode 100644 index 0000000..a101805 Binary files /dev/null and b/TEMA1/p 15.png differ diff --git a/TEMA1/p1.png b/TEMA1/p1.png new file mode 100644 index 0000000..1f6244b Binary files /dev/null and b/TEMA1/p1.png differ diff --git a/TEMA1/p2.png b/TEMA1/p2.png new file mode 100644 index 0000000..6d37590 Binary files /dev/null and b/TEMA1/p2.png differ diff --git a/TEMA1/p3.png b/TEMA1/p3.png new file mode 100644 index 0000000..49a8fff Binary files /dev/null and b/TEMA1/p3.png differ diff --git a/TEMA1/p9 2.png b/TEMA1/p9 2.png new file mode 100644 index 0000000..77133fc Binary files /dev/null and b/TEMA1/p9 2.png differ diff --git a/TEMA1/p9 3.png b/TEMA1/p9 3.png new file mode 100644 index 0000000..8dac7c6 Binary files /dev/null and b/TEMA1/p9 3.png differ diff --git a/TEMA1/p9 4.png b/TEMA1/p9 4.png new file mode 100644 index 0000000..c3fdd2c Binary files /dev/null and b/TEMA1/p9 4.png differ diff --git a/TEMA1/p9.png b/TEMA1/p9.png new file mode 100644 index 0000000..3ff94c5 Binary files /dev/null and b/TEMA1/p9.png differ diff --git a/TEMA1/report.md b/TEMA1/report.md index e69de29..cf92249 100644 --- a/TEMA1/report.md +++ b/TEMA1/report.md @@ -0,0 +1,239 @@ +# Отчёт по Теме 1 + +Кузьменко Елена, А-02-23 + +## 1 пункт + +С сервера git склонировали папку "python-labs", в которой находится папка TEMA1 для дальнейшей работы + +![](p1.png) + +## 2 пункт + +Открыта для выполнения ЛР1 программа-интерпетатор. + +![](p2.png) + +## 3 пункт + +В диалогов окне введём инструкцию print('Hello'). Получим соответствующей текст: + +```py +>>> print('Hello') +Hello +``` + +## 4 пункт + +Воспользуемся ещё одной командой-инструкцией. После введения команды на следующей строчке можно написать имя. + +```py +>>> h=input('Your name=') +Your name=Lena +``` + +## 5 пункт + +С помощью следующей команды завершим работу в консоли: + +```py +exit() +``` + +После введённой команды можно заметить, что диалоговое окно закрылось. + +## 6 пункт + +Работу с интерактивной графической оболочкой IDLE. Запустим: + +![](p3.png) + +## 7-8 пункты + +Было изучено главное командное окно среды. + +Следующей инструкцией зададим рабочий каталог: + +```py +>>>import os +>>>os.chdir(r"C:\Users\u522-15\Desktop\python-labs\TEMA1") +>>>os.getcwd() +'C:\\Users\\u522-15\\Desktop\\python-labs\\TEMA1' +``` + +## 9 пункт + +С помощью настройки диалового окна поменяем оформление, а именно шрифт, размер окна и "цвет комментария" + +![](p9.png) + +![](p9 2.png) + +![](p9 3.png) + +После применения изменений в командной строке можно заметить изменения: + +![](p9 4.png) + +## 10 пункт + +Откроем окно текстового редактора: + +![](p10.png) + +Тут же попробуем записать те же команды, которые мы упоминали в предыдущих пунктах: + +![](p10 1.png) + +Чтобы активировать выполнения нашего кода, необходимо прибегнуть к одному из способов: +1)Кнопка Run Modelu +2)Та же кнопка, но по горячей клавише F5 + +Это позволит за один запуск применить сразу все команды. Выполнение представлено в консоли: + +```py +========== RESTART: C:/Users/u522-15/Desktop/python-labs/TEMA1/p 10.py ========= +Hello +Your name=Lena +``` + +Можно также воспользоваться и другим способом. Для этого впишем название файла с нашим сохранённым кодом: + +```py +>>>import Pr0 +Hello +Your name=Lena +``` + +## 11 пункт + +С помощью команды import из текущего каталога откроем файл prb1.py + +```py +>>>import prb1 +Как Вас зовут? Лена +Привет, Лена +``` +Код представлял собой вопрос "Как Вас зовут?" + +В данном примере было изучено применения предыдущих команд путём их редактиварония + +## 12 пункт + +Попробуем в диалоговом окне открыть файл иного расширения, который представляет из себя результат работы компилятора. + +![](p12.png) + +Хаотичный набор символов, представленный на картинке, можно сочесть за ошибку, так как редактор открывает файл и ожидает текст, однако файл формата .pyc содержит двоичные данные(представляет из себя байт код), то есть каждый байт, который пытается прочитать машина превращаются в случайные символы. +Из чего можно сделать вывод, что файл.pyc уже скомпилированный байт-код(легче и эффективнее интепретировать), а не текст, который должен прочитать редактор IDLE. + + +## 13 пункт + +Все данные из командной строки были занесены в текстовый редактор. Файл используется как протокол. + +![](p13.png) + +## 14 пункт + +Изучение раздела помощи Help. Его вариации: + +1.В диалогово окне: + +![](p13.png) + +2.В командной строке введём инструкцию помощи по команде 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. +``` + +3)С помощью клавиши F1 можно перейти на следующий сайт: + +![](p14 1.png) + +Перейдя по ссылке Index перейдём в поисковик функций и найдём команду: print() (built-in function) + +![](p14 2.png) + +Здесь можно посмотреть справку: + +![](p14 3.png) + +В окне пункта 1) также можно открть сайт по кнопке Python Docs. + +## 15 пункт + +1.Открыли и прогнали файл prb1.py + +![](p15.png) + +2.По такому же принципу проверили файл Pr0.py + +![](p15 1.png) + +3.Запустим файл tdemo_chaos.py + +![](p15 2.png) + +Можно менять демонстрацию графического модуля, вот несколько вариантов: + +1)Clock + +![](p15 3.png) + +2)Tree + +![](p15 4.png) + +3)Peace + +![](p15 5.png) + +## 16 пункт + +Завершение работы со средой exit(). +