首页 文章 精选 留言 我的

精选列表

搜索[加密工具],共10000篇文章
优秀的个人博客,低调大师

[雪峰磁针石博客]大数据Hadoop工具python教程2-python访问HDFS

https://pypi.org/project/hdfs3 已经不维护PyArrowhttps://pypi.org/project/hdfs/https://pypi.org/project/snakebite/ python2中比较好,对python3支持不好。 hdfs和PyArrow比较常用,这里以hdfs为例: 快速入门 from hdfs import InsecureClient client = InsecureClient('http://localhost:50070', user='hduser_') fs_folders_list = client.list("/") print(fs_folders_list) with client.read('/user/hduser/input.txt', enco

优秀的个人博客,低调大师

[雪峰磁针石博客]python数据结构基础工具书籍下载-持续更新

算法图解 - 2017.pdf 本书示例丰富,图文并茂,以让人容易理解的方式阐释了算法,旨在帮助程序员在日常项目中更好地发挥算法的能量。书中的前三章将帮助你打下基础,带你学习二分查找、大O表示法、两种基本的数据结构以及递归等。余下的篇幅将主要介绍应用广泛的算法,具体内容包括:面对具体问题时的解决技巧,比如,何时采用贪婪算法或动态规划;散列表的应用;图算法;Kzui近邻算法。 数据结构与算法__Python语言描述-2015.pdf 本书基于Python语言介绍了数据结构与算法的基本知识,主要内容包括抽象数据类型和Python面向对象程序设计、线性表、字符串、栈和队列、二叉树和树、集合、排序以及算法的基本知识。本书延续问题求解的思路,从解决问题的目标来组织教学内容,注重理论与实践的并用。 Python算法教程 - 2016.pdf Python是一种面向对象、解释型计算机程序设计语言,其应用领域非常广泛,包括数据分析、自然语言处理、机器学习、科学计算以及推荐系统构建等。 本书用Python语言来讲解算法的分析和设计。本书主要关注经典的算法,但同时会为读者理解基本算法问题和解决问题打下很好的基础。全书共11章。分别介绍了树、图、计数问题、归纳递归、遍历、分解合并、贪心算法、复杂依赖、Dijkstra算法、匹配切割问题以及困难问题及其稀释等内容。本书在每一章结束的时候均有练习题和参考资料,这为读者的自我检查以及进一步学习提供了较多的便利。在全书的结尾,给出了练习题的提示,方便读者进行查漏补缺。 本书概念和知识点讲解清晰,语言简洁。本书适合对Python算法感兴趣的初中级用户阅读和自学,也适合高等院校的计算机系学生作为参考教材来阅读。 参考资料 讨论qq群144081101 591302926 567351477 钉钉免费群21745728 本文最新版本地址 本文涉及的python测试开发库 谢谢点赞! 本文相关海量书籍下载 Python Data Structures and Algorithms - 2017.pdf Python Algorithms, 2nd Edition 2014.pdf Problem Solving with Algorithms and Data Structures Release 3.0 - 2013.pdf Problem Solving in Data Structures and Algorithms Using Python - 2016.pdf Practical Programming An Introduction to Computer Science Using Python (Pragmatic Programmers) 2009.pdf grokking algorithms - 2016.pdf Fundamentals of Python From First Programs Through Data Structures - 2010.pdf Fundamentals of Python - Data Structures - 2014.pdf Data Structures and Algorithms with Python(Springer,2015).pdf Data Structures and Algorithms Using Python - 2011.pdf Data Structures and Algorithms in Python - 2013.pdf Data Structures And Algorithmic Thinking With Python - 2016.pdf https://github.com/prakhar1989/Algorithms https://github.com/PacktPublishing/Python-Data-Structures-and-Algorithms

优秀的个人博客,低调大师

[雪峰磁针石博客]python工具库介绍-dubbo:通过telnet接口访问dubbo服务

