Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added windows_color function to allow formatted text #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions rebound/rebound.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,15 @@ def _stylize_question(self, title, desc, stats):

## Helper Functions ##

# May not be necessary but I found that my environment needed this to be set up
# I don't know if this is needed for other OS
def windows_color():
"""Checks OS and sets Windows to utilize colored text in cmd."""
opSys = sys.platform

if opSys == "win32":
os.system('color') # Returns 1 when ran in python cmd but it works


def confirm(question):
"""Prompts a given question and handles user input."""
Expand Down Expand Up @@ -830,6 +839,7 @@ def print_help():


def main():
windows_color()
if len(sys.argv) == 1 or sys.argv[1].lower() == "-h" or sys.argv[1].lower() == "--help":
print_help()
elif sys.argv[1].lower() == "-q" or sys.argv[1].lower() == "--query":
Expand Down