hi everyone welcome back to our another python tutorial and in this python tutorial i'm going
to show you how you guys can convert any python file into an executable file
and you can use this executable file like any other software in your computer
or you can share this executable file in social media or with your friends and in this tutorial
i am going to show you the easiest way to convert python files into an executable file
that's why guys pay attention throughout this entire video and if you guys are new in my channel
then please please subscribe like this video and press the bell icon for the future videos and if
you guys have any question about this tutorial you guys can comment below also let me know what
kinds of tutorials you want to see from me in my next video that's it guys let's get started
now at the first go to your start menu and then open your cmd after opening ur cmd
you just have to install a python module which is auto py to exe and now we have
to install this module in our computer so for installing we just have to write pip install
that's it and now type enter
so after installing this package in your computer you just have to open it so for opening this
package you just have to type the name which is auto py to exe that's it now type enter
and now here you can see that we have a different window here and by using this
window we will convert our python file into an executable file so here at the first you
can see that we have to actually select the file which we want to convert into an executable file
now guys in my python project playlist i have created two different applications one of them
was build an application using kivy and the second one was create a snake game using python and guys
if you didn't check out those tutorials yet go and check out i'll give you the link in
the description so for this tutorial i'm going to choose the snake game so now we have to actually
select the snake dot py file for this window so that's why from here we have to select browse
option and here you can see that i am in my snag folder and here i have only one file which is
snake game dot pi so now we have to select this file now open that's it so after this one we
have another option which is one file so this is the option for our output folder it means after
converting the python file do you want this python file to be with a folder or you want only the file
okay so for me i will just simply click on one file because i just only need the executable file
i don't need any other files so that's why one file and then our third option is console window
it means it is asking do you want console window also with this file okay now i don't want to add
any console window because i don't have any works in the console for this snake game so that's why
i don't need the console window and then here you can see that we have our icon option and
after adding an icon these icons will be looking like this one here you can see that we have some
icon here at the bottom in my taskbar so you can actually either choose any icon for this
executable file or you can skip that part also so now i have a icon and i want to import this icon
and in case if you don't know how to create an icon so i will show you that also
just go to your chrome browser and create a new tab and here search for png to icon that's it
now in my snack folder here you can see that i have my main file which is snake game dot pipe
and then we have a logo dot icon and then we have a logo.png first you have to create and
png image then you have to convert that image into an icon file okay so now if i open our
png file it will be looking like this one here you can see that i have a png file here and now
i have to convert this png file into an icon file so for doing this let's go to our chrome here and
from here we have to select the second link which is iconvert.com so open this link here and
now from here we have to actually select the file which we want to convert so now i want to convert
this png file into a logo.icon file so that's why click on logo.png and then click on upload
and here you can see that we have our png file now scroll down and from here we have to select icon
for windows 7 windows and and others also so we have to select this option and then from here we
have to select on convert icon so now your file is converted now you have to download this file
and you have to save this file into your project directory which is here and i have already done
this and i have a local.icon file here so now i want to add this icon file into our
here so now from here select the icon and then browse from here i have to select the icon file
that's it and then open now after this one we have another option here which is additional files
now in case if your python file needs to add other files other additional files so you can add
from here also but i have only our this snake dot pi game i don't have any other folder or file
with this one so that's why i don't need to add any files here
and then after here we have our advanced option and i don't think so we have to change anything
from here and then we have our setting option here and from this setting you can actually
select the output folder but i don't want to change the output folder from here so that's
why i don't want to change anything from the setting and then after everything we
have to just simply click on convert pi to exe that's it now i have to click on this button
and here you can see that they have started to converting our python file into an executable file
and this conversation can take time depending on your python file size
and guys here you can see that we have successfully converted our python file
into an executable file now we have to open our output folder
and guys here you can see that we have our executable file snakegame.exe now i will move
this file into our desktop that's it now move this file into our desktop and guys here you
can see that we have our snakegame.exe now let's open this executable file or software so that we
can check out our this game is working or not so now let's open this file and guys boom here you
can see that we have our snake game user interface and here you can see that we have our little tiny
snake and then we have our food here now i have to press any of the buttons from my keyboard
so now let's press any one of them and then let's start this game okay guys this game is working
okay guys here you can see that our snake game is now working and it is now running as an
independent executable file and we don't have any python code editor or any python environment here
we have an independent executable file and this file is working so beautifully and now let's
finish the game and here is my score which is 14. so guys here you can see that this method was so
easy using this method you can actually convert any of your python file to an executable file
and you guys can share these files with your friends in social media etc etc and
i hope you guys enjoyed this tutorial and if you guys really do then please please subscribe
like this video and press the bell icon for the future videos and if you guys have any question
about this video you guys can comment below also let me know what kinds of tutorial you
want to see from me in my next video that's it guys let's see you in our another tutorial you