[PYTHON] I made a fucking app that won't let you skip

What kind of app

If the default is 5 minutes, or if there is no fraction key type specified at startup, the following screen will be displayed assuming that there is a possibility of skipping.

スクリーンショット 2019-12-11 16.21.02.png

If you press the x button to turn off this screen, monitoring will start again.

Since it is not converted to exe or app, please execute it from the command line on a PC with Python 3.7 installed.

Turn it off when starting work without a key type, such as MTG or presentation.

Method of operation

Please download the source from the following.

https://github.com/anchor-cable/stupidapp

Start-up

sudo python3 main/watch_keyboard.py 1

I needed administrator privileges to monitor the keyboard with the keyboard library ... (I haven't done anything wrong to my knowledge, but I can't take responsibility for anything **)

Argument 1 is the monitoring time (minutes). If omitted, the default 5-minute monitoring is used. The argument cannot have a decimal point.

Work normally

Please work normally as it is an app for working normally. If there is no key type during the monitoring time, the opening screen is displayed.

Technology story

Loop for monitoring

I wrote the following in recursion.

    def watch(self,timeout_count):
        typed_pool = []
        keyboard.start_recording()
        time.sleep(60)
        typed_pool = keyboard.stop_recording()
        if len(typed_pool) == 0:
            timeout_count += 1
        else:
            timeout_count = 0
        if timeout_count <= self.watch_minutes:
            self.watch(timeout_count)

I try to display a pop-up window when I break out of the loop.

A device for pop-up windows

root.protocol("WM_DELETE_WINDOW", self.main())

It is extremely troublesome to start it again on the command line after pressing the × button. Before returning to work after being pointed out to skip, I tried to run the process from the beginning.

Impressions

If you just want to make a simple screen, tkinter is good. If you do your best, you can make it a desktop application.

Shit irrelevant digression 1 Birth secret story

"Ah, the deadline for fucking app ad-care is near" "The app I originally thought about was released last year, so I decided to put it in storage ..." "What should I make ..."

(40 minutes later)

"Huh!" "I've been watching ** Twitter ** all the time" "I'm going to drop it as it is ... but I don't understand the language that can be written in GUI, and I can't do advanced things like machine learning." "... Is it a CLI tool?" "I wonder if I could make a CLI tool that prohibits skipping."

Damn it doesn't matter aside 2 Development hardship story

In order to check the operation of this, I had to leave it for 1 minute without inputting it many times, and each time I felt like "Hey, don't skip ...!".

Recommended Posts

I made a fucking app that won't let you skip
〇✕ I made a game
I made a net news notification app with Python
I made a VM that runs OpenCV for Python
I made a twitter app that decodes the characters of Pricone with heroku (failure)
I made a system that allows you to tweet just by making a phone call
I made a LINE BOT that returns parrots with Go
I made a class that easily performs unixtime ← → datetime conversion
I made a rigid Pomodoro timer that works with CUI
I made a python text
I made a discord bot
I made a muscle training estimation app using Qore SDK
I made a plug-in that can "Daruma-san fell" with Minecraft
I made you to execute a command from a web browser
I made a neural network generator that runs on FPGA
[Python] I made a Line bot that randomly asks English words.
[Python3] I made a decorator that declares undefined functions and methods.
I made a package that can compare morphological analyzers with Python
I made a program that solves the spot the difference in seconds
I made a Twitter bot that mutters Pokemon caught by #PokemonGO
I made a LINE stamp where you can study Linux commands
I made a shuffle that can be reset (reverted) with Python
I made a lo command that is more useful than ls
Let's create a Python directory structure that you won't regret later
I made a slack bot that notifies me of the temperature
I made a library that adds docstring to a Python stub file.
I made a program that automatically calculates the zodiac with tkinter
[python] I made a class that can write a file tree quickly
I made a C ++ learning site
I made a Line-bot using Python!
I made a CUI-based translation script (2)
I made a wikipedia gacha bot
I made a fortune with Python.
I made a CUI-based translation script
I made a daemon with Python
I made a web application that converts photos into Van Gogh's style
I made a calendar that automatically updates the distribution schedule of Vtuber
[Python] I made a decorator that doesn't seem to have any use.
I made a web application in Python that converts Markdown to HTML
I made a Discord bot in Python that translates when it reacts
[Python] I made a utility that can access dict type like a path
I made a program to notify you by LINE when switches arrive
I made a Chrome extension that displays a graph on an AMeDAS page
I made a simple timer that can be started from the terminal
I made a library konoha that switches the tokenizer to a nice feeling
I made a tool that makes decompression a little easier with CLI (Python3)
[IOS] I made a widget that displays Qiita trends in Pythonista3. [Python]
I made a module PyNanaco that can charge nanaco credit with python
I made a new AWS S3 bucket
I made something that moves (wider range)
I made a dash docset for Holoviews
I made a payroll program in Python!
I touched "Orator" so I made a note
I made a character counter with Python
I made an online frequency analysis app
Beginner: I made a launcher using dictionary
I made a conversation partner like Siri
I made a script to display emoji
I made a Hex map with Python
I made a life game with Numpy
I made a stamp generator with GAN