Brak podglądu blog.furas.pl · python Python: How to change name when compressing to Zip file or uncompressing from Zip file. Compressing with new name Sometimes we want to change name of compressed file or put it in subfolder in zip file. Function zipfile.write() can get new name which will be used insid... 03.03.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python Python: Jak zmienić nazwę pliku podczas kompresowania do pliku Zip lub rozkompresowywania z pliku Zip. Kompresowanie z nową nazwą Czasami chcemy zmienić nazwa kompresowanego pliku lub umieścić w podkatalogu w pliku zip. Funkcja zipfile.write() może przyjąć nową nazwę, która będzie u... 03.03.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python requests Python: Why `requests` incorrectly decodes text instead of UTF-8 Sometimes requests incorrectly decodes text in response.text - it uses ISO-8859-1 (Latin-1) instead of UTF-8 event if there is <meta charset="uft-8"> or <meta http-equiv="Content-T... 03.03.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/tkinter Tkinter: How to create popup Window or Messagebox This example shows how to popup Toplevel window or Messagebox. Second window uses Toplevel instead of Tk and it doesn't need mainloop. import tkinter as tk from tkinter.messagebox... 27.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/tkinter Tkinter: Jak stworzyć wyskakujące okno lub Messagebox Ten przykład pokazuje jak pokazać okno Toplevel lub Messagebox. Drugie okno używa Toplevel zamiast Tk i nie wymaga mainloop. import tkinter as tk from tkinter.messagebox import sho... 27.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/pygame PyGame: Drag object on screen using mouse First you have to create some object to drag and variable which will keep information if object is draged rectangle = pygame.rect.Rect(176, 134, 30, 30) rectangle_draging = False Y... 24.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/pygame PyGame: Draw image on screen First you have to load image image = pygame.image.load('image.jpg') Next you have to send image to buffer (which represents screen/window surface) screen.blit(image, (0, 0)) # draw... 24.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/pygame PyGame: Przeciąganie obiektu po ekranie za pomocą myszy Najpierw trzeba stworzyć obiekt do przesuwania (jego wielkość i pozycja jest w Rect()) oraz zmienną do przechowywania informacji czy obiekt jest przeciągany rectangle = pygame.rect... 24.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/pygame PyGame: Wyświetlenie obrazka na ekranie Najpierw trzeba wczytać obrazek image = pygame.image.load('image.jpg') Następnie trzeba wysłać obrazek do bufora (który reprezentuje powierzchnię ekranu/okna) screen.blit(image, (0... 24.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python Socket: send and receive at the same time One socket may send and receive at the same time but one thread has to only send data and other thread has to only receive data. This way send() doesn't have to wait for the end of... 24.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python Socket: wysyłanie i odbieranie danych w tym samym czasie Jedno gniazdo (socket) może wysyłać i odbierać w tym samym czasie ale jeden wątek musi tylko obierać dane a drugi tylko wysyłać dane. W ten sposób send() nie musi czekać na zakończ... 24.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/tkinter Tkitner: How to display Progressbar with different speed If Progressbar in 'indeterminate' mode run too fast or too slow then you can use after(milliseconds, function_name) to run periodically own function which will use step() to change... 24.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/tkinter Tkitner: Jak wyświetlać Progressbar z inną prędkością If Progressbar in 'indeterminate' mode run too fast or too slow then you can use after(milliseconds, function_name) to run periodically own function which will use step() to change... 24.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/tkinter Tkinter: How to display Listbox with Scrollbar It adds Listbox on left side and Scrollbar on right side. Scrollbar uses command=listbox.yview to move Listbox content when Scrollbar is moved. Listbox uses yscrollcommand=scrollba... 24.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/tkinter Tkinter: Jak wyświetlić Listbox z Scrollbar Kod dodaje Listbox z lewej strony i Scrollbar z prawej strony. Scrollbar używa command=listbox.yview aby przesuwać zawartość Listbox gdy przesuwany jest Scrollbar. Listbox używa ys... 24.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/tkinter Tkinter: Update image on Canvas with Button click Example images Change only once Create two ImagePhoto instances image1 = tk.PhotoImage(file="ball1.gif") image2 = tk.PhotoImage(file="ball2.gif") Put first image on Canvas and keep... 23.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/tkinter Tkinter: Zmiana obrazka na Canvas po wciśnięciu Button'a Przykładowe obrazki Zmiana tylko raz Utwórz dwa ImagePhoto image1 = tk.PhotoImage(file="ball1.gif") image2 = tk.PhotoImage(file="ball2.gif") Umieść pierszy obrazek na Canvas i zach... 23.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/pillow Pillow: How to split and merge channels in RGB image using Python You have split() and merge() to work with channels. You can also use getchannel() from PIL import Image img = Image.open('images/image.jpg') r,g,b = img.split() #r = img.getchannel... 17.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python/pillow Pillow: Jak rozdzielić i połączyć kanały w obrazku RGB używając Pythona Można użyć split() in merge() aby działać z kanałami. Można także użyć getchannel() from PIL import Image img = Image.open('images/image.jpg') r,g,b = img.split() #r = img.getchann... 17.02.2020 blog.furas.pl
Brak podglądu blog.furas.pl · python Python: Adding parameters to URL using urllib import urllib.parse url = 'http://stackoverflow.com/search' params = { 'lang': 'en', 'tag': 'python tkinter' } print(url + '?' + urllib.parse.urlencode(params)) Result: http://stac... 15.02.2020 blog.furas.pl