Created
March 28, 2024 18:27
-
-
Save sulincix/b66acdb684170246345dadd50f9e05b9 to your computer and use it in GitHub Desktop.
31 power calculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import gi | |
gi.require_version("Gtk", "3.0") | |
from gi.repository import Gtk, GLib | |
main = Gtk.Window() | |
button = Gtk.Button() | |
label = Gtk.Label() | |
stack = Gtk.Stack() | |
count = 0 | |
def stop(): | |
global count | |
stack.set_visible_child_name("finish") | |
status = "" | |
if count < 50: | |
status = "anime kızı" | |
elif count < 80: | |
status = "idare eder" | |
elif count < 100: | |
status = "erkek adam" | |
else: | |
status = "gerçek 31ci" | |
label.set_text("Sonuç:"+ str(count/10.0)+" cp/s\n"+ status) | |
count = 0 | |
def cps(widget): | |
global count | |
if(count == 0): | |
GLib.timeout_add(10000, stop) | |
count+=1 | |
widget.set_label(str(count)) | |
main.add(stack) | |
stack.add_named(button, "start") | |
stack.add_named(label, "finish") | |
main.show_all() | |
main.set_size_request(400, 400) | |
button.connect("clicked", cps) | |
Gtk.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment