1

I've done a project and i want to send it to my friends to see and try

The problem is that once I make it an executable file i can t send it anywhere

They don t have python install so i can't just send the files and i was wondering what are the possibilities to send the executable

I've tried to rename the file extension, send it, but he could not run it

I want to know if there is a chance that windows can't compile or open the executable if python is not install

here s the code in any case

from tkinter import *

tura=0

def golire(parent):
    for elemente in parent.winfo_children():
        elemente.grid_forget()

def terminare(parent,castigator,joc_nou):
    global tura
    tura=0
    golire(parent)
    afis=Label(parent,text=castigator+' a castigat!',font=('Arial',30),width=20,height=3)
    buton1=Button(parent,text='Din nou?',font=('Courier',10),width=5,height=5,command=joc_nou)
    buton2=Button(parent,text='Neah',font=('Courier',10),width=5,height=5,command=root.quit)

    afis.grid(columnspan=2,sticky=NSEW)
    buton1.grid(row=1,column=0,sticky=NSEW)
    buton2.grid(row=1,column=1,sticky=NSEW)

class joc:
    def __init__(self,parent):
        global tura

        tura=0

        self.parent=parent

        b0=Label(self.parent,text='',font=('Arial',30),width=7,height=3,relief='groove')
        b0.grid(row=0,column=0,sticky=NSEW)

        b1=Label(self.parent,text='',font=('Arial',30),width=7,height=3,relief='groove')
        b1.grid(row=0,column=1,sticky=NSEW)

        b2=Label(self.parent,text='',font=('Arial',30),width=7,height=3,relief='groove')
        b2.grid(row=0,column=2,sticky=NSEW)

        b3=Label(self.parent,text='',font=('Arial',30),width=7,height=3,relief='groove')
        b3.grid(row=1,column=0,sticky=NSEW)

        b4=Label(self.parent,text='',font=('Arial',30),width=7,height=3,relief='groove')
        b4.grid(row=1,column=1,sticky=NSEW)

        b5=Label(self.parent,text='',font=('Arial',30),width=7,height=3,relief='groove')
        b5.grid(row=1,column=2,sticky=NSEW)

        b6=Label(self.parent,text='',font=('Arial',30),width=7,height=3,relief='groove')
        b6.grid(row=2,column=0,sticky=NSEW)

        b7=Label(self.parent,text='',font=('Arial',30),width=7,height=3,relief='groove')
        b7.grid(row=2,column=1,sticky=NSEW)

        b8=Label(self.parent,text='',font=('Arial',30),width=7,height=3,relief='groove')
        b8.grid(row=2,column=2,sticky=NSEW)

        def enter(event):
            event.widget.config(bg='black')
        def left(event):
            event.widget.config(bg='white')

        def adaugare(event):
            global tura
            if event.widget['state']!='disabled':
                if tura%2==0:
                    event.widget.config(text='X')
                else:
                    event.widget.config(text='O')
                event.widget.config(state='disabled')
                tura+=1
        def verificare(event):
            def joc_nou():
                golire(self.parent)
                joc(self.parent)

            if b0['text']==b1['text']==b2['text'] and b0['state']==b1['state']==b2['state']=='disabled':
                terminare(self.parent,b0['text'],joc_nou)
            elif b3['text']==b4['text']==b5['text'] and b3['state']==b4['state']==b5['state']=='disabled':
                terminare(self.parent,b3['text'],joc_nou)
            elif b6['text']==b7['text']==b8['text'] and b6['state']==b7['state']==b8['state']=='disabled':
                terminare(self.parent,b6['text'],joc_nou)
            elif b0['text']==b3['text']==b6['text'] and b0['state']==b3['state']==b6['state']=='disabled':
                terminare(self.parent,b0['text'],joc_nou)
            elif b1['text']==b4['text']==b7['text'] and b1['state']==b4['state']==b7['state']=='disabled':
                terminare(self.parent,b1['text'],joc_nou)
            elif b2['text']==b5['text']==b8['text'] and b2['state']==b5['state']==b8['state']=='disabled':
                terminare(self.parent,b0['text'],joc_nou)
            elif b0['text']==b4['text']==b8['text'] and b0['state']==b4['state']==b8['state']=='disabled':
                terminare(self.parent,b0['text'],joc_nou)
            elif b2['text']==b4['text']==b6['text'] and b2['state']==b4['state']==b6['state']=='disabled':
                terminare(self.parent,b0['text'],joc_nou)
            elif b0['state']==b1['state']==b2['state']==b3['state']==b4['state']==b5['state']==b6['state']==b7['state']==b8['state']=='disabled':
                terminare(self.parent,'Nimeni',joc_nou)


        b0.bind("<Enter>",enter)
        b0.bind("<Leave>",left)

        b1.bind("<Enter>",enter)
        b1.bind("<Leave>",left)

        b2.bind("<Enter>",enter)
        b2.bind("<Leave>",left)

        b3.bind("<Enter>",enter)
        b3.bind("<Leave>",left)

        b4.bind("<Enter>",enter)
        b4.bind("<Leave>",left)

        b5.bind("<Enter>",enter)
        b5.bind("<Leave>",left)

        b6.bind("<Enter>",enter)
        b6.bind("<Leave>",left)

        b7.bind("<Enter>",enter)
        b7.bind("<Leave>",left)

        b8.bind("<Enter>",enter)
        b8.bind("<Leave>",left)

        b0.bind("<Button-1>",adaugare,add="+")

        b1.bind("<Button-1>",adaugare,add="+")

        b2.bind("<Button-1>",adaugare,add="+")

        b3.bind("<Button-1>",adaugare,add="+")

        b4.bind("<Button-1>",adaugare,add="+")

        b5.bind("<Button-1>",adaugare,add="+")

        b6.bind("<Button-1>",adaugare,add="+")

        b7.bind("<Button-1>",adaugare,add="+")

        b8.bind("<Button-1>",adaugare,add="+")

        #verificare
        b0.bind("<Button-1>",verificare,add="+")

        b1.bind("<Button-1>",verificare,add="+")

        b2.bind("<Button-1>",verificare,add="+")

        b3.bind("<Button-1>",verificare,add="+")

        b4.bind("<Button-1>",verificare,add="+")

        b5.bind("<Button-1>",verificare,add="+")

        b6.bind("<Button-1>",verificare,add="+")

        b7.bind("<Button-1>",verificare,add="+")

        b8.bind("<Button-1>",verificare,add="+")



