原文: http://blog.csdn.net/jclass/article/details/6144647

一. 打印并输出到文件

>>> print("aa","bb","  11 ","ddddd",sep='-',end='ok/t',file=open("c:/test.txt",'w'))  
>>> print("-" *40)#打印40个"-"
>>> print("aa","bb"," 11 ","ddddd",sep='-',end='ok/t',file=open("c:/test.txt",'w'))
>>> print("-" *40)#打印40个"-"

二. 打印字典的值

>>> d = {"a":1,"b":2}  
>>> print('%(a)s...%(b)s' %d)
1...2
>>> s = ('%(a)s...%(b)s' %d)
>>> s
'1...2'
>>> s = ['%(a)s...%(b)s' %d]
>>> s
['1...2']
>>> print("%(__builtins__)s...%(d)s" %vars())
<module 'builtins' (built-in)>...{'a': 1, 'b': 2}
>>> vars()
{'__builtins__': <module 'builtins' (built-in)>, '__name__': '__main__', '__doc__': None, 'd': {'a': 1, 'b': 2}, '__package__': None}
>>> locals()
{'__builtins__': <module 'builtins' (built-in)>, '__name__': '__main__', '__doc__': None, 'd': {'a': 1, 'b': 2}, '__package__': None}
>>> vars() is locals() #vars()无参数的情况等同locals()
True
>>> vars() == locals()
True
>>> a = vars()
>>> b = locals()
>>> a is b
True
>>> d = {"a":1,"b":2}
>>> print('%(a)s...%(b)s' %d)
1...2
>>> s = ('%(a)s...%(b)s' %d)
>>> s
'1...2'
>>> s = ['%(a)s...%(b)s' %d]
>>> s
['1...2']
>>> print("%(__builtins__)s...%(d)s" %vars())
<module 'builtins' (built-in)>...{'a': 1, 'b': 2}
>>> vars()
{'__builtins__': <module 'builtins' (built-in)>, '__name__': '__main__', '__doc__': None, 'd': {'a': 1, 'b': 2}, '__package__': None}
>>> locals()
{'__builtins__': <module 'builtins' (built-in)>, '__name__': '__main__', '__doc__': None, 'd': {'a': 1, 'b': 2}, '__package__': None}
>>> vars() is locals() #vars()无参数的情况等同locals()
True
>>> vars() == locals()
True
>>> a = vars()
>>> b = locals()
>>> a is b
True

三. pprint整洁打印

>>> import pprint  
>>> pprint.pprint(data)
('this is a string',
[1, 2, 3, 4],
('more tuples', 1.0, 2.3, 4.5),
'this is yet another string')
>>> print(data)
('this is a string', [1, 2, 3, 4], ('more tuples', 1.0, 2.3, 4.5), 'this is yet another string')
>>> pp = pprint.PrettyPrinter(indent=4) #缩进4空格
>>> pp.pprint(data)
( 'this is a string',
[1, 2, 3, 4],
('more tuples', 1.0, 2.3, 4.5),
'this is yet another string')
>>> import pprint
>>> pprint.pprint(data)
('this is a string',
[1, 2, 3, 4],
('more tuples', 1.0, 2.3, 4.5),
'this is yet another string')
>>> print(data)
('this is a string', [1, 2, 3, 4], ('more tuples', 1.0, 2.3, 4.5), 'this is yet another string')
>>> pp = pprint.PrettyPrinter(indent=4) #缩进4空格
>>> pp.pprint(data)
( 'this is a string',
[1, 2, 3, 4],
('more tuples', 1.0, 2.3, 4.5),
'this is yet another string')

四. 打印输出重定向

>>> import sys  
>>> sys.stdout = open('c:/log123.txt','w')
>>> print ("aa","bb","")
>>> sys.stdout = sys.__stdout__
>>> import sys
>>> sys.stdout = open('c:/log123.txt','w')
>>> print ("aa","bb","")
>>> sys.stdout = sys.__stdout__ >>> import sys
>>> t = sys.stdout
>>> sys.stdout = open("c:/log123.txt",'w')
>>> print('1234abcd')
>>> sys.stdout = t
>>> print("")
11
>>>
>>> import sys
>>> t = sys.stdout
>>> sys.stdout = open("c:/log123.txt",'w')
>>> print('1234abcd')
>>> sys.stdout = t
>>> print("")
11
>>>

