(Create a symlink pytest for py.test)
pytest [options] [file_or_dir] [file_or_dir] ...
Help:
| import asyncio | |
| import aiohttp | |
| import time | |
| async def gather_with_concurrency(n, *tasks): | |
| semaphore = asyncio.Semaphore(n) | |
| async def sem_task(task): | |
| async with semaphore: |
| # best practice: linux | |
| nano ~/.pgpass | |
| *:5432:*:username:password | |
| chmod 0600 ~/.pgpass | |
| # best practice: windows | |
| edit %APPDATA%\postgresql\pgpass.conf | |
| *:5432:*:username:password | |
| # linux |
| # Require PIL (Python Imaging Library) | |
| import traceback, Image | |
| def resize(): | |
| filePath = 'example.jpg' | |
| ratio = 0.5 | |
| image = Image.open(filePath) | |
| width = image.size[0] |
| # 10_basic.py | |
| # 15_make_soup.py | |
| # 20_search.py | |
| # 25_navigation.py | |
| # 30_edit.py | |
| # 40_encoding.py | |
| # 50_parse_only_part.py |
| def create_link(file_name, file_id): | |
| return f'http://localhost:port/{file_name}/{file_id}' | |
| def make_clickable(val): | |
| # target _blank to open new window | |
| return '<a target="_blank" href="{}">{}</a>'.format(val, val) | |
| data['link'] = data.apply(lambda x: create_link(str(x['file_path']), x['file_id']), axis=1) | |
| clickable_table = data.style.format({'link': make_clickable}) |