资源简介
Cmder是一款Windows环境下非常简洁美观易用的cmd替代者,它是一个跨平台的命令行增强工具,可以集成windows batch, power shell, git, linux bash等多种命令行于一体,支持了大部分的Linux命令。十分方便。还可以通过自定义,让它更方便。
代码片段和文件信息
#!/usr/bin/python
#
# Server that will accept connections from a Vim channel.
# Run this server and then in Vim you can open the channel:
# :let handle = ch_open(‘localhost:8765‘)
#
# Then Vim can send requests to the server:
# :let response = ch_sendexpr(handle ‘hello!‘)
#
# And you can control Vim by typing a JSON message here e.g.:
# [“ex““echo ‘hi there‘“]
#
# There is no prompt just type a line and press Enter.
# To exit cleanly type “quit“.
#
# See “:help channel-demo“ in Vim.
#
# This requires Python 2.6 or later.
from __future__ import print_function
import json
import socket
import sys
import threading
try:
# Python 3
import socketserver
except ImportError:
# Python 2
import SocketServer as socketserver
thesocket = None
class ThreadedTCPRequestHandler(socketserver.baseRequestHandler):
def handle(self):
print(“=== socket opened ===“)
global thesocket
thesocket = self.request
while True:
try:
data = self.request.recv(4096).decode(‘utf-8‘)
except socket.error:
print(“=== socket error ===“)
break
except IOError:
print(“=== socket closed ===“)
break
if data == ‘‘:
print(“=== socket closed ===“)
break
print(“received: {0}“.format(data))
try:
decoded = json.loads(data)
except ValueError:
print(“json decoding failed“)
decoded = [-1 ‘‘]
# Send a response if the sequence number is positive.
# Negative numbers are used for “eval“ responses.
if decoded[0] >= 0:
if decoded[1] == ‘hello!‘:
response = “got it“
else:
response = “what?“
encoded = json.dumps([decoded[0] response])
print(“sending {0}“.format(encoded))
self.request.sendall(encoded.encode(‘utf-8‘))
thesocket = None
class ThreadedTCPServer(socketserver.ThreadingMixIn socketserver.TCPServer):
pass
if __name__ == “__main__“:
HOST PORT = “localhost“ 8765
server = ThreadedTCPServer((HOST PORT) ThreadedTCPRequestHandler)
ip port = server.server_address
# Start a thread with the server -- that thread will then start one
# more thread for each request
server_thread = threading.Thread(target=server.serve_forever)
# Exit the server thread when the main thread terminates
server_thread.daemon = True
server_thread.start()
print(“Server loop running in thread: “ server_thread.name)
print(“Listening on port {0}“.format(PORT))
while True:
typed = sys.stdin.readline()
if “quit“ in typed:
print(“Goodbye!“)
break
if thesocket is None:
print(“No socket yet“)
else:
print(“sending {0}“.format(type
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 0 2018-10-17 22:40 redeme.txt
目录 0 2017-07-25 05:15 bin\
文件 3635 2017-07-25 05:15 bin\alias.bat
文件 87 2015-10-12 19:00 bin\Readme.md
文件 74195 2016-12-02 08:00 CHANGELOG.md
文件 129024 2017-10-28 19:45 Cmder.exe
目录 0 2017-10-28 20:42 config\
文件 53667 2017-10-28 20:42 config\ConEmu.xm
文件 808 2017-04-07 08:36 config\Readme.md
文件 1822 2015-10-12 19:00 CONTRIBUTING.md
目录 0 2016-07-14 13:58 icons\
文件 18089 2015-10-12 19:00 icons\cmder.ico
文件 5272 2016-07-14 13:58 icons\cmder_blue.ico
文件 5193 2016-07-14 13:58 icons\cmder_green.ico
文件 5383 2016-07-14 13:58 icons\cmder_orange.ico
文件 5317 2016-07-14 13:58 icons\cmder_purple.ico
文件 4898 2016-07-14 13:58 icons\cmder_red.ico
文件 5227 2016-07-14 13:58 icons\cmder_yellow.ico
文件 1090 2017-10-28 20:42 LICENSE
文件 11653 2017-10-28 20:42 README.md
目录 0 2017-11-03 20:17 vendor\
目录 0 2017-11-03 20:17 vendor\cli
目录 0 2017-11-03 20:17 vendor\cli
文件 595 2017-10-25 02:52 vendor\cli
文件 116 2017-10-25 02:52 vendor\cli
文件 16 2017-11-03 20:17 vendor\cli
文件 89 2017-10-25 02:52 vendor\cli
文件 195 2017-10-25 02:52 vendor\cli
文件 173 2017-10-25 02:52 vendor\cli
文件 133 2017-10-25 02:52 vendor\cli
目录 0 2017-10-25 02:52 vendor\cli
............此处省略6550个文件信息
相关资源
- 精品完整数字图像处理课件
- GitKraken-v6.5.1.zip
- Digital communications(Fifth Edition)_John
- GitBook.Editor.Setup
- digital communications-第5版,中英全有,
- GitHubDesktop_3_2_0_0_X64 (1/2)
- VeilDependencies2.zip
- Digital Image Processing 4th Edition [Rafael C
- Principles of Digital Image Synthsis
- Digital Image Processing 4th Edition 数字图像
- git2.21.0版本安装包(包括64和32bit的)
- Advanced Digital Design With the Verilog HDL 2
- 数字信号处理-原理、算法与应用Dig
- Git资料三合一精通Git+Git版本控制管理
- TortoiseGit-2.3中文版与Git安装包_手册
- Octotree 2.4.6 谷歌浏览器GitHub插件 最新
- 汇编从命令行读入文件名,调用DOS功
- 命令行下支持矩阵复数自定义函数的
- engauge digitizer 4.1
- 使用命令行升级texlive宏包.pdf
- LSI-SAS-RAID卡命令行操作手册
- IDEA码云插件Gitee
- 易康额Congition安装包
- Git教学视频详解
- 罗技鼠标宏编程 API 参考文档.zip
- GitChat分享会-RabbitMQ典型场景实战-源码
- digital image processing复习题
- GCMW-1.14.0 windown上的git工具
- git(风中叶新版).txt
- DigitalVisualFortran5.0.txt
评论
共有 条评论