五. with方式读取文件直到某行停止

读取文件,直到某一行的文本等于"STOP"停止读取。否则,将一直读取下去。
(注意:停止读取的行文本只能是iter()的第二个参数值,不能包含其他的,空格都不行)

with open("c:/test.txt") as fp:  
for line in iter(fp.readline,"STOP"):
print(line)
with open("c:/test.txt") as fp:
for line in iter(fp.readline,"STOP"):
print(line)

六. 搜索目录树中包含有某个字符串的文件名的所有文件列表

>>> import glob  
>>> import fileinput
>>> import os
>>> import re
>>> glob.glob("E:/cdr01")
['E:/cdr01']
>>> glob.glob("E:/cdr01/*")#只返回当前cdr01下面的子目录名和文件名(带路径,但不包含目录树中的所有子目录与文件)
['E:/cdr01//20110113', 'E:/cdr01//20110114', 'E:/cdr01//20110115', 'E:/cdr01//20110116', 'E:/cdr01//20110117', 'E:/cdr01//20110118', 'E:/cdr01//20110119', 'E:/cdr01//20110120', 'E:/cdr01//20110121', 'E:/cdr01//20110122', 'E:/cdr01//20110123', 'E:/cdr01//20110124', 'E:/cdr01//cdr01.rar']
>>> [(a,b,c) for a , b , c in os.walk("E:/cdr01")] #os.walk返回目录树中的所有目录与文件,他将每一目录的子目录与文件都按一个元组来返回。a代表当前搜索目录(或者子目录),b代表当前搜索目录下面所包含的子目录列表,c代表当前搜索目录下面的所有文件名列表。(不带路径(但可以通过与元组第一项进行拼接为目录或者文件路径),并且包含目录树中的所有子目录与文件)
[('E:/cdr01', ['', '', '', '', '', '', '', '', '', '', '', ''], ['cdr01.rar']), ('E:/cdr01//20110113', [], ['20110113_6042488744.csv']), ('E:/cdr01//20110114', [], ['20110114_6042488744.csv']), ('E:/cdr01//20110115', [], ['20110115_6042488744.csv']), ('E:/cdr01//20110116', [], ['20110116_6042488744.csv']), ('E:/cdr01//20110117', [], ['20110117_6042488744.csv']), ('E:/cdr01//20110118', [], ['20110118_6042488744.csv']), ('E:/cdr01//20110119', [], ['20110119_6042488744.csv']), ('E:/cdr01//20110120', [], ['20110120_6042488744.csv']), ('E:/cdr01//20110121', [], ['20110121_6042488744.csv']), ('E:/cdr01//20110122', [], ['20110122_6042488744.csv']), ('E:/cdr01//20110123', [], ['20110123_6042488744.csv']), ('E:/cdr01//20110124', [], ['20110124_6042488744.csv'])]
>>> list((os.path.join(a,f)) for a , b , c in os.walk("E:/cdr201101") for f in c if re.search('',os.path.basename(f))) #E:/cdr201101包含很多CSV文件,此方法将搜索目录树中的文件名包含字符串"6042488744"的文件,并将文件名与路径拼接作为绝对路径返回。
['E:/cdr201101//20110113//20110113_6042488744.csv', 'E:/cdr201101//20110114//20110114_6042488744.csv', 'E:/cdr201101//20110115//20110115_6042488744.csv', 'E:/cdr201101//20110116//20110116_6042488744.csv', 'E:/cdr201101//20110117//20110117_6042488744.csv', 'E:/cdr201101//20110118//20110118_6042488744.csv', 'E:/cdr201101//20110119//20110119_6042488744.csv', 'E:/cdr201101//20110120//20110120_6042488744.csv', 'E:/cdr201101//20110121//20110121_6042488744.csv', 'E:/cdr201101//20110122//20110122_6042488744.csv', 'E:/cdr201101//20110123//20110123_6042488744.csv', 'E:/cdr201101//20110124//20110124_6042488744.csv']
>>> import glob
>>> import fileinput
>>> import os
>>> import re
>>> glob.glob("E:/cdr01")
['E:/cdr01']
>>> glob.glob("E:/cdr01/*")#只返回当前cdr01下面的子目录名和文件名(带路径,但不包含目录树中的所有子目录与文件)
['E:/cdr01//20110113', 'E:/cdr01//20110114', 'E:/cdr01//20110115', 'E:/cdr01//20110116', 'E:/cdr01//20110117', 'E:/cdr01//20110118', 'E:/cdr01//20110119', 'E:/cdr01//20110120', 'E:/cdr01//20110121', 'E:/cdr01//20110122', 'E:/cdr01//20110123', 'E:/cdr01//20110124', 'E:/cdr01//cdr01.rar']
>>> [(a,b,c) for a , b , c in os.walk("E:/cdr01")] #os.walk返回目录树中的所有目录与文件,他将每一目录的子目录与文件都按一个元组来返回。a代表当前搜索目录(或者子目录),b代表当前搜索目录下面所包含的子目录列表,c代表当前搜索目录下面的所有文件名列表。(不带路径(但可以通过与元组第一项进行拼接为目录或者文件路径),并且包含目录树中的所有子目录与文件)
[('E:/cdr01', ['', '', '', '', '', '', '', '', '', '', '', ''], ['cdr01.rar']), ('E:/cdr01//20110113', [], ['20110113_6042488744.csv']), ('E:/cdr01//20110114', [], ['20110114_6042488744.csv']), ('E:/cdr01//20110115', [], ['20110115_6042488744.csv']), ('E:/cdr01//20110116', [], ['20110116_6042488744.csv']), ('E:/cdr01//20110117', [], ['20110117_6042488744.csv']), ('E:/cdr01//20110118', [], ['20110118_6042488744.csv']), ('E:/cdr01//20110119', [], ['20110119_6042488744.csv']), ('E:/cdr01//20110120', [], ['20110120_6042488744.csv']), ('E:/cdr01//20110121', [], ['20110121_6042488744.csv']), ('E:/cdr01//20110122', [], ['20110122_6042488744.csv']), ('E:/cdr01//20110123', [], ['20110123_6042488744.csv']), ('E:/cdr01//20110124', [], ['20110124_6042488744.csv'])]
>>> list((os.path.join(a,f)) for a , b , c in os.walk("E:/cdr201101") for f in c if re.search('',os.path.basename(f))) #E:/cdr201101包含很多CSV文件,此方法将搜索目录树中的文件名包含字符串"6042488744"的文件,并将文件名与路径拼接作为绝对路径返回。
['E:/cdr201101//20110113//20110113_6042488744.csv', 'E:/cdr201101//20110114//20110114_6042488744.csv', 'E:/cdr201101//20110115//20110115_6042488744.csv', 'E:/cdr201101//20110116//20110116_6042488744.csv', 'E:/cdr201101//20110117//20110117_6042488744.csv', 'E:/cdr201101//20110118//20110118_6042488744.csv', 'E:/cdr201101//20110119//20110119_6042488744.csv', 'E:/cdr201101//20110120//20110120_6042488744.csv', 'E:/cdr201101//20110121//20110121_6042488744.csv', 'E:/cdr201101//20110122//20110122_6042488744.csv', 'E:/cdr201101//20110123//20110123_6042488744.csv', 'E:/cdr201101//20110124//20110124_6042488744.csv']

