Learning Python, Fluent in most of PASCAL, know some Lua
23 Posted Topics
I wish to use parameters in a class to change what the class displays how would this be done? | |
I have these few lines in a class in my program but it doesnt appear. No errors are shown and when i "print(menubar)" and address "0.4.." or "4..." appears menubar = Menu(master = self.mainGUI) fileMenu = Menu(menubar) fileMenu.add_command(label="Exit", command= destroyMethod) menubar.add_cascade(label="File", menu=fileMenu) destroy method does work and is existing. | |
from random import randint from tkinter import * import time screen = Tk() widthOfScreen = screen.winfo_screenwidth() #Get the width of the screen heightOfScreen = screen.winfo_screenheight() #Get the height of the screen screen.geometry("%dx%d+0+0" % (widthOfScreen, heightOfScreen)) def spammer(): count = 0 for count in range(0,1000): Button(screen, text = count, font = … | |
Re: The whole code works for me? with the "inline code example here" at the bottom taken away (running python 3) | |
How would I be able to have a button that's command is to return it's text in the button to a variable | |
Why is this not working, no errors? photo exists in correct position... gui doesnt alwyas show up, image doesnt. Using python 3 from tkinter import * from random import * import time mainGUI = Tk() width2= 319 height2 = 240 widthOfScreen = mainGUI.winfo_screenwidth() #Get the width of the screen heightOfScreen … | |
I wish to create a loop which adds images across a screen with random positions: photo1 = PhotoImage(file=address) #Assign image to PhotoImage XValue = randint(0,widthOfScreen-width2) #width2 = image width YValue = randint(0,heightOfScreen-height2) #width2 = image height Label(mainGUI, background = "white", image = photo1, borderwidth = 0).place(x=XValue, y = YValue) the … | |
I used code originally by vegaseat what's wrong with code ** error : Traceback (most recent call last): File "C:/Users/Cameron/Computing Work/Year 13/F454 - Computing Project/Design/newthingnewthing.py", line 68, in <module> canvas.create_rectangle(x0, y0, x1, y1, fill="purple") AttributeError: 'NoneType' object has no attribute 'create_rectangle'** _______________________________________________ code: from tkinter import * data = [10, … | |
is there a way of in a loop automatically setting different commands to different buttons as they are created (automatically created via loops) or is there a way of setting custom names to the buttons while they arecreated in a loop i want "buttonName" to be different and known for … | |
I'm trying to represent my data using a bar graph, the data being displayed is goodVotes, neutralVotes and badVotes on the x-axis for each of my pieces of data (records in an sqlite3 database). I wish the "bookName" of each record to be displayed on the x axis of the … | |
Re: There are 10 type of people in the world, those who understand binary and those who don't | |
Re: Would this work for adding data (modules is a list) button_name_list = [ ] for count2 in range(0,len(modules)+1, 1): button_name_list.append(modules[count2] + "Button") count2 = count2+1 | |
Are there any built in modules in python 3.3.0 that can handle images? | |
I'm programming a UI mock-up and need to make the window of fixed size and position. The lines of code for setting the size are as follows : widthOfScreen = mainGUI.winfo_screenwidth() #Get the width of the screen heightOfScreen = mainGUI.winfo_screenheight() #Get the height of the screen mainGUI.geometry("%dx%d+0+0" % (widthOfScreen, heightOfScreen)) … | |
Re: or data = str(input("Please enter a 64 letters string: ")) if (len(data) <= 64) and (len(data) > 0): print("SUCCESS") else: print("FAILURE") | |
Re: I recommend putting the def is_even() before def main(). I cant answer at the moment (at school) may fix it later. | |
Sorry, I posted this in software development not python. How do i make an auto-incrementing column? Heres my pseudocode/sql attempt c.execute('''CREATE TABLE <tableName> ( <columnName> <auto incrementing??!!>, <columnName2> text, <columnName3> text, <columnName4> text ) ''') | |
Re: Reduce the width and height to minimal size maybe 10 by 10 and see if this still happens, it could just be that the boxs are overlaying because they are running over the eddge of the grid. Sorry if this doesn't help i'm just starting with GUI in python | |
Re: def square(low, high): count = 1 for count in range(low,(high+1), 1): print (count, " squared is ", count**2) lowNum = raw_input("Please insert low value") highNum = raw_input("Please insert high value") square(int(lowNum), int(highNum)) This may work, haven't tested it as i'm at school; I have no executable rights in library. | |
Re: If you still need an answer just ask but i'm assuming I may be to late | |
How do i make an auto-incrementing column? Heres my pseudocode/sql attempt How do you make an auto-incrementing ID for a record c.execute('''CREATE TABLE <tableName> ( <columnName> <aut incrementing??!!>, <columnName2> text, <columnName3> text, <columnName4> text ) ''') | |
I'm starting my Computing project and am using Python linked via sqlite3 to a database. As part of my project I shall be searching for maths books in the database via name or module etc. I wish to display the results on a GUI in python so need to set … |
The End.