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
写一个 *.bat | |
名字你随意, 比如aaa.bat | |
里面写上: | |
@echo off | |
cmd.exe | |
双击这个bat. 就可以进入当前目录的命令行. |
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 os | |
import sys | |
path = os.path.join(os.path.dirname(sys.argv[0]), 'index.html') | |
print path |
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
file_path = r'D:\Everything\Everything.exe' | |
l = str(file_path).split('.') | |
extension = l[len(l)-1] | |
print (extension) | |
# exe |
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
out = open('a.txt', 'w') | |
print('Hello Earth!', file=out) | |
out.close() | |
# 在 Python3.3.0 能成功运行 | |
# 2.7不行 | |
# 这会创建一个叫做a.txt的文件, 内容是'Hello Earth!', 屏幕上并不会有任何输出 |
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 sys | |
if len(sys.argv) > 2: | |
for x in sys.argv[1:]: | |
print (x) | |
input() |
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
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import pysubs | |
try: | |
print (sys.argv[1]) | |
print() | |
file_full_path = sys.argv[1] | |
except: |
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
#include <fstream> | |
#include <iostream> | |
using namespace std; | |
int main(){ | |
cout << "hahahahahahahah" << endl; | |
ofstream fout("output.txt"); | |
fout << "nice" << endl; | |
fout << "good" << endl; |
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
#include <fstream> | |
#include <iostream> | |
#include <string> | |
// read some file for pratice | |
using namespace std; | |
int main(){ | |
ifstream fin("read.txt"); |
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
var e = document.getElementById('<input type=date>'); | |
set_today(e); | |
function set_today(inputElement){ | |
// document: | |
// var recommend_date = document.getElementById('<input type='date'> id'); | |
// set_today(recommend_date); | |
var dateobj = new Date(); | |
var year = dateobj.getFullYear(); | |
var month = dateobj.getMonth() + 1; |
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
function addURLParameter(paramName, paramValue, URL){ | |
var url_list = URL.split('?'); | |
var haveParameter = false; | |
// if there no parameter, return false; | |
if(url_list[1]){ | |
haveParameter = true; | |
} |
OlderNewer