Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: convert a character to numeric and back
Post: RE: convert a character to numeric and back
The type info is lost after ord(). Can't get it back unless store it first.
t = type(c)
n = ord(c)...later
try:
t(chr(n), encoding='utf8')
except TypeError:
chr(n) |
|
jfong |
General Coding Help |
2 |
2,114 |
Jan-28-2020, 07:33 AM |
|
|
Thread: first k non-prime numbers
Post: RE: first k non-prime numbers
(Jun-20-2019, 12:28 PM)arycloud Wrote: Quote:You should delete it all and rewrite it as I suggested.
That's the thing I'm not clear about, can you little bit explain it via code? please!
You have t... |
|
jfong |
General Coding Help |
11 |
7,274 |
Jun-22-2019, 10:51 AM |
|
|
Thread: Python 3.5 tk fullscreen
Post: RE: Python 3.5 tk fullscreen
To work with different monitor resolution under place manager, you have to use relx, rely, relwidth, relheight options instead of x, y, width, height. Also the root geometry() has to be set using the ... |
|
jfong |
GUI |
2 |
8,009 |
Dec-11-2018, 06:56 AM |
|
|
Thread: Pyserial Issues with Python3.7 and Fluke Multimeter
Post: RE: Pyserial Issues with Python3.7 and Fluke Multi...
Why you use readline() instead of read()? By the way, it's better to have the timeout set to a proper value to avoid endless hand on. |
|
jfong |
Data Science |
11 |
22,429 |
Dec-06-2018, 10:43 AM |
|
|
Thread: tkinter questions--- part 2
Post: RE: tkinter questions--- part 2
The Traceback should tell you where the error is.
def__init__(self): |
|
jfong |
GUI |
8 |
4,012 |
Dec-04-2018, 02:16 AM |
|
|
Thread: tkinter questions--- part 2
Post: RE: tkinter questions--- part 2
It's double underscore, __init__()
By the way, the last line tk.mainloop() is not required. In your codes, the while loop works like it. |
|
jfong |
GUI |
8 |
4,012 |
Dec-03-2018, 01:23 AM |
|
|
Thread: tkinter questions--- part 2
Post: RE: tkinter questions--- part 2
first, line 10 should be
def __init__(self):
second, line 17 should be
position= canvas.coords(self.shape) |
|
jfong |
GUI |
8 |
4,012 |
Dec-02-2018, 07:33 AM |
|
|
Thread: Display image in tkinter
Post: RE: Display image in tkinter
By default, the "display list" of the objects on the canvas follows their creation sequence, from the bottom (the first created one) to the top (the last one). You can change it through the object's I... |
|
jfong |
GUI |
9 |
27,403 |
Dec-02-2018, 01:33 AM |
|
|
Thread: can't update label to include variable
Post: RE: can't update label to include variable
Those StringVar hp2, sanity2 and hunger2 you updated in the calculate() are local variable of this function, not those defined at line 75~77. Comment out them(line 60~62) and everything will be fine. |
|
jfong |
GUI |
2 |
3,674 |
Dec-01-2018, 07:16 AM |
|
|
Thread: Display image in tkinter
Post: RE: Display image in tkinter
player_icon --> self.player_icon |
|
jfong |
GUI |
9 |
27,403 |
Nov-30-2018, 07:36 AM |
|
|
Thread: update the content of Text widget
Post: RE: update the content of Text widget
The pack manager is a sequence-related procedure, which means first packed widget always located first. Also, during the debugging, use different background color may help on finding the problem.
Bec... |
|
jfong |
GUI |
10 |
16,221 |
Nov-28-2018, 03:17 AM |
|
|
Thread: update the content of Text widget
Post: RE: update the content of Text widget
This one works for me on Windows Vista, Python 3.4
from tkinter import *
from tkinter.ttk import Notebook
import tkinter.ttk as ttk
import time
#window
root=Tk()
root.geometry('450x350')
root.title(... |
|
jfong |
GUI |
10 |
16,221 |
Nov-27-2018, 07:57 AM |
|
|
Thread: update the content of Text widget
Post: RE: update the content of Text widget
It's not a good idea repeatedly create widget s and T in the affichage_update(). I don't know what it will cause but remove them (line 44~50) out can solve the update problem. |
|
jfong |
GUI |
10 |
16,221 |
Nov-27-2018, 02:34 AM |
|
|
Thread: Checkboxes in different frames misbehave
Post: RE: Checkboxes in different frames misbehave
(Sep-25-2018, 03:32 PM)octoeder Wrote: import tkinter as tk
root = tk.Tk()
Frame1 = tk.Frame(root)
Frame2 = tk.Frame(root)
Frame1.pack()
Frame2.pack()
tk.Checkbutton(Frame1, text="checkbutton #1... |
|
jfong |
GUI |
3 |
4,496 |
Oct-03-2018, 09:12 AM |
|
|
Thread: [PySimpleGUI] New GUI Package. Customize with ease
Post: RE: [PySimpleGUI] New GUI Package. Customize with ...
(Aug-21-2018, 11:39 PM)PySimpleGUI Wrote: Before the thread is completely hijacked to become one about WxPython, did anyone bother to try making something with this package that's been commenting on... |
|
jfong |
GUI |
38 |
25,507 |
Aug-22-2018, 04:27 AM |
|
|
Thread: [PySimpleGUI] New GUI Package. Customize with ease
Post: RE: [PySimpleGUI] New GUI Package. Customize with ...
(Aug-20-2018, 02:25 PM)metulburr Wrote: Yes most people use GUI. But it is not %99.999 of everyone that uses computers.There is a survey about Desktop Operating System Market Share Worldwide - July ... |
|
jfong |
GUI |
38 |
25,507 |
Aug-21-2018, 01:06 AM |
|
|
Thread: [PySimpleGUI] Tutorial - Name, Address, Phone GUI
Post: RE: [PySimpleGUI] Tutorial - Name, Address, Phone ...
Run the latest version (downloaded from github where files were dated 2018/08/11 16:48) under Python 3.4, I got the following error.
D:\Works\Python\PySimpleGUI-master>python demo_dictionary.py
... |
|
jfong |
GUI |
38 |
29,506 |
Aug-12-2018, 02:21 AM |
|
|
Thread: [PySimpleGUI] Tutorial - Name, Address, Phone GUI
Post: RE: [PySimpleGUI] Tutorial - Name, Address, Phone ...
(Aug-10-2018, 05:44 PM)PySimpleGUI Wrote: Check out this bit of Python magic!
class ListDict(OrderedDict):
def __iter__(self):
for v in self.values():
yield v
... |
|
jfong |
GUI |
38 |
29,506 |
Aug-11-2018, 02:05 AM |
|
|
Thread: [PySimpleGUI] Tutorial - Name, Address, Phone GUI
Post: RE: [PySimpleGUI] Tutorial - Name, Address, Phone ...
(Aug-09-2018, 03:42 PM)PySimpleGUI Wrote: A change to how dictionaries work.
You no longer need to specify when creating the form that it should return a dictionary. If ANY element in the form tha... |
|
jfong |
GUI |
38 |
29,506 |
Aug-10-2018, 01:31 AM |
|
|
Thread: [PySimpleGUI] Tutorial - Name, Address, Phone GUI
Post: RE: [PySimpleGUI] Tutorial - Name, Address, Phone ...
(Aug-08-2018, 01:42 AM)PySimpleGUI Wrote: (Aug-08-2018, 01:17 AM)jfong Wrote: It happens just two steps away from the form shows up. First, making a selection at the ComboBox. Second, click Submit... |
|
jfong |
GUI |
38 |
29,506 |
Aug-09-2018, 03:40 AM |