avatarJim McAulay🍁 I'm nobody. Are you a nobody too?

Summary

The website provides instructions for creating a simple Python program to flip a coin or choose from a list of options using the IDLE interface on a Windows computer.

Abstract

The article titled "Flip A Coin From Your Desktop" explains how to create a desktop application using Python that can flip a coin or randomly select an option from a specified number of choices. It details a step-by-step process for users with Windows computers, where Python and its integrated development environment (IDLE) are pre-installed. The user is guided to write a short script that utilizes the random module to generate a random number based on the user's input. The program is then saved to the desktop for easy access. The article emphasizes the convenience of having such an application and the ease of creating it without the need for extensive programming knowledge.

Opinions

  • The author suggests that having a desktop application for making random choices is convenient.
  • The article implies that creating a simple program is accessible and can be done quickly, even by those who may not consider themselves programmers.
  • Python is highlighted as a user-friendly language for beginners, with the IDLE environment being particularly approachable for writing and running scripts.
  • The article seems to celebrate the simplicity of Python programming by showing how easily one can create a practical tool.
  • There is an implied appreciation for the humor and history of Python, as indicated by the mention of Eric Idle and Monty Python's Flying Circus in relation to the IDLE development environment.

Flip A Coin From Your Desktop

source: ICMA Photos [CC BY-SA 2.0 (https://creativecommons.org/licenses/by-sa/2.0)]

Wouldn’t it be great to have an app on your desktop that would flip a coin or make a choice from a list of x number of options.

You don’t need to look for an app you can create a simple program in a few minutes.

If you have windows the computer language Python is installed on your computer.

Here’s how to do it:

1. Search for “IDLE” on your computer. You can use Cortana just type in IDLE.

(Eric Idle was a script writer for Monty Python’s Flying Circus and Python was named after the show so the script writer that comes with python and Windows is called Idle)

2. Copy and paste the script below into IDLE.

import random
x = int (input(“How many ? “))
print (random.randint(1,x))
input (“ “)

3. From the file menu select save as.

4. Give your program a name such as “Flip a coin”.

5. Then select desktop.

6. Save.

To use the program click on “flip a coin”

A screen will appear with the words “How many”

Chose a number. 2 if you want to flip a coin.

20 if you want to make a choice from 20 different items.

A random number between 1 and the number you gave will appear on the screen.

The computer will wait. You hit a key and the screen will close.

This story is published in a Few Words, Medium’s publication that only accepts stories under 500 words.

If you have a few meaningful words to say and want to be a writer in our publication, visit here.

Python
Programming
Lifehacks
Jims Python
Recommended from ReadMedium