Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating an Exe File
#1
I have created a simple game for my nephew. He wants to share the game with his friends.I have no clue on how to convert this into an exe file. Need assistance on how this simple game can be shared without requiring to have python installed on a computer.

#!/usr/bin/env python
import random
print("Lets play the Rock, Paper & Scissors Game")
print("..........................................")
choices=['rock','paper','scissors']
computer=random.choice(choices)

pscore=0
cscore=0

for x in range(5):
    player = input('Please select Rock, Paper or Scissors\n')
    if computer=='rock':
        if player=='paper':
            print('you have won!')
            pscore=pscore+1
            cscore=cscore+0
            print('The Computer chose ',computer)
        elif player=='scissors':
            print('you have lost')
            pscore=pscore+0
            cscore=cscore+1
            print('The Computer chose ', computer)
        else:
            print('its a draw')
            print('The Computer chose ', computer)
    elif computer=='scissors':
        if player=='rock':
            print('you have won!')
            pscore=pscore+1
            cscore=cscore+0
            print('The Computer chose ', computer)
        elif player=='paper':
            print('you have lost')
            pscore=pscore+0
            cscore=cscore+1
            print('The Computer chose ', computer)
        else:
            print('its a draw')
            print('The Computer chose ', computer)
    else:
        if player=='scissors':
            print ('you have won!')
            pscore=pscore+1
            cscore=cscore+0
            print('The Computer chose ', computer)
        elif player=='rock':
            print('you have lost')
            pscore=pscore+0
            cscore=cscore+1
            print('The Computer chose ', computer)
        else:
            print('its a draw')
            print('The Computer chose ', computer)

print('Computer Score',cscore)
print('Player Score',pscore)

if cscore > pscore:
    print('You Lost!!,')
elif cscore < pscore:
    print('You win!')
else:
    print('its a draw')
Reply
#2
see: https://pypi.org/project/pyinstall/
and: https://medium.com/dreamcatcher-its-blog...df9170e263
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help creating shell scrip for python file marciokoko 10 1,418 Sep-16-2023, 09:46 PM
Last Post: snippsat
  Creating csv files from Excel file azizrasul 40 5,856 Nov-03-2022, 08:33 PM
Last Post: azizrasul
  Creating file with images BobSmoss 1 1,404 Jan-08-2022, 08:46 PM
Last Post: snippsat
  Creating csv file from another file pisike 0 1,618 Nov-24-2020, 02:02 PM
Last Post: pisike
  Creating Conda env from requirments.txt file ErnestTBass 7 15,831 Apr-23-2020, 06:57 PM
Last Post: snippsat
  Creating a pdf from file DT2000 4 2,352 Apr-03-2020, 07:16 PM
Last Post: DT2000
  Internal Server Error 500 on creating .py file patrickluethi 0 1,773 Aug-02-2019, 01:57 PM
Last Post: patrickluethi
  Creating Dictionary form LOG /text file DG1234 7 5,533 Feb-13-2019, 08:08 PM
Last Post: DG1234
  error creating new object after loading pickled objects from file arogers 2 3,469 Feb-02-2019, 10:43 AM
Last Post: Larz60+
  File creating with question mark quffix pythonbabe 2 2,861 Nov-23-2018, 12:05 PM
Last Post: pythonbabe

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020