## 简介 dubbo服务发布之后,我们可以利用telnet命令进行调试、管理。更多资料参见 [Telnet命令参考手册](http://alibaba.github.io/dubbo-doc-static/Telnet+Command+Reference-zh-showComments=true&showCommentArea=true.htm) telnet 调用示例: ```python $ telnet 172.17.103.110 9097 Trying 172.17.103.110... Connected to 172.17.103.110. Escape character is '^]'. dubbo>ls com.oppo.sso.service.onekey.IOnekeyRegister register dubbo>invoke com.oppo.sso.service.onekey.IOnekeyRegister.register({"applicationKey":"mac","imei":"","mobile":"13244448888","createIP":"127.0.0.1","createBy":"172.17.0.1"}) {"configCountry":null,"userIdLong":0,"appPackage":null,"appVersion":null,"accountName":null,"romVersion":null,"resultCode":3001,"thirdStatus":null,"registerType":0,"sendChannel":null,"operator":null,"manufacturer":null,"password":null,"osVersion":null,"lock":false,"model":null,"visitorLocked":false,"OK":false,"brand":null,"email":null,"createIP":null,"deny":false,"encryptEmail":null,"sessionKey":null,"thirdId":null,"passwordOriginal":null,"mobile":null,"applicationKey":null,"thirdpartyOk":false,"userAgent":null,"userName":null,"resultDesc":"应用不存在","userId":0,"encryptMobile":null,"emailStatus":null,"createBy":null,"freePwd":false,"changeTimes":0,"createTime":null,"mobileStatus":null,"oldLock":false,"codeTimeout":null,"lastUpdate":null,"imei":null,"sessionTimeout":0,"sdkVersion":null,"networkID":0,"status":null} elapsed: 98 ms. dubbo> ``` ## Python实现 源码: ```python """ Name: dubbo.py Tesed in python3.5 """ import json import telnetlib import socket class Dubbo(telnetlib.Telnet): prompt = 'dubbo>' coding = 'utf-8' def __init__(self, host=None, port=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): super().__init__(host, port) self.write(b'\n') def command(self, flag, str_=""): data = self.read_until(flag.encode()) self.write(str_.encode() + b"\n") return data def invoke(self, service_name, method_name, arg): command_str = "invoke {0}.{1}({2})".format( service_name, method_name, json.dumps(arg)) self.command(Dubbo.prompt, command_str) data = self.command(Dubbo.prompt, "") data = json.loads(data.decode(Dubbo.coding, errors='ignore').split('\n')[0].strip()) return data if __name__ == '__main__': conn = Dubbo('172.17.103.110', 9097) json_data = { "applicationKey":"mac", "imei":"", "mobile":"13244448888", "createIP":"127.0.0.1", "createBy":"172.17.0.1" } result = conn.invoke( "com.oppo.sso.service.onekey.IOnekeyRegister", "register", json_data ) print(result) ``` 执行结果: ```python # python3 dubbo.py {'manufacturer': None, 'applicationKey': None, 'OK': False, 'codeTimeout': None, 'password': None, 'encryptEmail': None, 'passwordOriginal': None, 'thirdId': None, 'emailStatus': None, 'freePwd': False, 'sessionTimeout': 0, 'createTime': None, 'osVersion': None, 'lastUpdate': None, 'email': None, 'sdkVersion': None, 'registerType': 0, 'sendChannel': None, 'visitorLocked': False, 'createIP': None, 'thirdStatus': None, 'encryptMobile': None, 'networkID': 0, 'resultCode': 3001, 'brand': None, 'changeTimes': 0, 'userAgent': None, 'imei': None, 'operator': None, 'romVersion': None, 'model': None, 'lock': False, 'sessionKey': None, 'configCountry': None, 'deny': False, 'userIdLong': 0, 'resultDesc': '应用不存在', 'status': None, 'createBy': None, 'thirdpartyOk': False, 'appPackage': None, 'appVersion': None, 'accountName': None, 'userId': 0, 'oldLock': False, 'userName': None, 'mobile': None, 'mobileStatus': None} ``` 更复杂的例子。 源码: ```python import json import telnetlib import socket class Dubbo(telnetlib.Telnet): prompt = 'dubbo>' coding = 'gbk' def __init__(self, host=None, port=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): super().__init__(host, port) self.write(b'\n') def command(self, flag, str_=""): data = self.read_until(flag.encode()) self.write(str_.encode() + b"\n") return data def invoke(self, service_name, method_name, arg): command_str = "invoke {0}.{1}({2})".format( service_name, method_name, json.dumps(arg)) self.command(Dubbo.prompt, command_str) data = self.command(Dubbo.prompt, "") data = json.loads(data.decode(Dubbo.coding, errors='ignore').split('\n')[0].strip()) return data if __name__ == '__main__': conn = Dubbo('183.131.22.99', 21881) content = { "sign": "FKeKnMEPybHujjBTzz11BrulB5av7pLhJpk=", "partnerOrder": "0511e0d38f334319a96920fa02be02a7", "productDesc": "hello", "paySuccessTime": "2016-08-25 18:33:04", "price": "1", "count": "1", "attach": "from_pay_demo", "date": "20160825", } content_json = json.dumps(content).replace('"', '\\"') json_data = { "requestId": "0511e0d38f334319a96920fa02be02a7", "reqUrl": 'http://www.oppo.com', "httpReqType": "POST", "headerMap": None, "reqContent": content_json, "appId": "10001", "productName": "test", "timeStamp": "1472121184957", "partnerId": "2031", "signType": "MD5", "sign": "23B621FBBF887373C65E553C2222258F", "successResult": "OK", } result = conn.invoke( "com.oppo.pay.notify.api.facade.NotifyApplyService", "httpNotify", json_data ) print(result) ``` 执行结果: ```python $ python3 dubbo.py {'resMsg': 'ǩ', 'data': None, 'errorDetail': 'sign check fail!', 'resCode': '100003', 'success': False} ``` ## 待改进 * 进行多个项目的实验,增加异常处理 ## 参考资料 - [本文最新版本地址](https://china-testing.github.io/python3_lib_dubbo.html) - [本文涉及的python测试开发库](https://github.com/china-testing/python-api-tesing) 谢谢点赞! - [本文相关海量书籍下载](https://github.com/china-testing/python-api-tesing/blob/master/books.md) - [本文源码地址](https://github.com/china-testing/python-api-tesing/tree/master/python3_libraries/_dubbo)

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册