python script】的更多相关文章

使用Jython结合java和Python开发功能时,要是遇到如下情况: 2016-03-10 16:16:49 DEBUG [com.freedom.orion.configs.JyhtonConfig] python script home:/Users/fs/Desktop/pythonScript File "", line 14 Date/Time: 2016-03-10 14:42:22.493 +0800 ^ SyntaxError: no viable alternat…
打开httpd.conf,找到”#ScriptInterpreterSource Registry “,移除前面的注释# (如果找不到这行,就自己添加进去) 找到“Options Indexes FollowSymLinks ”这句,在后面加上”ExecCGI “.(那个”Indexes “最好也能去掉,因为如果不去掉的话,目录下面没有index.html这种文件,就会显示出目录列表下的所有文件,所以有安全漏洞问题.如果去掉Indexes,而且没有index.html文件的话,就会显示一个For…
最近在做一个项目,涉及到大量的HTML.CSS代码的编写,手动写代码效率实在 是低下.于是想搜索一下,有没有Notepad++插件可以支持自动生成的,果不其然还真有.Emmet,这款神器其实就是 Zen Coding 的升级版,它可以极大的提高代码编写的效率,并提供了一种非常简练的语法规则,立刻生成对应的 HTML 结构或者 CSS 代码,同时还有多种实用的功能帮助进行前端开发. Emmet支持多种编辑器,如Sublime Text 2,TextMate 1.x,Eclipse/Aptana,E…
如果要在 rc.local 呼叫 python script python script 的位置需使用絕對路徑 其 python script 裡的有關 file 的位置也需使用 絕對路徑 如果要在 rc.local 呼叫建立 file file 的位置需使用絕對路徑 rc.local 位在 /etc 下 rc.local touch test #--- 沒有生效 touch ./test #--- 沒有生效 touch /etc/test #--- 生效 ..... ..... python…
#! /usr/bin/env python # -*- coding: UTF-8 -*- """The script is to check whether NE is in syncfail, if it is syncfail, login into CIPS to get login. """import paramikoimport sshimport osimport reimport timeimport appdirsimpor…
If you have several versions of Python installed, /usr/bin/env will ensure the interpreter used is the first one on your environment's $PATH. The alternative would be to hardcode something like #!/usr/bin/python; that's ok, but less flexible. In Unix…
Python scripts can be executed by passing the script name to the python command or created as executable commands that can run stand-alone. You’ll learn how to create both in this lesson. script.py: print("Hello World") When we want to run the s…
How can I launch an external python process from Excel 365 VBA on OSX? It took me a while, but I figured out how to do it. Excel 2016 has replaced MacScript() with AppleScriptTask(). This needs to be given an AppleScript file and function to call, an…
I write it yesterday to watch the NE process(rcpfd,cfgd) automatically, then i will write a window to implement it: #! /usr/bin/env python # -*- coding: UTF-8 -*- import paramikoimport sshimport osimport reimport time#RCPD异常类class RCPD_Exception(Exce…
#!/usr/bin/env python import urllib2 import json import argparse def authenticate(url, username, password): values = {'jsonrpc': '2.0', 'method': 'user.login', 'params': { 'user': username, 'password': password }, ' } data = json.dumps(values) req =…
#!/usr/bin/env python # encoding: utf-8 #set( $SITE = "https://www.cnblogs.com/c-x-a" ) """ @version: v1.0 @author: cxa @contact: 1598828268@qq.com @site: ${SITE} @software: ${PRODUCT_NAME} @file: ${NAME}.py @time: ${DATE} ${TIME}…
滤镜 -> Python Fu -> 控制台,复制粘贴下面代码. 然后 scale_image(800, 800) 图片自动缩放为 800*800 了 这个代码是傻傻的缩放,你可以把它改成按比例缩放 #!/usr/bin/env python from threading import Thread import time from gimpfu import * from __future__ import division def scale_image(w, h): pdb.gimp_p…
# -*- coding: utf-8 -*-#from ftplib import FTP __authour__='CC' import osimport telnetlibimport timeimport shutilimport socket#import pdbimport paramikofrom Tkinter import *import globimport re def get_version_path(n1,n2,n3): if(int(n2)==0 and int(n1…
learn what is api Jailbreak pycharm install requests on pycharm write first request: get, post MFA login: need to parameter mechanismId and SessionId know how to check response, (json.cn), know some data type and operate them (list, dict...) Cannot c…
1.tab键自动补全(每次导入时要将脚本的路径加入到sys.path中) import sysimport readlineimport rlcompleterimport atexitimport os# tab completion readline.parse_and_bind('tab: complete')# history file histfile = os.path.join(os.environ['HOME'], '.pythonhistory')try:    readlin…
############################################################################################ #### Fot LaSOT dataset ############################################################################################ import os import numpy as np import json…
1 A first script 1) script1.py - imports a Python module (libraries of additional tools) to fetch the name of the platform - calls three print function to display the script’s results - uses a variable named x, created when it’s assigned, to hold ont…
最近看开源项目时学习了一下用C/C++写python模块,顺便把学习进行一下总结,废话少说直接开始: 环境:windows.python2.78.VS2010或MingW 1 创建VC工程 (1) 打开VC6.0或VS2008,然后File-->New-->Project-->Win32 DLL Project.建立一个Empty Project,比如testClass,一路确定. (2) 之后向工程添加python头文件目录及库文件目录,如头文件目录:F:\python278\incl…
一.简介 Tornado 是 FriendFeed 使用的可扩展的非阻塞式 web 服务器及其相关工具的开源版本.这个 Web 框架看起来有些像web.py 或者 Google 的 webapp,不过为了能有效利用非阻塞式服务器环境,这个 Web 框架还包含了一些相关有用工具及优化. Tornado 和现在的主流 Web 服务器框架(包括大多数 Python 的框架)有着明显的区别:它是非阻塞式服务器,而且速度相当快.得利于其非阻塞的方式和对 epoll 的运用,Tornado 每秒可以处理数以…
1. get files in the current directory with the assum that the directory is like this: a .py |----dataFolder |----Myfolder |----1.csv , 2.csv, 3.csv # a.py 1 def getFileList(): file_list = [] cur_dir = os.getcwd() for folder in os.walk(cur_dir).next()…
操作系统:debian8.5_x64 freeswitch 版本 : 1.6.8 python版本:2.7.9 开启python模块 安装python lib库 apt-get install python-dev 编辑modules.conf,开启python模块: languages/mod_python 编译安装: ./configure && make && make install 在modules.conf.xml中开启python支持: 启动freeswitc…
catalogue . 相关基础知识 . Deviare API Hook Overview . 使用ctypes调用Windows API . pydbg . winappdbg . dll injection . process monitor with WMI . sobek-hids 0.  相关基础知识 0x1: Python 程序和 C 程序的整合 为了节省软件开发成本,软件开发人员希望能够缩短的软件的开发时间,希望能够在短时间内开发出稳定的产品.Python 功能强大,简单易用,能…
Python文件头部模板 先说个小知识点:如何在创建文件的时候自动添加文件的头部信息! 通过:file--settings 每次都通过file--setings打开设置页面太麻烦了!可以通过:View--选中Toolbar工具条…
1. Python中的异常栈跟踪 Python,在2.x中,异常对象可以是任何对象,异常对象和异常栈是分开的.python中用于处理异常栈的模块是traceback模块,它提供了print_exception.format_exception等输出异常栈等常用的工具函数. def func(a, b): return a / b if __name__ == '__main__': import sys import traceback try: func(1, 0) except Except…
1.先安装第三方插件: py2exe. Get py2exe from http://www.py2exe.org/ 在download里下载与自己python对应的版本 2.写一个测试python文件 Ttest.py print "Python script to exe test program" count = 0 while count < 10: print "count = " + str(count) +"\n" count…
参考老师的博客: 金角:http://www.cnblogs.com/alex3714/articles/5161349.html 银角:http://www.cnblogs.com/wupeiqi/articles/4963027.html 一.常用函数说明: ★ lamba python lambda是在python中使用lambda来创建匿名函数,而用def创建的方法是有名称的,除了从表面上的方法名不一样外,python lambda还有哪些和def不一样呢? 1 python lambd…
1.tab缩进2.读取文件,在文件名前加r或者R.这是因为python原始字符串特性,即在字符串的前面已R或者小写字母r开始,则字符串不对\进行转移,直接输出,通常用于表示windows的路径.file = open(r'E:\soft\Python\script\a.txt')for line in file.readlines():    print linefile.close()…
---恢复内容开始--- python文件 文件开头要有  #!/usr/bin/ python        --在linux中是告诉系统phthon的路径是在/usr/bin/ python目录下,在执行python文件时可以使用 ./文件名  ,如:./h.py  即可执行 所以python2.7文件开头都需要有 # -*- coding:utf-8 -*- 这句来设置编码格式 当有中文输出时,常会输出为乱码,这是因为代码是utf-8格式的,但显示终端的编码格式是gbk格式的.如果显示终端…
做hacker.org上面的题目时,遇到了一个题目需要对RFC3280种长度为9的单词进行计数,并找出这些单词中出现次数最多的那个:Didactic Byte RFC3280文档有7000多行,靠人工是数不出来的,解决这种是就得编程了,而且很明显,在处理此类问题时脚本式比较方便的,果断选择python 先是将题意理解错了,理解为出现次数最多的九个字母, 然后等到程序运行好提交答案时才发现不对,唉,真是汗颜 既然程序写出来了,还是将其贴出来吧 文档中字母频率计数: # find the occur…