if __name__=='__main__':
    root=Tk()
    joc(root)
    root.mainloop()
will
  • 143
  • 1
  • 2
  • 11
  • Does this answer your question? [How to make a Python script standalone executable to run without ANY dependency?](https://stackoverflow.com/questions/5458048/how-to-make-a-python-script-standalone-executable-to-run-without-any-dependency) – zardosht May 29 '20 at 14:52
  • @JohnColeman i know how to make an executable file i only want to share it with my friend so they can open it – will May 29 '20 at 15:09
  • If you know how to make an executable file which doesn't require the users to have Python installed, why are you asking the question? If it is a self-contained executable file, just e-mail it. – John Coleman May 29 '20 at 15:20
  • @JohnColeman i can't email it because no email or file transfering sites alow to send exe file – will May 29 '20 at 15:26
  • Use a `zip` utility? In any event, that is a separate question which seems more like a question for https://superuser.com/ than Stack Overflow. You are also factually incorrect when you say that *no* email or file transfer site allows executable files to be sent. – John Coleman May 29 '20 at 15:30

2 Answers2

0

You've got 2 options here:

  1. convince them to install python.
  2. package it using a tool like PyInstaller or py2exe, then send them the compiled executable
Huw Jones
  • 150
  • 1
  • 9
0

I always use PyInstaller for this, easy to install, easy to use

Sentouki
  • 85
  • 1
  • 9