#! /home/mehmet/anaconda3/bin/python3
from os import pipe, sep
import os
import time
import math
os.system("figlet SAYI BULMACA")
rakam1 = [[1,3,5,7,9,11,13,15],
[17,19,21,23,25,27,29,31],
[33,35,37,39,41,43,45,47],
[51,53,55,57,59,61,63]]
rakam2 = [[2,3,6,7,10,11,14,15],
[18,19,22,23,26,27,30,31],
[34,35,38,39,42,43,46,47],
[50,51,54,55,58,59,62,63]]
rakam3 = [[4,5,6,7,12,13,14,15],
[20,21,22,23,28,29,30,31],
[36,37,38,39,44,45,46,47],
[52,53,54,55,60,61,62,63]]
rakam4 = [range(8,16),
range(24,32),
range(40,48),
range(56,64)]
rakam5 = [range(16,24),
range(24,32),
range(48,56),
range(56,64)]
rakam6 = [range(32,40),
range(40,48),
range(48,56),
range(56,64)]
time.sleep(2)
print("""
Sayı bulmaca oyunumuza hoş geldiniz.
Şimdi sizden aklınızda 1 ve 63 dahil olacak şekilde
1'den 63'e kadar bir sayı tutmanızı istiyorum.
Sonrasında siz bir takım sayılar göstereceğim ve tuttuğunuz sayının
gördüğünüz sayılar içerisinde olup olmadığını soracağım.
Bu şekilde tuttuğunuz sayıyı bulmayaca çalışacağım.
""")
tahmin_basla = input("Aklınızdan bir sayı tuttunuz mu?\nE/H\nBitirmek için H'ye basabilirsiniz\n")
skor = []
sayi = 0
while sayi < 1:
if tahmin_basla == "e":
print("İyi eğlenceler dilerim")
else:
print("Oyunu bitiriyorum")
break
for i in rakam1:
print(*i)
tahmin1 = input("Tutuğunuz sayı bu rakamlar içerisinde var mı?\nVAR(V) / YOK(Y)\n")
if tahmin1 == "v":
skor.append(int(1))
time.sleep(1)
for i in rakam2:
print(*i)
tahmin2 = input("Tutuğunuz sayı bu rakamlar içerisinde var mı?\nVAR(V) / YOK(Y)\n")
if tahmin2 == "v":
skor.append(int(2))
time.sleep(1)
for i in rakam3:
print(*i)
tahmin3 = input("Tutuğunuz sayı bu rakamlar içerisinde var mı?\nVAR(V) / YOK(Y)\n")
if tahmin3 == "v":
skor.append(int(4))
time.sleep(1)
for i in rakam4:
print(*i)
tahmin4 = input("Tutuğunuz sayı bu rakamlar içerisinde var mı?\nVAR(V) / YOK(Y)\n")
if tahmin4 == "v":
skor.append(int(8))
time.sleep(1)
for i in rakam5:
print(*i)
tahmin5 = input("Tutuğunuz sayı bu rakamlar içerisinde var mı?\nVAR(V) / YOK(Y)\n")
if tahmin5 == "v":
skor.append(int(16))
time.sleep(1)
for i in rakam6:
print(*i)
tahmin6 = input("Tutuğunuz sayı bu rakamlar içerisinde var mı?\nVAR(V) / YOK(Y)\n")
if tahmin6 == "v":
skor.append(int(32))
time.sleep(1)
bildin = sum(skor)
print("Şimdi tahmin etmeye çalışıyorum...")
time.sleep(3)
print(f"Tuttuğunuz sayı : {bildin}\n"
"Oynadığınız için teşekkürler\n")
time.sleep(1)
sayi =+ 1
if sayi == 1:
sorucevap = input("Tekrar Oynamak ister misiniz?\nE/H\n")
if sorucevap == "e":
sayi = 0
else:
print("Görüşmek üzere....")
break
Hello, I'm working with the Python language as an amateur, and a few months ago, I decided to use Ubuntu after Windows 10 and switched. Of course, I also know how to use Linux distributions at the beginner level.
I prepared the code you see above with Visual Studio Code and saved it with a .py extension.
My goal is to:
As in Windows, I want the code to run by double-clicking the file and close it after a person uses it. When running, it does not matter whether it is a window or a terminal screen.
First of all, I have to point out that I tried several ways for this process:
pyinstaller -F filename.pyI created an exe into dist / file it didn't work.I tried it with
chmod u + x filename.I activated the ask option when opening the properties. I don't want him to ask me what will happen after double-clicking
I created a file with a .desktop extension. I have pasted codes into it (I don't know if the codes are correct.)
As a result, I could not do anything.
Can someone please explain in detail what to do?