GithubHelp home page GithubHelp logo

hanzephyr / minecraft-rcon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redroadsl/minecraft-rcon

0.0 0.0 0.0 10 KB

一个用Python写的轻量级Minecraft服务端rcon连接器。

License: MIT License

Python 100.00%

minecraft-rcon's Introduction

Minecraft-Rcon

Python的版本:3.x

轻量级Minecraft服务端rcon连接器。

Minecraft服务端远程命令(RCON)模板

	老咩友情提醒您:
	道路千万条,
	规范第一条。
	写码不规范,
	维护两行泪。

推荐你使用python的'with'语句!
这样可以确保及时的关闭连接,而不是被遗漏。
'with'语句例子:
In [1]: from mcrcon import MCRcon
In [2]: with MCRcon("这是一个ip", "这是rcon的密码","这是Rcon的端口" ) as mcr:
   ...:     resp = mcr.command("/发送给服务端的指令")
   ...:     print(resp) #输出

  两行泪方式:
  你当然也可以不用python的'with'语句,但是一定要在建立连接后,及时的断开连接。
In [3]: mcr = MCRcon("这是一个ip", "这是rcon的密码","这是Rcon的端口" )
In [4]: mcr.connect() #连接建立
In [5]: resp = mcr.command("/发送给服务端的指令")
In [6]: print(resp) #输出
In [7]: mcr.disconnect() #断开连接

minecraft-rcon's People

Contributors

yinglanxing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.