Python - self learning

Python
##case sensitive
## python IDLE ## using for program writing -- python shell
เป็นตัวหน้าต่างที่สามารถรันคอมมานได้ แต่ว่าจะเขียนได้แค่ command line ได้แค่บรรทัดเดียว
The command can be saved
## แต่ถ้าเป็นหน้าที่เขียน command line หลายๆ บรรทัด จะต้อง ctrl+N เพื่อไปหน้า command line
writing จะเขียนได้หลายบรรทัด -- จากนั้น go->run->run module

#use for commenting the quote
''' -- not running the command in the triple quote
example
'''
print('hello world')
print('hello world')
print('hello world')
'''

## python ## command prompt window

Variable (ตัวแปร) -- สิ่งที่เราต้องการจะใส่เข้าไป
>>> name ='coffee' ##การกำหนดค่าตัวแปร
>>> surname ='maker'
>>> print(name,surname) ##เป็นการโชว์ผลของค่าตัวแปร
coffee maker
>>> fullname = name + surname
>>> print(fullname)
coffeemaker
>>> fullname = name + ' ' + surname
>>> print(fullname)
coffee maker

##install the package through command line --  when installing ->c:\pythonXX
using -- pip
example pip install pyautogui

##How to import package
>>> import uncleengineer
##put the name of package and what in the package
>>> uncleengineer.thaistock('KTC')

Code:
https://github.com/tlerksuthirat/Python-learning

Learning source --
Ref: เรียน Python ฟรี! ฉบับคนไม่เคยเขียนโปรแกรมมาก่อน
##ลุงวิศวกร สอนคำนวณ

Comments

Popular posts from this blog

Useful links (updated: 2024-04-26)

Genome editing technology short note

SUSA Thailand - Sustainable University? (update 2023-06-23)