随笔分类 -  python

上一页 1 2 3 下一页

array , asarray, len , shape, np.squeeze , [0,0:4] 降维
摘要:http://blog.csdn.net/lanchunhui/article/details/55657040 >>> g = np.array([[ 40.47109199 , -10.01622954 , 275.29573762 , 311.23186909 , 0.99994779]] > 阅读全文

posted @ 2018-03-07 15:08 cdekelon 阅读(359) 评论(0) 推荐(0)

lambda 表达式
摘要:https://www.cnblogs.com/hf8051/p/8085424.html https://www.cnblogs.com/guigujun/p/6134828.html https://www.cnblogs.com/AlwaysWIN/p/6202320.html 阅读全文

posted @ 2018-03-07 14:54 cdekelon 阅读(66) 评论(0) 推荐(0)

os.path.split()
摘要:、os.path.split()函数语法:os.path.split('PATH') 参数说明: 实际上,该函数的分割并不智能,它仅仅是以 "PATH" 中最后一个 '/' 作为分隔符,分隔后,将索引为0的视为目录(路径),将索引为1的视为文件名,如: >>> import os>>> os.pat 阅读全文

posted @ 2018-03-07 14:48 cdekelon 阅读(170) 评论(0) 推荐(0)

os.path.expanduser(path)
摘要:http://python.usyiyi.cn/translate/python_278/library/os.path.html 阅读全文

posted @ 2018-03-05 11:25 cdekelon 阅读(197) 评论(0) 推荐(0)

Shutffle (change dict to item and do shutffle) ; Mark id to each person
摘要:#!/usr/bin/python import time import sys import os from os import walk import random import numpy as np if len(sys.argv) != 2: print( "This script will make img_path --- > person_id wi... 阅读全文

posted @ 2018-01-29 17:02 cdekelon 阅读(113) 评论(0) 推荐(0)

show the current time
摘要:import time print "begin at: " + time.asctime(time.localtime()) 阅读全文

posted @ 2018-01-25 10:39 cdekelon 阅读(87) 评论(0) 推荐(0)

(summary) Generate folder-subfolders (sys.argv)
摘要:1. copy_sub_folders.py 2. remove_files_in_subfolder.py 3. combine step1 and step2, copy_subfolder_remove_itsfile.py 4. or generate the sub-folders dir 阅读全文

posted @ 2018-01-24 16:54 cdekelon 阅读(140) 评论(0) 推荐(0)

Generate folder-subfolders according to olddir
摘要:# https://majing.io/questions/772 阅读全文

posted @ 2018-01-24 16:46 cdekelon 阅读(128) 评论(0) 推荐(0)

delete the files in subfolders
摘要:http://blog.csdn.net/liuchunming033/article/details/39400931 阅读全文

posted @ 2018-01-24 01:13 cdekelon 阅读(169) 评论(0) 推荐(0)

shutil.copytree copy all the folders and files
摘要:# http://blog.csdn.net/liuchunming033/article/details/39400931 创建多层新目录: ### 创建多层目录 def mkdirs(path): # 去除首位空格 path=path.strip() # 去除尾部 \ 符号 path=path. 阅读全文

posted @ 2018-01-24 00:13 cdekelon 阅读(392) 评论(0) 推荐(0)

os.remove some jpgs
摘要:>>> import os >>> for i in range(1,23): ... os.remove(str(i)+'.jpg') ... ... 阅读全文

posted @ 2018-01-23 15:11 cdekelon 阅读(103) 评论(0) 推荐(0)

shutil.rmtree, os.path, delete sub-folders, format
摘要:#==== #This script will check how many files in sub-folders. #Will delete the sub-folders if the files are not enough. #==== import os import shutil from os import walk import os.path #mypath='./' ... 阅读全文

posted @ 2018-01-23 14:19 cdekelon 阅读(146) 评论(0) 推荐(0)

How to create folder
摘要:from https://gist.github.com/keithweaver/562d3caa8650eefe7f84fa074e9ca949 阅读全文

posted @ 2018-01-22 15:56 cdekelon 阅读(109) 评论(0) 推荐(0)

About sys.path.insert
摘要:由于sys.path是全局搜索路列表list,list具有insert方法,原型是insert(i, x) i表示位置 x表示数据 意思是把数据x插入到位置i中 阅读全文

posted @ 2018-01-04 17:14 cdekelon 阅读(241) 评论(0) 推荐(0)

About os.path
摘要:http://blog.51cto.com/xpleaf/1736956 http://blog.csdn.net/u011760056/article/details/46969883 1. Notes. os.path.dirname(__file__)返回脚本的路径,但是需要注意一下几点: 1 阅读全文

posted @ 2018-01-04 16:45 cdekelon 阅读(141) 评论(0) 推荐(0)

About all the modules
摘要:http://python.usyiyi.cn/translate/python_278/library/os.path.html http://python.usyiyi.cn/translate/python_278/library/index.html 阅读全文

posted @ 2018-01-04 15:13 cdekelon 阅读(72) 评论(0) 推荐(0)

About os.environ
摘要:>>> for a in os.environ.keys(): ... print os.environ[a] ... | /usr/bin/lesspipe %s 10.19.142.3 56522 22 nvidia nvidia /home/nvidia /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:... 阅读全文

posted @ 2018-01-04 15:02 cdekelon 阅读(156) 评论(0) 推荐(0)

About from __future__ import absolute_import
摘要:http://blog.csdn.net/caiqiiqi/article/details/51050800 https://docs.python.org/3/library/__future__.html https://docs.python.org/2.5/whatsnew/pep-328. 阅读全文

posted @ 2018-01-03 17:30 cdekelon 阅读(95) 评论(0) 推荐(0)

About self and class
摘要:From http://www.runoob.com/python3/python3-class.html 1. 很多类都倾向于将对象创建为有初始状态的。因此类可能会定义一个名为 __init__() 的特殊方法(构造方法) 2. 类定义了 __init__() 方法的话,类的实例化操作会自动调用 阅读全文

posted @ 2017-12-28 17:21 cdekelon 阅读(166) 评论(0) 推荐(0)

How to quickly learn 一个Python的模块、方法、关键字
摘要:From http://blog.csdn.net/oxiaoxio/article/details/50445539 想要快速的学会一个Python的模块和方法,两个函数必须要知道,那就是dir()和help() dir():能够快速的以集合的型式列出该模块下的所有内容(类、常量、方法)例: 结果 阅读全文

posted @ 2017-12-28 16:49 cdekelon 阅读(271) 评论(0) 推荐(0)

上一页 1 2 3 下一页

导航