码迷,mamicode.com
首页 >  
搜索关键字:os-path    ( 1357个结果
sys.path和os.path
sys.path和os.path1.sys.path是python搜索模块的路径集合,是个list;os.path是os的一个模块,是操作文件和目录的模块2.sys.path和PYTHONPATH首先PYTHONPATH可以通过sys.path来查看可以通过sys.path.append(path)...
分类:其他好文   时间:2014-12-24 11:23:09    阅读次数:143
python学习笔记24(路径与文件 (os.path包, glob包))
os.path模块主要用于文件的属性获取,在编程中经常用到,以下是该模块的几种常用方法。>>> import os.path>>> path = '/home/ethon/doc/file.txt'>>> os.path.abspath(path) # 返回path规范化的绝对路径'C:\\h...
分类:编程语言   时间:2014-12-23 12:08:23    阅读次数:163
python读取中文
如何从文件中读取300个汉字?看起来很简单,但很容易掉坑里了。一开始我这么写:1 try:2 fd = codecs.open(os.path.join(settings.TEXT_CONTENT_DIR,channel_name.lower(), article_id), ...
分类:编程语言   时间:2014-12-20 23:27:37    阅读次数:356
cocos3 python 写android.mk
import os dir = 'D:/hero/Classes'def readfile(dir): str="" first_line=1 for f in os.listdir(dir): file = os.path.join(dir, f) ...
分类:移动开发   时间:2014-12-20 11:33:29    阅读次数:167
python ftp 上传下载
#coding=utf-8 ? from?ftplib?import?FTP import?os import?os.path import?shutil import?datetime ? def?ftp_up(filename): ????ftp=FTP()? ????ftp.set_debuglevel(2)#打开调试级别2,显示...
分类:编程语言   时间:2014-12-16 19:35:19    阅读次数:158
Python——os.path模块
Python 2.7.8 该模块实现了一些关于路径名的函数。os.path.abspath(path) 返回所给参数的绝对路径。os.path.basename(path)Return the base name of pathnamepath. This is the second ele...
分类:编程语言   时间:2014-12-16 11:32:29    阅读次数:333
个人记录1
pkgname_="***"version_="1.0"importsysimportosbasepath_=os.path.dirname(os.path.realpath(__file__))modulepath_=os.path.join(basepath_,"modules")custompath_=os.path.join(basepath_,"custom")configpath_=os.path.join(basepath_,"config")sys.path.append(os.path.jo..
分类:其他好文   时间:2014-12-12 17:04:06    阅读次数:229
python补全tab
vipython_tab.py#!/usr/bin/envpythonimportsysimportreadlineimportrlcompleterimportatexitimportos#tabcompletionreadline.parse_and_bind(‘tab:complete‘)histfile=os.path.join(os.environ[‘HOME‘],‘.pythonhistory‘)try:readline.read_history_file(histfile)exceptIOErr..
分类:编程语言   时间:2014-12-08 19:46:44    阅读次数:455
代码高亮调整试验
import tornado.httpserver import tornado.ioloop import tornado.web import tornado.options import os.path from tornado.options import define, options d...
分类:其他好文   时间:2014-11-26 01:25:54    阅读次数:217
Python ConfigParser 读取配置向 SafeConfigParser写配置项
#!/usr/bin/env python# -*-coding:utf-8 -*-__author__ = 'shylock'import sys,osimport ConfigParserdef is_dir(config_path): return os.path.isdir(confi...
分类:编程语言   时间:2014-11-24 23:59:59    阅读次数:802
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!