A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
require 'rubygems' | |
require 'mechanize' | |
def comment_douban_topic(url,text) | |
login_url = "http://www.douban.com/login" | |
agent = Mechanize.new | |
# agent.set_proxy("218.201.21.176","80") | |
agent.user_agent_alias = "Googlebot" | |
page = agent.get(login_url) | |
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
# mainly for sql query | |
filename = 'test.txt' | |
with open(filename,'r') as fp: | |
l = fp.readlines() |
These character sets are not exhaustive, but merely a quick reference for common characters. | |
Quotation | |
‘ ‘ \2018 Open single quotation mark | |
’ ’ \2019 Closed single quotation mark / Apostrophe | |
“ “ \201C Open double quotation mark | |
” ” \201D Closed double quotation mark | |
' ' \0027 Typewriter single quotation mark | |
" " \0022 Typewriter double quotation mark | |
′ ′ \2032 Prime (Feet / Minutes) |
void setup() | |
{ | |
String s = "12"; | |
int i = parseInt(s); | |
println(s+1); | |
println(i+1); | |
} |
int i; | |
void setup(){ | |
Serial.begin(9600); | |
} | |
void loop(){ | |
i++; | |
Serial.write(150 + i); | |
delay(1000); | |
} |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import logging | |
import requests | |
''' | |
A module for helping you to finish the daily task on Neteasy Music | |
''' |
string = '12345' | |
L = [] | |
for i in string: | |
i += ' ' | |
L.append(i) | |
string = ''.join(L) | |
#重写一下,这样更短也更快 | |
string = '12345' | |
L = [i + ' ' for i in string] |