七. 字符串转成字节数组,字节数组转成字节串

>>> s = 'abcd123'  
>>> b = bytearray(s,sys.stdin.encoding) #sys.stdin.encoding相当于locale.getdefaultlocale()[1]获得当前操作系统的编码方式
>>> b
bytearray(b'abcd123')
>>> b = bytes(s,sys.stdin.encoding)
>>> b
b'abcd123'
>>> s = 'abcd123'
>>> b = bytearray(s,sys.stdin.encoding) #sys.stdin.encoding相当于locale.getdefaultlocale()[1]获得当前操作系统的编码方式
>>> b
bytearray(b'abcd123')
>>> b = bytes(s,sys.stdin.encoding)
>>> b
b'abcd123'

八. 字符串与字节的编码与解码

>>> a = b'abc'  
>>> a.decode() #字节解码为字符串
'abc'
>>> b = aa.encode() #字符串编码为字节
>>> b
b'abc'
>>>
>>> a = b'abc'
>>> a.decode() #字节解码为字符串
'abc'
>>> b = aa.encode() #字符串编码为字节
>>> b
b'abc'
>>>

九. 处理zip压缩文件

>>> import zipfile  
>>> f = zipfile.ZipFile("E:/CodeBuilder.zip","r")
>>> for name in f.namelist():
data = f.read(name)
print(name,len(data),repr(data[:10]))
>>> f.close()
>>> import zipfile
>>> f = zipfile.ZipFile("E:/CodeBuilder.zip","r")
>>> for name in f.namelist():
data = f.read(name)
print(name,len(data),repr(data[:10]))
>>> f.close() >>> import zipfile
>>> z = zipfile.ZipFile("E:/test1.zip","w") #创建zip压缩文件包
>>> z.write("E:/testSqliteDB.db.txt") #压缩一个txt文件
>>> z.close()
>>> z = zipfile.ZipFile("E:/test1.zip","r") #读取zip压缩文件包
>>> z.extractall()#解压到当前目录,extract可以具体指定解压哪个文件到哪个目录
>>> z.extractall("E:/123/")#解压到指定目录
>>> z.close()
>>> import os
>>> os.getcwd() #getcwd()可以查看解压的当前目录位置
'C://Python31'
>>> import zipfile
>>> z = zipfile.ZipFile("E:/test1.zip","w") #创建zip压缩文件包
>>> z.write("E:/testSqliteDB.db.txt") #压缩一个txt文件
>>> z.close()
>>> z = zipfile.ZipFile("E:/test1.zip","r") #读取zip压缩文件包
>>> z.extractall()#解压到当前目录,extract可以具体指定解压哪个文件到哪个目录
>>> z.extractall("E:/123/")#解压到指定目录
>>> z.close()
>>> import os
>>> os.getcwd() #getcwd()可以查看解压的当前目录位置
'C://Python31'

