E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
test.py
python __file__ 与相对路径
用__file__ 来获得脚本所在的路径是比较方便的,但这可能得到的是一个相对路径,比如在脚本
test.py
中写入: #!
younglibin
·
2013-07-12 14:00
python
python __file__ 与相对路径
用__file__ 来获得脚本所在的路径是比较方便的,但这可能得到的是一个相对路径,比如在脚本
test.py
中写入: #!
younglibin
·
2013-07-12 14:00
python
(Python学习9)Python虚拟机中的一般表达式
构建工具co_dist.py:source=open('
test.py
').read() co=co
·
2013-07-09 15:00
python
(Python学习9)Python虚拟机中的一般表达式
构建工具co_dist.py:source=open('
test.py
').read()co=comp
efeics
·
2013-07-08 17:03
Python
(Python学习9)Python虚拟机中的一般表达式
构建工具co_dist.py:source=open('
test.py
').read() co=com
efeics
·
2013-07-08 17:00
Python获取shell管道数据/输入的2种方法: subprocess子进程 和 sys.stdin
今天发现了更方便的方式,就是用subprocess模块,创建子进程,然后用管道来进行交互,而这种方式在shell中非常普遍,比如:catxxx.file|
test.py
就是用的管道,另外,在hadoop
jesterxu
·
2013-07-05 15:01
python
Stream
程序
管道
在Linux中开机自动运行普通用户脚本程序
测试环境:Fedora7,管理员:root,普通用户:test1实现目标:在Linux启动时,自动运行位于普通用户test1根目录下的脚本程序
test.py
,该程序会在每次执行时自动向本地日志文件追加一条记录
secsky
·
2013-07-03 22:34
linux
python
import
管理员
根目录
python和c++互调
test.py
def print_list(list): print dict def show
lifan_3a
·
2013-07-02 13:00
Python and Play
compile py to pyc file cd c:\python27 python.exe import py_compilepy_compile.compile(r'H:\game\
test.py
隐形的翅膀
·
2013-06-23 17:00
python
c中嵌入python
.150032bit(Intel)]'先新建DEV-C++工程后,设置工程属性:连接参数如下:-IC:\Python27\include -LC:\Python27\libs -lpython27
test.py
sunlimpid
·
2013-06-11 10:00
c
python
Python脚本中import另外一个目录的脚本
例如下面的目录结构:-+-lib ||-a.py ||-b.py |-apps |-
test.py
如何在
test.py
中引用lib下面的a.py和b.py?
hansel
·
2013-05-25 10:00
Py2exe打包成exe
Py2exe的下载地址:http://www.py2exe.org/2.在本地文件夹下面新建一个
test.py
文件,比如在C:\test文件夹下面新建一个test.py.test.py的程序代码为:fromseleniumimportwebdriverdriver
yuxinlong2006
·
2013-05-23 12:00
python
py2exe
跟着tutorial学python3.3
# ============================================================================= # FileName:
test.py
anduo1989
·
2013-05-15 22:00
python3
Linux开机自动执行脚本
测试环境:Fedora7,管理员:root,普通用户:test1实现目标:在Linux启动时,自动运行位于普通用户test1根目录下的脚本程序
test.py
,该程序会在每次执行时自动向本地日志文件追加一条记录
Felixgzf
·
2013-05-13 14:08
自动执行脚本
settings.py的设置
新建一个settings的目录: settings/ __init__.py base.py local.py staging.py
test.py
production.py
xlofty
·
2013-05-02 17:00
set
设置linux开机自动运行脚本
原文:http://os.chinaunix.net/a2008/0905/985/000000985324.shtml 实现目标:在Linux启动时,自动运行位于普通用户test1根目录下的脚本程序
test.py
chj90220
·
2013-04-22 17:00
linux自动启动
Python的subprocess子进程和管道进行交互
今天发现了更方便的方式,就是用subprocess模块,创建子进程,然后用管道来进行交互,而这种方式在shell中非常普遍,比如:catxxx.file|
test.py
就是用的管道,另外,在hadoop
Devliyangjunfei
·
2013-03-28 10:00
python
python中os.path.dirname(__file__)的使用
).当"printos.path.dirname(__file__)"所在脚本是以完整路径被运行的,那么将输出该脚本所在的完整路径,比如: pythond:/pythonSrc/test/
test.py
cnmilan
·
2013-03-26 15:00
win8下Python学习——搭建web.py框架
python2.7.3,下载2.添加环境变量,如下图3.安装web.py,下载 解压web.py的安装包,如下进入cmd,运行以下命令,web.py框架就安装好了4.测试一下web.py框架,编写
test.py
·
2013-03-20 12:00
python
python中os.path.dirname(__file__)的使用
, 比如: python d:\pythonSrc\test\
test.py
akunamotata
·
2013-03-13 16:00
python
python中如果加主函数
www.itexample.com/python/add-main-function.html 一个程序总要有一个入口方法吧,就像java中的 main()方法一样,python也同样有自己的入口方法定义方式, 下面是
Test.py
limaoyuan
·
2013-03-03 21:00
python
Python 笔记(1)input与raw_input
GumbyTraceback(mostrecentcalllast):File"C:/python/
test.py
",line2,in?name=input("Wha
FlyDirk
·
2013-01-23 16:00
python
python
使用python脚本,通过PyFetion给手机发消息
主函数,保存为一个
test.py
文件,放在PyFetion文件夹的下面,或自已设置目录importos importre importsys importtime fromPyFetionimport*
robertkun
·
2013-01-18 20:00
将qt ui界面文件转换为pyqt python格式
2打开终端,进入到保存的test.ui的路径下,然后执行以下命令: pyuic4test.ui>
test.py
那么在当前目录下就会生成
test.py
文件了。 这个方法对于喜欢用python编
yingmutongxue
·
2013-01-09 21:00
UI
UI
python
python
qt
qt
qt
pyuic
Python 网络爬虫
一共两个文件,一个是toolbox_insight.py,是一个工具文件另一个是
test.py
,是一个用到toolbox_insight.py中工具的测试文件#FileName:toolbox_insight.pyfromsgmllibimportSGMLParserimportthreadingimporttimeimporturllib
yidangui
·
2012-12-17 11:00
pyc相关
04/2483095.html大部分的python代码是明文的,如果不想让别人看你的代码怎么办网上有很多办法,这里介绍最简单的,python自带的方法将代码编译成pyc格式有两种方式:方法一:写一个程序
test.py
cpdoor2163_com
·
2012-12-14 16:00
Python的subprocess子进程和管道进行交互
今天发现了更方便的方式,就是用subprocess模块,创建子进程,然后用管道来进行交互,而这种方式在shell中非常普遍,比如:catxxx.file|
test.py
就是用的管道,另外,在hadoop
Tyrion-Lannister
·
2012-11-28 09:22
Python的subprocess子进程和管道进行交互
今天发现了更方便的方式,就是用subprocess模块,创建子进程,然后用管道来进行交互,而这种方式在shell中非常普遍,比如:catxxx.file|
test.py
就是用的管道,另外,在hadoop
HMSIWTV
·
2012-11-28 09:00
py2exe问题解决
用py2exe,方法如下: 1.安装py2exeeasy_install即可 2.将打包文件与被打包文件放在同一个文件夹下 例如,你需要将
test.py
打包成exe,那么
test.py
就是被打包文件
cyb880326
·
2012-11-09 13:00
py2exe
MSVCP90.dll
Linux中开机自动运行普通用户脚本程序
测试环境:Fedora7管理员:root普通用户:test1实现目标:在Linux启动时,自动运行位于普通用户test1根目录下的脚本程序
test.py
,该程序会在每次执行时自动向本地日志文件追加一条记录
山药蛋
·
2012-10-31 11:00
Python文件夹与文件的操作
使用时需先导入这个模块,导入的方法是:importos一、取得当前目录s= os.getcwd()#s中保存的是当前目录laurawan添加:不一定是文件所在目录,比如文件
test.py
在e:\python
laurawan
·
2012-09-27 14:00
windows
python
System
Path
import
磁盘
python和c++互调
test.py
defprint_list(list): printdict defshow(): print"helloworld"test.cpp代码其它地方拉来
balderfan
·
2012-09-13 13:00
python-import文件结构
测试test.py#-*-coding:UTF-8-*- importsys,os importtest2 importtest2#事实上只执行一次 print"file:
test.py
,beforemain
gexiaobaoHelloWorld
·
2012-09-07 14:00
python getopt使用 .
, longopts = [])参数args一般是sys.argv[1:]shortopts 短格式 (-) longopts 长格式(--) 命令行中输入:python
test.py
scm002
·
2012-08-24 15:00
python
python模块的打包
(可以在pypi上找到)样例代码:新建
test.py
文件,内容如下:print"showme"新建一个setup.py编译文件,内容如下:fromdistutils.coreimportsetup setup
five3
·
2012-08-09 15:00
windows
python
File
email
import
installer
py2exe简单使用
样例代码:新建
test.py
文件,内容如下:print"showme"新建一个mysetup.py编译文件,内容如下:fromdistutils.coreimportsetup import
five3
·
2012-08-09 13:00
windows
python
脚本
dll
exe
import
Python 关于 name main的使用
__name__:在使用自身的时候,就是main,比如你执行: pythontest.py 此时在
test.py
里面的name就是main 如果你在test2中importtest,那么name就是文件名
sincoder
·
2012-07-18 20:00
python学习之课后习题
importos importtime importsys source=[] foriinsys.argv: printi source.append(i) #source=['/root/python/
test.py
chen861201
·
2012-06-27 20:00
python初学常见问题记录(4)
通过运行一个脚本,将计算机的配置信息输出到指定文本,这个过程也遇到了一些困难,毕竟之前没有编程经验,把遇到的问题做个记录如下:(另外通过运行脚本时利用重定向,也可将结果输出到文件,如: python
test.py
julius_lee
·
2012-06-19 15:00
每天进步一点点 --python学习1
/usr/bin/python #Filename:
test.py
def repeater(n): return lambda s:s*n twice = repeater(2)
wang_2011_ying
·
2012-05-28 17:00
每天进步一点点
python获取当前工作目录
例
test.py
import inspect dir = inspect.getfile(inspect.currentframe()) print dir 打印出的是当前语句所在的或者说是包含当前语句的函数所在的脚本的目录
窈窕魑魅
·
2012-05-11 23:28
python
工作目录
python获取当前工作目录
/
test.py
输出./test.pypython
窈窕魑魅
·
2012-05-11 23:28
python
工作目录
Python
设置linux开机自动运行脚本
实现目标:在Linux启动时,自动运行位于普通用户test1根目录下的脚本程序
test.py
,该程序会在每次执行时自动向本地日志文件追加一条记录,源码如下: fromdatetimeimportdatetime
guang11cheng
·
2012-05-07 21:00
linux
python
shell
脚本
service
import
python sys模块常用的功能
pythonsys模块常用的功能python-sys备忘: 1.sys. argv[] eg:pythontest.pya1a2 argv[0]为
test.py
2.sys. platform
程序之旅
·
2012-04-29 16:00
MonkeyRunner_在eclipse中配置jython 运行MonkeyRunner
在eclipse中配置jython运行MonkeyRunner都说不可以,我试验了一下,确实存在一些问题,先归纳如下:文档结构及导入的jar包如上图,然后创建
test.py
文件运行monkeyrunner
jiguanghoverli
·
2012-04-24 13:00
eclipse
File
Module
command
import
jython
PyRun_SimpleFile()崩溃问题
1504406PyRun_SimpleFile()造成程序崩溃.例程如下:#include"python.h"intmain(){ Py_Initialize(); FILE*fp=fopen("
test.py
JoeBlackzqq
·
2012-03-26 13:00
windows
unix
python
File
dll
FP
python用法:处理sqlite中的中文字符时遇到的问题
文件
test.py
是utf-8编码的,OK,结果没问题。
·
2012-03-16 12:00
python
[笔记]Python虚拟机对函数的解释
demo.py:i=1 deff(): j=2 f()
test.py
:importdis source=open('./demo.py').read() co=compile(source,'.
jasonblog
·
2012-03-10 01:00
[笔记]Python虚拟机对创建基本内置对象的执行过程
同样的,有demo.py代码如下:i=1 s="Python" d={"1":1,"2":2} l=[2,3]有
test.py
代码如下:importdis source=open('.
jasonblog
·
2012-03-10 01:00
[笔记]Python虚拟机如何执行“i = 1”
首先写一个demo.py,里面只有一句:i=1接着写一个
test.py
,内容如下:importdis source=open('.
jasonblog
·
2012-03-10 01:00
虚拟机
python
汇编
活动
basic
import
上一页
20
21
22
23
24
25
26
27
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他