Mostly geared towards GNU make
I've used ->| to indicate a tab character, as it's clearer to read than ⇥
- Set a target, its dependencies and the commands to execute in order
target: [dependencies]
->|
| import atexit | |
| import ctypes | |
| import os | |
| import shlex | |
| import sys | |
| import tempfile | |
| CMD_C_TO_SO = '{compiler} -shared -o {output} {input} {libraries}' |
| #!/usr/bin/env python | |
| # -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- | |
| # vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4 | |
| """User Access Control for Microsoft Windows Vista and higher. This is | |
| only for the Windows platform. | |
| This will relaunch either the current script - with all the same command | |
| line parameters - or else you can provide a different script/program to | |
| run. If the current user doesn't normally have admin rights, he'll be |
| from __future__ import print_function | |
| try: | |
| import msvcrt | |
| def key_pressed(): | |
| return msvcrt.kbhit() | |
| def read_key(): | |
| key = msvcrt.getch() |
追記(2017.06.03)
WinPDBのフォークがPython3サポートしてました。こっちを使いましょう。
https://github.com/bluebird75/winpdb
次のように対象プログラムを実行するインタプリタを指定できます。
python -m winpdb -i python3 my_program.py
| """An atomic, thread-safe incrementing counter.""" | |
| import threading | |
| class AtomicCounter: | |
| """An atomic, thread-safe incrementing counter. | |
| >>> counter = AtomicCounter() | |
| >>> counter.increment() |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Git post-commit hook to keep master and gh-pages branch in sync :
In your Git repository create a file .git/hooks/post-commit and fill it with this:
#!/bin/sh
git checkout gh-pages
git rebase master
git checkout master