[English] Up, over, through, etc.

to / from

  • Tracy is going to Hawaii next week.
  • We walked from the hotel to the restaurant.
  • A lot of English words come from Latin.

into (in) / out of

  • We jumped into the water.
  • A man came out of the house and got into a car.
  • Why are you looking out of the window?
  • I took the old batteries out of the radio.

put something에는 (보통 into가 아니고) in …을 쓴다. We say put something in … (not usually into).

  • I put new batteries in the radio.

on / off

  • Don’t put your feet on the table.
  • Please take your feet off the table.
  • I’m going to hang some pictures on the wall.
  • Be careful! Don’t fall off your bicycle.
  • We got on the bus downtown.

up / down

  • We walked up the hill to the house.
  • Be careful! Don’t fall down the stairs.

over / under

  • The plane flew over the mountains.
  • I climbed over the wall into the yard.
  • Some people say it is unlucky to walk under a ladder.

through / around

  • A bird flew into the room through a window.
  • The old highway goes through the city.
  • The new highway goes around the city.
  • The bus stop is just around the corner.
  • I walked around the town and took some pictures.

along / across

  • I was walking along the street with my dog.
  • Let’s go for a walk along the river.
  • The dog swam across the river.

past

  • They walked past me without speaking.
  • A: Excuse me, how do I get to the hospital?
    B: Go along this street, past the movie theater, under the bridge, and the hospital is on the left.

Python import 경로추가, 주석, 함수선언, Dictionary, List, Tuple

파이썬 문서고

Dive into Python

wxPython Tutorial(http://zetcode.com/wxpython/)
구글의 파이썬 튜토리얼 번역

import 경로 추가

import sys;
sys.path.append(‘/mypath’)

주석(문서화에 사용)

“”” 여

줄 주석 “””

함수 선언

def functionname(parameter):
    body

Dictionary : {, } 사용, 순서라는 개념 없음

dic = { <key1>:<value1>, <key2>:<value2> }

Dictionary Data 제거

del dic[<key>]

Dictionary의 모든 element 삭제

dic.clear()

List : [, ] 사용, 인덱스 사용. Element가 중복 존재 가능

li = [ <element1>, <element2> ]

음수 인덱스 사용가능. -1이 가장 끝

li[-1]

List slice

li[1:3] 1, 2번째 인덱스의 원소의 리스트를 새로 생성
li[:] 리스트의 복사본 생성

List 원소 추가

li.append(<element>)
li.insert(<index>, <element>)
li.extend(<list>)

List 검색
list 내의 가장 첫번째 원소의 index

li.index(<element>)

list 에 있는지 검사

<element> in li

List 에서 원소 제거

li.remove(<element>)

가장 마지막 원소 제거하면서 리턴

li.pop()

+ 연산자 : 새로운 리스트를 리턴(extend는 변경)

li = <list1> + <list2>

+= 연산자는 extend와 동일

li += <list>

* 는 반복자로 작동

li = <list> * 3

Tuple : (, ) 사용. 변경 불가능, append, extend, remove, pop, index는 없음, in 으로 검사는 가능, 리스트보다 빠름

tup = ( <element1>, <element2> )