十. glob遍历文件夹下面的所有文件并读取内容

>>> import fileinput  
>>> import glob
>>> for line in fileinput.input(glob.glob("E:/TestFolder/*.txt")):
print("File name:" + fileinput.filename() + " line length:" + str(len(line)))
>>> fileinput.close()
>>> import fileinput
>>> import glob
>>> for line in fileinput.input(glob.glob("E:/TestFolder/*.txt")):
print("File name:" + fileinput.filename() + " line length:" + str(len(line)))
>>> fileinput.close()

十一. shutil拷贝目录树

>>> import shutil  
>>> shutil.copytree("E:/TestFolder","F:/TestFolder-bak")
>>> shutil.copytree("E:/TestFolder","xx") #在TestFolder文件夹里面创建XX目录,并拷贝TestFolder目录到XX目录
>>> import shutil
>>> shutil.copytree("E:/TestFolder","F:/TestFolder-bak")
>>> shutil.copytree("E:/TestFolder","xx") #在TestFolder文件夹里面创建XX目录,并拷贝TestFolder目录到XX目录

十二. 获得文件大小的两种方式(二进制读取)

>>> import os  
>>> os.stat(f).st_size
4753
>>> os.path.getsize(f)
4753
>>> import os
>>> os.stat(f).st_size
4753
>>> os.path.getsize(f)
4753

十三. mmap 模块提供了操作系统内存映射函数的接口,可以映射字符串与文件内容

可以执行譬如查找、统计、写入等一些操作,但就是基于字节的。

>>> map = mmap.mmap(-1,13)  
>>> map.write(b"Hello world!")
>>> map.readline()
b'/x00'
>>> map.seek(0)
>>> map.readline()
b'Hello world!/x00'
>>> map.seek(0)
>>> map.find(b'w')
6
>>> map.close()
>>> map = mmap.mmap(-1,13)
>>> map.write(b"Hello world!")
>>> map.readline()
b'/x00'
>>> map.seek(0)
>>> map.readline()
b'Hello world!/x00'
>>> map.seek(0)
>>> map.find(b'w')
6
>>> map.close()

十四. dis反编译对象为字节码

>>> import dis  
>>> def showMsg(xx):
print("abc") >>> dis.dis(showMsg)
2 0 LOAD_GLOBAL 0 (print)
3 LOAD_CONST 1 ('abc')
6 CALL_FUNCTION 1
9 POP_TOP
10 LOAD_CONST 0 (None)
13 RETURN_VALUE
>>> import dis
>>> def showMsg(xx):
print("abc") >>> dis.dis(showMsg)
2 0 LOAD_GLOBAL 0 (print)
3 LOAD_CONST 1 ('abc')
6 CALL_FUNCTION 1
9 POP_TOP
10 LOAD_CONST 0 (None)
13 RETURN_VALUE

