Comments (3)
This one-liner should help:
>>> plugins
['GrieferGamesBan 1.0', 'WorldEdit 6.1.2,b3fbe8b', 'Prefix 2.1.3', 'VoteKick 2.0', 'RankSigns 0.7.2', 'PermissionsEx 1.23.4', 'GrieferGames 3.0', 'PlugMan 2.1.5', 'SetSpawn 3.1', 'MOTD 2.3.2', 'ViaVersion 2.0.1', 'Tablist 1.3.2.9', 'Vault 1.5.5-b47', 'ProtocolLib 4.4.0', 'WorldGuard 6.1', 'NoCheatPlus 3.16.0-RC-sMD5NET-b1134', 'Essentials 2.0.1-b171', 'AntiTab 2.3', 'JoinMessagePlus 3.1', 'PlotSquared 3.5.0-SNAPSHOT-2b561f2', 'Multiverse-Core 2.5-b717', 'AuthMe 5.6.0-beta1-b2226', 'HolographicDisplays 2.1.11']
>>> ", ".join([plugin.split(" ")[0] for plugin in plugins])
'GrieferGamesBan, WorldEdit, Prefix, VoteKick, RankSigns, PermissionsEx, GrieferGames, PlugMan, SetSpawn, MOTD, ViaVersion, Tablist, Vault, ProtocolLib, WorldGuard, NoCheatPlus, Essentials, AntiTab, JoinMessagePlus, PlotSquared, Multiverse-Core, AuthMe, HolographicDisplays'
from mcstatus.
It would appear that each plugin name and version is separated by a space. Will you try using name, version = plugin.split(" ")
on each plugin?
>>> name, version = "Foo 1.0".split(" ")
>>> name
'Foo'
>>> version
'1.0'
from mcstatus.
It would appear that each plugin name and version are separated by a space. Will you try using
name, version = plugin.split(" ")
Does not work in Python as the query brings back plugin as a list. For Example:
['CoreProtect 2.16.3', 'EditableSign 5.5.2', 'VeinMiner 1.14.0', 'ChestSort 5.0.2']
We can just iterate over it tho with for example
plugins = ""
plugins_versions = query.software.plugins # ex. Veinminer 2.5
for i in plugins_versions:
plug = i.split(" ")
plugins = plug[0] + ", " + plugins
plugins = plugins[:-2] #cut the last , and space
This gives us plugins as a String that we can directly use
CoreProtect, EditableSign, VeinMiner, ChestSort
I am pretty sure that there is a prettier solution for this, but I am quite the noob in python so I apologize.
from mcstatus.
Related Issues (20)
- MCSTATUS raw HOT 2
- Can't ping server on Termux HOT 5
- How do I run mcstatus? HOT 1
- status.version does not have a sensible string representation HOT 3
- Drop support for python 3.6
- Decode ISO 8859-1 into UTF-8
- minecrafBedrockServer failing to connect to a server HOT 5
- TypeError: an integer is required (got type NoneType) HOT 2
- Community Chat? HOT 2
- Key existence for COLOR_MAP is not being checked HOT 3
- Complex Description Styles are lacking test coverage HOT 3
- How to get server name / motd ?
- Update click to 8.0.0 HOT 2
- Raising errors on invalid ip requires rewrite of client logic HOT 15
- Support multiple types of formatting for MOTD
- Synchronous operations inside async functions HOT 1
- To replace sync 'dns.resolver.resolve' with `dns.asyncresolver` HOT 1
- UDPAsyncSocketConnection cannot write anything special itself HOT 3
- Unable to use module in a python script HOT 5
- Getting timeout for status.plays.online HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcstatus.