Brak podglądu blog.furas.pl · python/flask Flask: Example how to send zip file downloaded from other page. Example shows how to use BytesIO to download zip file from other page and send it to web browser without saving on disk. from flask import Flask, send_file import requests import i... 15.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/flask Flask: Przykład jak wysłać plik zip ściągnięty z innej strony. Przykład pokazuje jak z użycien BytesIO ściągnąć plik zip z innej strony i wysłać go do przeglądarki bez zapisywania na dysku. from flask import Flask, send_file import requests im... 15.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python Python: use cv2 to create movie from images Simple script which gets as argument pattern like path/*.jpg. It uses pattern (instead path) with glob.glob() to get filenames, and uses cv2 to load images, resize them save as fra... 15.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python Python: Use pillow to create image with thumbnails in rows and columns Simple script which gets as arguments pattern like path/*.jpg, number of rows, number of columns and create grid with images (thumbnails 100x100 pixels) It uses pattern (instead pa... 15.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python Python: Użycie cv2 do stworzenia filmu z obrazków Prosty skrypt, który bierze jako argument wzorzec typu path/*.jpg Skrypt używa wzorca (zamiast nazwy katalogu) z funkcją glob.glob() aby pobrać nazwy plików, a następnie używa cv2... 15.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python Python: Użycie pillow do stworzenia obrazku z miniaturkami w wierszach i kolumnach Prosty skrypt, który bierze jako argument wzorzec typu path/*.jpg, ilośc wierszy, ilośc kolumn i tworzy siatkę z obrazkami (miniaturkami 100x100 pikseli) Skrypt używa wzorca (zamia... 15.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/pygame PyGame: Transparent circle or other shape pygame.draw.circle() and other method in pygame.draw don't use alpha channel to draw so you have to draw it on new Surface() (to get it as bitmap) and add alpha and colorkey to Sur... 13.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python requests Python pomijanie encodowania pewnych znaków w urlencode() Czasami API oczekuje pewnych wartości jako normalny tekst a nie zakodowany ale urlencode zamienia go. W takiej sytuacji można użyć safe="znaki" aby pominąć kodowanie dla tych znakó... 12.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python requests Python skip encoding some chars in urlencode() Sometimes API expects some values as normal char, not encoded, but urlencode converts it. In this situation you can use safe="chars" to skip encoding these chars. import urllib.par... 12.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/flask Flask: play sound after click link but before reload page When you click link then web browser reloads page and it removes from memory code which should play sound. You would have to catch link <a href="javascript:void(0);" onclick="sound... 11.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/flask Flask: Sum values in form[GB] It uses the same function to render empty form and later to get values from form, calculate sum and render page with results. It uses request.form to get values from form. Because... 11.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python selenium Selenium: How to send clipboard to field in browser When you find input field on page then you can send Ctrl+V to send text from clipboard to this field. import selenium.webdriver from selenium.webdriver.common.keys import Keys driv... 11.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python selenium Selenium: Wysłanie zawartości schowka do pola w przeglądarce Gdy znajdziesz pole tekstowe na stronie wtedy możesz wysłać Ctrl+V aby wstawić tekst ze schowka do tego pola. import selenium.webdriver from selenium.webdriver.common.keys import K... 11.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python Python: problem to install gattlib on Linux Mint and Ubuntu [GB] It has problem because GCC tries to include boost-python36.a (or boost-python37.a) but system has only boost-python3-py36.a (or boost-python3-py37.a) You can check it using locate... 10.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/tkinter Tkinter PandasTable Examples [GB] It is few examples how to use pandastable to create table in tkinter with data from pandas dataframe. Installation pip install pandastable Dependencies numpy pandas matplotlib nume... 27.01.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python scraping BeautifulSoup: How to get text from tag There are different functions to get text from tag. .text - all text from tag and subtags .string - only if there is no subtags .get_text(strip, separator) - you can remove whitesp... 21.01.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python scraping BeautifulSoup: Jak pobrać tekst z tagu Jest kilka róznych funkcji do pobierania tekstu z tagu. .text - cały tekst z tagu i podtagów .string - tylko jeśli nie ma podtagów .get_text(strip, separator) - można usunąć białe... 21.01.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/pygame PyGame Example: object bounces on border [GB] import pygame # --- constanst --- (UPPER_CASE_NAMES) RED = (255, 0, 0) BLACK = (0, 0, 0) WIDHT = 500 HEIGHT = 500 # --- main --- speed = 10 pygame.init() window = pygame.display.se... 21.01.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/pygame PyGame Przykład: obiekt odbija się on krawędzi import pygame # --- constanst --- (UPPER_CASE_NAMES) RED = (255, 0, 0) BLACK = (0, 0, 0) WIDHT = 500 HEIGHT = 500 # --- main --- speed = 10 pygame.init() window = pygame.display.se... 21.01.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python requests Requests: use Imgur API to upload image[GB] First you have to create normal account on Imgur. After loging to normal account you can go to https://api.imgur.com/oauth2/addclient to register application. It needs application... 21.01.2020 blog.furas.pl