十五。profile 与 cProfile分析程序执行性能

profile 模块是标准 Python 分析器,用Python写的。
而cProfile是用C写的,运行起来比profile快,官方推荐用cProfile.

pstats可以处理分析报告。

>>> import profile  
>>> def testss(n):
i = 0
for i in range(n):
i = i + 1
return i >>> profile.run("testss(1000000)")
5 function calls in 0.269 CPU seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.266 0.266 :0(exec)
1 0.002 0.002 0.002 0.002 :0(setprofile)
1 0.266 0.266 0.266 0.266 <pyshell#3>:1(testss)
1 0.000 0.000 0.266 0.266 <string>:1(<module>)
0 0.000 0.000 profile:0(profiler)
1 0.000 0.000 0.269 0.269 profile:0(testss(1000000)) >>> import cProfile
>>> cProfile.run("testss(1000000)") #分析速度快些
4 function calls in 0.212 CPU seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function)
1 0.212 0.212 0.212 0.212 <pyshell#3>:1(testss)
1 0.000 0.000 0.212 0.212 <string>:1(<module>)
1 0.000 0.000 0.212 0.212 {built-in method exec}
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
>>> import profile
>>> def testss(n):
i = 0
for i in range(n):
i = i + 1
return i >>> profile.run("testss(1000000)")
5 function calls in 0.269 CPU seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.266 0.266 :0(exec)
1 0.002 0.002 0.002 0.002 :0(setprofile)
1 0.266 0.266 0.266 0.266 <pyshell#3>:1(testss)
1 0.000 0.000 0.266 0.266 <string>:1(<module>)
0 0.000 0.000 profile:0(profiler)
1 0.000 0.000 0.269 0.269 profile:0(testss(1000000)) >>> import cProfile
>>> cProfile.run("testss(1000000)") #分析速度快些
4 function calls in 0.212 CPU seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function)
1 0.212 0.212 0.212 0.212 <pyshell#3>:1(testss)
1 0.000 0.000 0.212 0.212 <string>:1(<module>)
1 0.000 0.000 0.212 0.212 {built-in method exec}
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}

pstats处理分析报告:

>>> import pstats  
>>> pr = profile.Profile()
>>> pr.run("testss(1000000)")
<profile.Profile object at 0x0143C8D0>
>>> p = pstats.Stats(pr)
>>> pstats = p.sort_stats("time") #按时间排序
>>> pstats.print_stats() #打印在profile.run()中形成的分析报告
5 function calls in 38.856 CPU seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function)
1 25.843 25.843 25.843 25.843 :0(setprofile)
1 12.760 12.760 38.856 38.856 profile:0(testss(1000000))
1 0.253 0.253 0.253 0.253 <pyshell#3>:1(testss)
1 0.000 0.000 0.253 0.253 :0(exec)
1 0.000 0.000 0.253 0.253 <string>:1(<module>)
0 0.000 0.000 profile:0(profiler) <pstats.Stats object at 0x0143C330>
>>> import pstats
>>> pr = profile.Profile()
>>> pr.run("testss(1000000)")
<profile.Profile object at 0x0143C8D0>
>>> p = pstats.Stats(pr)
>>> pstats = p.sort_stats("time") #按时间排序
>>> pstats.print_stats() #打印在profile.run()中形成的分析报告
5 function calls in 38.856 CPU seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function)
1 25.843 25.843 25.843 25.843 :0(setprofile)
1 12.760 12.760 38.856 38.856 profile:0(testss(1000000))
1 0.253 0.253 0.253 0.253 <pyshell#3>:1(testss)
1 0.000 0.000 0.253 0.253 :0(exec)
1 0.000 0.000 0.253 0.253 <string>:1(<module>)
0 0.000 0.000 profile:0(profiler) <pstats.Stats object at 0x0143C330>

