Skip to content

sunCelery/async_pysimplegui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

async_pysimplegui

gif-program-demo

Table of content

Description

Program shows weather and next day forcast for given cites

It's also demonstrates how long it takes time for different methods of request

  • reatriev_weather button - do common synchronous requests to the weather server

  • retrieve_weather_async button - fulfill asynchronous requests to the server (which do not block UI and executes much faster)

  • retrieve_weather_thread button - make the requests in their own threaded, as pysimplegui docs proposes (these requests are fast and do not block UI either like async requests, but at demonstration You can see a delay caused probably by threading creation (or even more probably becayse this method need to be used inside common synchronous loop over asynchronous like here))

  • Clock - demonsrates either or not UI to be blocked by defferent methods

Install

Linux To install the app run one of these blocks in terminal:

  • if poetry:
git clone https://github.com/sunCelery/async_pysimplegui && \
cd async_pysimplegui && \
poetry install
  • elif pip:
git clone https://github.com/sunCelery/async_pysimplegui && \
cd async_pysimplegui && \
python -m venv .venv && source .venv/bin/activate && \
python -m pip install --upgrade pip && pip install .

Windows: after you clone repository go to the folder and run command in Your terminal:

py -m venv venv && venv\Scripts\activate ^
py -m pip install --upgrade pip && pip install .

probably instead 'py' You should type 'python'

Usage

You need 'APPID.txt' file with Your API-KEY in there for program to work

To launch the app run one of these blocks in terminal

Linux

  • if poetry:
poetry run python main.py
  • else:
python main.py

Windows

python main.py

To Do

  • [done] make aiohttp request which not block UI
  • [done] clean code style, delete global variables
  • [done] implement variant of function which uses thread (window.perform_long_operation) method
  • [done] lead to OOP

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages