Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
i have Ubuntu Server machine running Minecraft Server to play with my friends and stuff, but i am bored and i want to make simple python app in console to display server status, like current number of connected players, difficulty, world seed, RAM used and stuff... my question is, if its possible to get this data from MC server application, and if then how. Mainly i am interested about live player data (count, names, probably posotion), chat feed etc.. I didnĀ“t tried anything because i have no idea where to start :D
thanks
-N
Maybe you were looking for something like this:
https://github.com/Dinnerbone/mcstatus
Edit:
The module is named "mcstatus" and provides a "A Python class for checking the status of an enabled Minecraft server".
You can install it via pip: pip install mcstatus
It provides three modes of access (query, status and ping), the differences of which are listed on the page of this link.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Is there any way, through code, to prevent your app from idling? I'm thinking something like what is being done here. How to do this through code, but in python/django as that is what my app is done in, i.e. what is the equivalent in python to Node's setInterval. What are the disadvantages of using a pinging service over doing it through code(other than if the site goes down your app wont get pinged). Can you recommend a good pinging service? Thanks in advance.
You cannot do it from within the application. It needs to be woken up "externally". This can be just another Heroku application but that kind of defeats the purpose. There are some Heroku add ons that allow you to monitor your website thus also pinging it in regular intervals.
For example:
https://elements.heroku.com/addons/newrelic
With this your website would always stay awake.
The article you linked is imo more complicated than necessary. If you own a VPS you could host your website there. You could also write a curl command save it as a shell script and call it from cron (https://help.ubuntu.com/community/CronHowto).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am looking to create a simple online multiplayer game. Each player choose a number as their input and get a result based on simple calculations as their output. The code for the game itself is already created in VBA, but i am looking to make it online. Could i use Python for that, and do i need to create a website?
Online for public use or to share with someone specific (friend or someone else)?
If it is with a friend you could try rerouting traffic from your router to you PC with a specific port. Then create a simple website (with Flask for example, as it uses python) to make the game playable. Finally others could play the game by accessing your website through your public IP.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am attempting to make a python a "buzzer" application which will function like the buzzers in jeopardy. It will (hopefully) work by linking several computers to a main computer. When a user taps the screen of their computer, if they are the first, it will change the color of their screen and alert the main computer. Now for my question: when module would be best to like together these two computer. I would need to send the name of the computer and a timestamp and the main computer would need to respond. I was reading that something like socket might work, but i am unsure. Also, could you please give me a link to documentation on whatever module you suggest. Thanks!
You mentioned socket in your question.
https://docs.python.org/3/library/socket.html
This might be appropriate for your needs, however with multiple clients it can get quite complicated.
Also, you may want to try using email for easier connections (if you don't mind the send time of a few seconds). I know it sounds stupid, but it has worked for me in the past, with significantly less difficulty than a multi-threaded socket connection.
https://docs.python.org/3/library/email.html
https://docs.python.org/3/library/smtplib.html
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am developing a paid program in Python with Tkinter. How can I make the program user-specific. I don't want people sharing their license. If there is no better option than serial keys. What is the best way of doing this? Doesn't have to be top of the line security. Just don't want people to share their license..
You could embed the machine ID and user ID in your code to check at startup.
import getpass
userID = getpass.getuser()
import socket
machineID = socket.gethostname()
Also see (not verified but here it goes): Getting computer hardware information
Also at the Windows command prompt, you can use systeminfo which will give you the whole computer information. From Python you can run os.system('systeminfo > lolo.txt') which will display and pipe to the text file.
I was looking a the same problem you have. Hope it helps
If you want to use python to write code, but keep embedded secrets, your best bet will be to compile to binary and ship only binary to users. PyInstaller is a good place to start your research. There are several alternatives to PyInstaller.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a python web-crawler that get info and put it in SQL. Now I also have php page, that read this info from the SQL, and represent it. The problem is: in order that the crawler program to work, my computer has to stay 24/7 working. I have simple home computer- so its a problem. Does there is a diffrent way to run the web-crawler? Or do I have to run it on my pc?
If you are monitoring pages that get updated constantly then yes you will need to run it on some computer that is on 24/7. You can either use a cron job or a continuous loop (with some monitoring). If you don't want to run it on your home machine, I would recommend getting a free AWS account. You can get an EC2 micro instance which will allow you to run your python script and an S3 database instance which will allow you to store the information.
Here is a link to AWS