Programming/python36 [vscode] 외부 모듈을 debug하고 싶을때 break을 찍어도 내가 짠 코드가 아닌 외부 코드는 break걸리지 않는다. launch.json 설정을 "program": "${file}", "console": "integratedTerminal", "justMyCode": false justMyCode을 False로 해주면 debug 할 수 있다. 2021. 11. 23. [python] dataframe 의 column 순서변경 cols = df.columns.tolist() tmp = cols[10] #11번째 column을 del cols[10] cols.insert(1,tmp) #2번째 위치로 df = df[cols] 2020. 2. 13. python 주석 python 주석(comment)을 만드는 키워드는 # 하나 뿐이다. 여태껏 1줄은 # 이고 여러줄은 """ ... ... """ 인줄 알았는데, """은 multi-line string 을 나타내는 키워드이다. 변수 지정 없이 string을 code내에 삽입해도 에러가 안나니 """ 을 주석 처럼 썻던것뿐 그래서, def test(ss): print(ss) #test #test print(ss) 이 코드는 두번째 print도 에러 안나지만 def test(ss): print(ss) """test test""" print(ss) 이 코드는 두번째 print에서 indent에러가 난다. 여러줄 주석처리는 각종 IDE에서 블럭처리 해 놓고 ctrl+/ 으로 on/off 할수 있다. 2020. 1. 17. python, 같은 라인에 print문 update하기 from time import sleep for i in range(100): sleep(0.05) print( str(i) + '/100 percent processed..',end='\r', flush=True) python 3.3이상에서. 2019. 11. 19. 이전 1 2 3 4 5 ··· 9 다음