Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: [SOLVED] Tkinter module not found
Post: RE: Tkinter module not found
I usually do python3 -m pip install module. Ensures that I'm installing to the correct python version. |
|
menator01 |
General Coding Help |
7 |
238 |
Aug-02-2022, 07:45 PM |
|
|
Thread: simple tkinter question function call not opening image
Post: RE: simple tkinter question function call not open...
You need to add photo.image = photo after photo = Imagetk.Pho..... The image is getting garbage collected. You need a refernce to it. |
|
menator01 |
GUI |
5 |
227 |
Aug-01-2022, 06:13 PM |
|
|
Thread: Remove a space between a string and variable in print
Post: RE: Remove a space between a string and variable i...
Here is one way
import re
string = "I don't like purple , I prefer red."
string = re.sub('[\s],', ',', string)
print(string)Output:Python - fun.py:3
I don't like purple , I prefer red.
I don't like p... |
|
menator01 |
General Coding Help |
5 |
255 |
Jul-27-2022, 06:42 AM |
|
|
Thread: Tkinter don't change the image
Post: RE: Tkinter don't change the image
As Larz60+ recommended upgrade to python3. After the recommended link, here is a snippet to work with.
import tkinter as tk
from tkinter import PhotoImage
def change_img(parent, label, images):
... |
|
menator01 |
GUI |
2 |
164 |
Jul-22-2022, 10:26 AM |
|
|
Thread: [split] .delete and .insert not working
Post: RE: [split] .delete and .insert not working
Here is my finished attempt at your project. Modified the code a little. Took out the reset button as the treeview is updated anytime an action is performed.
Took out the update button and changed the... |
|
menator01 |
GUI |
5 |
333 |
Jul-21-2022, 07:46 PM |
|
|
Thread: win32gui
Post: RE: win32gui
You should upgrade to python3. You need to show code for us to help. |
|
menator01 |
GUI |
1 |
121 |
Jul-21-2022, 08:10 AM |
|
|
Thread: IMDbPy "search_person" result cant be found in actors list in Python
Post: RE: IMDbPy "search_person" result cant be found in...
I don't know anything about imdb module but a basic python code wouls look something like
actors=['Natalie Biggs','Daniel Crossley','Jaye Davidson','Tania Emery','Titus Forbes-Adam','Anthony Houghton... |
|
menator01 |
Game Development |
3 |
193 |
Jul-20-2022, 06:42 PM |
|
|
Thread: What is your preferred resource for learning PyQt?
Post: RE: What is your preferred resource for learning P...
I usually just do a duckduckgo search.
This forum has some pretty good threads on pyqt |
|
menator01 |
GUI |
2 |
160 |
Jul-20-2022, 06:06 PM |
|
|
Thread: [split] .delete and .insert not working
Post: RE: [split] .delete and .insert not working
I got interested in your project and took a shot at it.
Only the add record button and view all button work and search student no work.
I have not worked with any others.
All records will be shown (if... |
|
menator01 |
GUI |
5 |
333 |
Jul-18-2022, 06:06 AM |
|
|
Thread: Find and Replace numbers in String
Post: RE: Find and Replace numbers in String
Might could do something like
string = 'It was 1there...some text, some text'
for word in string:
if word.isnumeric():
string = string.replace(word, '')
print(string)Output:It was there..... |
|
menator01 |
General Coding Help |
2 |
258 |
Jul-16-2022, 11:22 PM |
|
|
Thread: If 2nd input in the game is correct, replace with 1st input and loop the game
Post: RE: If 2nd input in the game is correct, replace w...
There is no condition for the you lost line. It will always print.
you will need something like
if second_data == first_data:
# continue with whatever
else:
print('you lost')On a side note tha... |
|
menator01 |
Game Development |
11 |
562 |
Jul-14-2022, 07:28 PM |
|
|
Thread: A simple "If...Else" question from a beginner
Post: RE: A simple "If...Else" question from a beginner
Fruit is not true. No fruit was asked about. In the original code. So fruit is false. breakfast == 'fruit'. The else is with this if statement. |
|
menator01 |
General Coding Help |
6 |
314 |
Jul-11-2022, 03:23 AM |
|
|
Thread: A simple "If...Else" question from a beginner
Post: RE: A simple "If...Else" question from a beginner
Take this for example, if the first if is true it will execute. If not nothing will happen, the code moves to the next if.
The 2nd if will execute if it is true. If not the else will execute because, ... |
|
menator01 |
General Coding Help |
6 |
314 |
Jul-11-2022, 02:34 AM |
|
|
Thread: A simple "If...Else" question from a beginner
Post: RE: A simple "If...Else" question from a beginner
if you do not want the else to execute change all other if's except first to elif. the else only works with last if.
print("Good morning! What would you like for breakfast? \nYou can have eggs, cerea... |
|
menator01 |
General Coding Help |
6 |
314 |
Jul-11-2022, 02:07 AM |
|
|
Thread: While loop not ending (Best of 10 dice game)
Post: RE: While loop not ending (Best of 10 dice game)
Have a look at your while statement. It should be something like while player1_score < 6 or player2_score < 6.
I posted a go of your code modified.
import random as rnd
player1 = 0
player2 =... |
|
menator01 |
General Coding Help |
3 |
291 |
Jul-09-2022, 12:18 AM |
|
|
Thread: Updating/running code when path changes
Post: RE: Updating/running code when path changes
line 6 str is a python built in. You are re-assigning it. Maybe something like my_string = str(my_path) Not sure if that is the problem but, maybe one of the more experienced can help better. |
|
menator01 |
GUI |
14 |
541 |
Jul-06-2022, 08:06 PM |
|
|
Thread: The Text in the Label widget Tkinter cuts off the Long text in the view
Post: RE: The Text in the Label widget Tkinter cuts off ...
Compare my code with yours. The bind part is needed as well. You are binding the label, I'm binding to root.
On a side note you have imported random and then redefined it in your code. Just my opinion... |
|
menator01 |
GUI |
4 |
294 |
Jun-26-2022, 06:26 PM |
|
|
Thread: The Text in the Label widget Tkinter cuts off the Long text in the view
Post: RE: The Text in the Label widget Tkinter cuts off ...
One way of doing it
import tkinter as tk
from random import choice
def random_text(label):
mylist = [
'This is a long string of text that maybe will wrap in the label down below. It may have ... |
|
menator01 |
GUI |
4 |
294 |
Jun-26-2022, 09:51 AM |
|
|
Thread: I'm getting a String index out of range error
Post: RE: I'm getting a String index out of range error
One example
def f_and_l(msg):
if msg[0] == msg[-1:]:
return True
return False
print(f_and_l('else'))
print(f_and_l('tree'))Output:True
False |
|
menator01 |
General Coding Help |
7 |
369 |
Jun-26-2022, 02:02 AM |
|
|
Thread: Scrollable buttons with an add/delete button
Post: RE: Scrollable buttons with an add/delete button
My attempt. Much room for improvements though. The scrollbar doesn't seem to want to work as intended.(The area between arrows should shrink with more data introduced but, doesn't). There does not app... |
|
menator01 |
GUI |
5 |
445 |
Jun-16-2022, 06:50 PM |