-
정규 표현식 질문 하나 드릴게요. 이거 의외로 간단한거 같은데 잘 안되네요.
-
여기에서 제일 앞에 http://naver.com/path/ab1.html 이것만 가져올 수 있는 방법이 없을까요?
- http://www.yes24.com/24/goods/63503495?scode=032&OzSrank=1: 장고 기초책
- http://www.yes24.com/24/goods/29331035?scode=032&OzSrank=3: 장고 실전책
- https://www.askcompany.kr/: 무료 강의 있으니까 일단 이걸로 보는 것도 좋음
- 동영상 강의가 꽤 좋음. 강사님 말씀은 약간 새는 편이긴 한데. 책에서는 나오지 않는 세세한 코드도 보여주고 많은 활용방법들을 보여줘서 괜찮음.
- 여기 있는 전부를 2~3번 정도 따라하면 기초가 어느 정도 쌓이기 때문에 괜찮음. 이 정도만 되면 ok.
- http://www.yes24.com/24/goods/30355215?scode=032&OzSrank=2: 장고의 Best Practice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .models import Url | |
def get_columns(line): | |
column_str = re.search(r'COPY [-_\w\.]+ \(([^\)]+)\)', line).group(1) | |
columns = column_str.split(',') | |
return [column.strip() for column in columns] | |
def is_start(text): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .models import Url | |
def get_columns(line): | |
column_str = re.search(r'COPY [-_\w\.]+ \(([^\)]+)\)', line).group(1) | |
columns = column_str.split(',') | |
return [column.strip() for column in columns] | |
def is_start(text): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import docx | |
from docx.document import Document | |
from docx.oxml.table import CT_Tbl | |
from docx.oxml.text.paragraph import CT_P | |
from docx.table import _Cell, Table | |
from docx.text.paragraph import Paragraph | |
os.chdir('C:\\OJT_Kevin\\161027_docx_parsing') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
driver = webdriver.Firefox() | |
driver.get('https://www.facebook.com/') | |
with open('jquery-1.9.1.min.js', 'r') as jquery_js: | |
jquery = jquery_js.read() #read the jquery from a file | |
driver.execute_script(jquery) #active the jquery lib | |
driver.execute_script("$('#email').text('anhld')") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sort a list of dictionary objects by a key - case sensitive | |
from operator import itemgetter | |
mylist = sorted(mylist, key=itemgetter('name')) | |
# Sort a list of dictionary objects by a key - case insensitive | |
mylist = sorted(mylist, key=lambda k: k['name'].lower()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dump_func_name(func): | |
def echo_func(*func_args, **func_kwargs): | |
print('') | |
print('Start func: {}'.format(func.__name__)) | |
return func(*func_args, **func_kwargs) | |
return echo_func | |
class ClassName(object): | |
@dump_func_name |
NewerOlder