Пример #1
0
import my_module

selected = my_module.random_rsp()
print(selected)
print('가위', my_module.SCISSOR == selected)
Пример #2
0
    import urllib.request  # 인터넷의 내용을 가져오는 기능
    response = urllib.request.urlopen(url)
    data = response.read()
    decoded = data.decode('utf-8')
    return decoded


# url = input('웹 페이지주소?')
# content = get_web(url)
# print(content)

# module 만들기
import my_module  # 내가 새롭게 만든 module이다.
print()
print()
print(my_module.random_rsp())

# 오늘 날짜 받아오기
import datetime
print(datetime.datetime.today())  # 오늘 날짜를 받아오는 함수이다.
now = datetime.datetime.now()
print(now.year, now.month, now.day)

# 딕셔너리 만들기 dictionary
wintable = {
    '가위': '보',  #   이름표:값
    '바위': '가위',
    '보': '바위',
    3: 'Tell me'
}