This file contains 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
#!/usr/bin/python | |
# -*- coding:utf8 -*- | |
import chardet | |
import sys, os | |
import shutil | |
from mutagen.mp3 import MP3 | |
import mutagen.id3 | |
from mutagen.id3 import ID3 | |
from mutagen.easyid3 import EasyID3 |
This file contains 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
In [33]: os.listdir('.') | |
Out[33]: | |
['.DS_Store', | |
'Closer - Travis.mp3', | |
'I Really Like You - Carly Rae Jepsen.mp3', | |
'Love Story - Taylor Swift.mp3', | |
'Per dimenticare - Zero Assoluto.mp3', | |
"Sono Bugiarda (I'm A Believer) - Caterina Caselli.mp3", | |
'The Phoenix - Fall Out Boy.mp3', | |
'We Are Never Ever Getting Back Together - Taylor Swift.mp3', |
This file contains 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
Feb 21, 2017 11:50:34 PM hudson.remoting.jnlp.Main createEngine | |
INFO: Setting up slave: ci1-mirror | |
Feb 21, 2017 11:50:34 PM hudson.remoting.jnlp.Main$CuiListener <init> | |
INFO: Jenkins agent is running in headless mode. | |
Feb 21, 2017 11:50:34 PM hudson.remoting.jnlp.Main$CuiListener status | |
INFO: Locating server among [http://ci0.aws.dev:8080/] | |
Feb 21, 2017 11:50:34 PM hudson.remoting.jnlp.Main$CuiListener status | |
INFO: Handshaking | |
Feb 21, 2017 11:50:34 PM hudson.remoting.jnlp.Main$CuiListener status | |
INFO: Connecting to ci0.aws.dev:36840 |
This file contains 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
""" | |
there are three typical ways to define a model in python. | |
""" | |
# --------------------------------------------------- | |
# use namedtuple: simple but not flexible or powerful | |
# --------------------------------------------------- | |
from collections import namedtuple |
This file contains 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
# server made with asyncio | |
# flake8: noqa | |
import asyncio | |
from socket import (socket, AF_INET, SOCK_STREAM, SO_REUSEADDR, SOL_SOCKET) | |
async def start_server(sock): | |
server = await loop.create_server(asyncio.Protocol, sock=sock) |
This file contains 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 random | |
from graphviz import Digraph | |
# Definition for a binary tree node. | |
class TreeNode(object): | |
def __init__(self, x): | |
self.val = x | |
self.left = None |
This file contains 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
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<!-- <dir>~/.fonts</dir> --> | |
<alias> | |
<family>serif</family> | |
<prefer> | |
<family>Noto Serif CJK SC</family> | |
<family>Noto Color Emoji</family> | |
</prefer> | |
</alias> |
This file contains 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
""" | |
使用方法 | |
- pip3 install flask # 安装依赖 | |
- python3 remote_control.py # 启动网页,在浏览器 | |
""" | |
import socket | |
from flask import Flask, request |
This file contains 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
server { | |
listen 80; | |
server_name cosven.me www.cosven.me; | |
# path for static files | |
location /static/ { | |
root /data/static; | |
} |
OlderNewer