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
# Import smtplib for the actual sending function | |
import smtplib | |
# Import the email modules we'll need | |
from email.mime.text import MIMEText | |
# Open a plain text file for reading. For this example, assume that | |
# the text file contains only ASCII characters. | |
fp = open(textfile, 'rb') | |
# Create a text/plain message |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1" /> | |
<script src="tetris.js"></script> | |
<script src="tetris-svg.js"></script> | |
</head> | |
<body> | |
<div><svg id="stage"></svg></div> |
import smtplib | |
sendto = ['xxx@xxx.com', 'yyy@yyy.com', 'zzz@zzz.com'] #收件人 | |
no = [1,2,3] #编号 | |
gmail_username = 'youremail@gmail.com' | |
gmail_password = 'password' | |
smtpserver = smtplib.SMTP("smtp.gmail.com", 587) | |
smtpserver.ehlo() |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
define('EXT', '.php'); | |
class MY_Router extends CI_Router { | |
var $error_controller = 'error'; | |
var $error_method_404 = 'error_404'; | |
function __construct() | |
{ | |
parent::__construct(); |
#A sample script using the ETE package to detect shift in internal nodes where a significant change in enrichment values (could be anything) happens | |
#An example (using the scipy python module to perform a K-S test): | |
from scipy import stats | |
from ete2 import Tree | |
newick = "((((A, B)edge1, C)edge2, ((D, E)edge3, F)edge4)edge5, (((G, H)edge6, I)edge7, ((J, K)edge8, L)edge9)edge10)RootEdge;" |
Sequence data input: | |
A common input file format is bed file. In the simplest form, it has the format | |
chromosome -tab- startposition -tab- endposition | |
where each line corresponds to one sequence read | |
However this format can also include strand information: | |
chromosome -tab- startposition -tab- endposition -tab- name -tab- score -tab- +/- | |
for example: | |
chr13 54005048 54005081 . 1 - | |
The score field is ignored. | |
Files are allowed by have an optional first line starting with "track", this line is then ignored |
#!/bin/bash | |
# This script is modified from the one found here: https://wiki.archlinux.org/index.php/IPv6_-_Tunnel_Broker_Setup | |
# Noticably this script now runs like this: | |
# $0 <start|stop> <device name> | |
# | |
# So if you want IPv6 traffic to be routed through wlan0, you would do: | |
# $0 start wlan0 | |
if [ "$EUID" -ne 0 ]; then |