Distributed and decentralized pi calculation
at main 28 lines 2.3 kB view raw
1import os.path 2print("Welcome to Pistributed Server Setup.") 3print("Do not run on unsecure or slow servers. Do not run on servers you don't own or have control over*. You may get lots of requests to your server. This depends if lots of people are using your Pistributed server.") 4print("*having control over requires permission if there is a server owner that isn't yourself.") 5print("""This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 6 7This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 8 9You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.""") 10print("By continuing, you agree to these terms, disclaimers, and acknowledge that there is NO WARRANTY.") 11print("Security is not guarenteed. I am not responsible for ANY damages or attempts of damages to ANY computer, phone, or device running Pistributed's client or server.") 12input("I agree, and would like to continue. (to continue, press enter)") 13email = input("What email would you like to display for server support? THIS WILL BE MADE PUBLIC ") 14called = input("What would you like to be called? (ex: Wish) THIS WILL BE MADE PUBLIC ") 15multi = input("What would you like Pi to be multiplied by? (number ONLY, default is 1)") or 1 16print("Thank you! Creating a .env file... Make sure to run server.py when you are ready!") 17with open(".env", "w") as file: 18 file.write("EMAIL=" + email + "\nNAME=" + called + "\nMULTI=" + multi) 19isExist = os.path.exists("picalc") 20if not isExist: 21 os.makedirs("picalc") 22 print("Picalc not found, creating") 23with open("picalc/pi.txt", "w") as pifile: 24 pifile.write("No clients have connected yet. Become one of the first!") 25 print("Created picalc/pi.txt successfully. Do NOT edit this file!") 26with open("ver.txt", "w") as versionfile: 27 versionfile.write("1.7") 28 print("Created version file. Server will not work without this!!!")