This commit is contained in:
Stephan Raabe 2023-05-11 13:18:52 +02:00
parent faf4589b8a
commit 873a53d7e8
2 changed files with 11 additions and 3 deletions

View File

@ -19,6 +19,7 @@ PS1='[\u@\h \W]\$ '
alias res1='xrandr --output DisplayPort-0 --mode 2560x1440 --rate 120'
alias res2='xrandr --output DisplayPort-0 --mode 1920x1080 --rate 120'
export PATH="/usr/lib/ccache/bin/:$PATH"
# -----------------------------------------------------
# ALIASES
@ -56,7 +57,7 @@ alias gpf="git stash; git pull"
# SCRIPTS
alias gr='python ~/dotfiles/scripts/growthrate.py'
alias chat='python ~/mychatgpt/mychatgpt.py'
alias ChatGPT='python ~/mychatgpt/mychatgpt.py'
alias ascii='~/dotfiles/scripts/figlet.sh'
# VIRTUAL MACHINE

View File

@ -10,14 +10,21 @@
# ---------------------------------------------------------------
import rich
import pyperclip
from rich.console import Console
from rich.prompt import FloatPrompt
# Show prompts
console = Console()
num1 = FloatPrompt.ask("Enter start value")
num2 = FloatPrompt.ask("Enter end value")
num1 = FloatPrompt.ask("Original value")
num2 = FloatPrompt.ask("New value")
# printing the sum in float
gr = ((num2-num1)/num1)
percentage = "{:.2%}".format(gr)
console.print(percentage, style="bold")
# copy result into the system clipboard
pyperclip.copy(percentage)
print("Output has been copied to the clipboard!")