Python小技巧1的更多相关文章

  1. 掌握这个Python小技巧,轻松构建cytoscape导入文件

    今天小编和大家分享如何借助Python脚本轻松构建cytoscape导入文件.Cytoscape是一个非常适合展示各种相互作用关系的可视化软件. 具体来说就是可以用于蛋白互作网络的展示,miRNA与蛋 ...

  2. python小技巧 小知识

    python小技巧 小知识 python系统变量(修改调用shell命令路径)或用户空间说明 20150418 python调用系统命令,报找不到.怎么办? 类似执行shell的: [ -f /etc ...

  3. Python补充02 Python小技巧

    作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 在这里列举一些我使用Python时积累的小技巧.这些技巧是我在使用Python过程 ...

  4. python 小技巧(import模块、查询类继承关系、安装包)

    作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 在这里列举一些我使用Python时积累的小技巧.这些技巧是我在使用Python过程 ...

  5. 让你瞬间萌比的35个python小技巧

    今天在看python算法的时候,看到一篇关于python的小技巧.瞬间萌比了,原来python也可以这样玩,太神奇了.萌比的是原来这么简单的东西自己都不知道,虽然会写.废话不多说了,开始上菜. 1.拆 ...

  6. Python小技巧:使用一行命令把你的电脑变成服务器

    不知道你有没有遇到这么一种情况,就是你有时候想要把电脑上的一些东西传输到你的手机或者 Pad ,你要么需要使用数据线连接到电脑,有时候还要装各种驱动才可以进行数据传输,要么需要借助第三方的工具,在局域 ...

  7. 不是吧?30秒 就能学会一个python小技巧?!

    大家好鸭!我是小熊猫 很多学习Python的朋友在项目实战中会遇到不少功能实现上的问题,有些问题并不是很难的问题,或者已经有了很好的方法来解决.当然,孰能生巧,当我们代码熟练了,自然就能总结一些好用的 ...

  8. Python小技巧整理

    一.python小工具: 1.内置下载和网站: 进入相应目录:2.x python -m SimpleHTTPServer 3.x python -m http.server 2.字符串转换为JSON ...

  9. 5个常常被大家忽略的Python小技巧

    下面我挑选出的这几个技巧常常会被人们忽略,但它们在日常编程中能真正的给我们带来不少帮助. 1. 字典推导(Dictionary comprehensions)和集合推导(Set comprehensi ...

  10. python小技巧01递归解释内嵌

    现假设有一份机器人配件名单 list[头部,躯干,肢体] 头部这个list又有鼻子眼睛嘴巴这些小零件 肢体这个list有胳膊,肩膀,手.手这个list又有3种手指 所以这个list详细写出是: lis ...

随机推荐

  1. 【u251】心灵的抚慰

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 病毒问题解决后,神牛们的心灵久久不能平静.他可以从一个程序联想到一些相似的程序.比如从程序1联想到2, ...

  2. FeatureLayer,FeatureDataset,FeatureClass,Feature的区别与联系总结

    duckweeds原文 FeatureLayer,FeatureDataset,FeatureClass,Feature几个概念一点点总结,欢迎指教 刚学AE,其中很多概念都模糊不清.经过一段时间的摸 ...

  3. 原生js螺旋运动

    window.onload=function(){ var oSpiral=document.getElementById('spiral'); var oUl=oSpiral.getElements ...

  4. okhttp的简介(二)之简单封装

    前一篇文章简单的介绍了okhttp的简单使用.okhttp的简介(一):http://blog.csdn.net/wuyinlei/article/details/50579564 相信使用还是非常好 ...

  5. thinkphp 获取url参数,汉字获取不到

    //这样获取不到 dump($_GET['car_code']); //这样就可以获取了 dump(iconv("gb2312","utf-8",$_GET[' ...

  6. 【34.57%】【codeforces 557D】Vitaly and Cycle

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  7. windows安装rabbitMQ服务

    简介: RabbitMQ是流行的开源消息队列系统,用erlang语言开发.RabbitMQ是AMQP(高级消息队列协议)的标准实现. windows安装rabbitMQ服务步骤: 首先需要安装 Erl ...

  8. 【codeforces 755A】PolandBall and Hypothesis

    time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  9. [Angular] Dynamic components with ComponentFactoryResolver

    To create a component dynamicly. 1. Add a container with ref: @Component({ selector: 'app-root', tem ...

  10. Web开发标配--开发人员工具-F12

    喜欢从业的专注,七分学习的态度. 360浏览器-开发工具 谷歌-开发工具 IE-开发工具 Web开发中最最烦琐的莫过于调整CSS和JS,而最方便最高效的方式就是利用浏览器的开发工具调整.CSS可以实时 ...