15,181 Topics
| |
Hello, This if statement is always returning true and I cannot see why. Could you guys tell me why? menu = input("Choose what you would like to do:\n\n1. Work out how far you will travel with a set time and speed\n2. Work out the speed you will need to travel … | |
Hy I would like to know what python gui framework, I can use that will be compatible cross platform and will help me create my snippet saver, that will be relational database, with categories for each language. I thought I can use kivy to create my graphical interface than use … | |
Trying use radio buttons to select which host I'm referring to since ultimately there will only be two and they are fixed addresses. This is the error: File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1410, in call return self.func(*args) File "Untitled 2.py", line 63, in command=lambda: callback_power_off(off, host)) File "Untitled 2.py", line 28, in … | |
I'm trying to figure out a way to define my function for loaning a book within a class. This is what I have so far: class Library: # the class constructor def __init__(self, books, patrons): self.books=books self.patrons=patrons def __str__(self): s="Patron(" for patron in self.patrons: s+=str(patron) + ', ' if len(self.patron) … | |
I have made a QTableView that displays images from disk, there are two seriously agonizing problem I am facing. First of after the windows shows up making it maximize or changing size of window is very slow, and secondly I want to display images height width dependong on what can … | |
Hello, I've created a script that parses and downloads images from a website however now what I want to do is create a script that matches the files I've downloaded against common image file type signatures and then tells me how many of the files aren't those types. I'm still … | |
| I installed wxPython2.8-osx-unicode-py2.7 from the wxpython website using their .dmg installer file. When I used the included uninstaller to remove wxPython it would not accept my password. I think this may be because my password contains some non-alphanumeric characters. Can anyone help? I'm running OSX 10.6.8. |
How would I be able to have a button that's command is to return it's text in the button to a variable | |
hello, I'm trying to resolve an issue that is requested to create a game with the same kind of Flow Free. Where I have to create a NxN matrix, which must be greater than or equal to 2 and less than or equal to 7. The size is selected by … | |
How do I display images in QListView of size of standard thumbnail size like 250 x 200 , and file nametext should wrap to next line , right now the images displayed are very small and are not positioned under each other in proper row column order. import sys import … | |
I am trying yo create symbolic link on my mac, but when i try to run i get error saying original item searchMethod cannot be found `$ ln -s '/usr/bin/env python ~/Development/python/searchMethod/python/searchMethod.py' searchMethod` | |
Hey all, I have the following code that is working fine; basically it finds all files on my desktop and then prints the specific ones that I am looking of. I save all files to my desktop and the files contain the clients name so I figure once a week … | |
I have a company scanner but very often people forget to remove scanned (confidencial documents) I want to create a script which will once day check a "/home/scanner" folder and if there are any files it moves them to my /home/Administrator folder. I dont really dont know how to start. … | |
how can i produce my buttons using while loop and a list if stirng # python 2.x #from Tkinter import * #from tkFont import Font # python 3.x from tkinter import * from tkinter.font import Font def button(frame, text, command=None): ft = Font(family=('Verdana'), size=14) return Button(frame, text=text, font=ft, width=3, command=command) … | |
hello sir, i have a xml file like <book> <title>abc</title> ........ <details> <name>abc</name> ..... <author>shakespere</author> <year>1980</year> </details> <details> <name>xyz</name> ..... <author>anand</author> <year>1995</year> </details> </book> i need to print the values of author,year if details.name == title here is my code DomTree = xml.dom.minidom.parse(file) book = DomTree.documentElement for t in domain.getElementsByTagName("title"): … | |
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 … | |
hello there im doing this homework assignment and we are making 'facebook' like system now... to sum up, when i press a certain link next to that link has to be printed - liked or sth... the problem is i dont know how to detect when i press the link … | |
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 … | |
def main(): p =input("Enter your sentence: ") words = p.split() wordCount = len(words) print ("The word count is:", wordCount) main() I get the read out: Enter your sentence: Hello world Traceback (most recent call last): File "C:/Python27/idk.py", line 11, in <module> main() File "C:/Python27/idk.py", line 3, in main p =input("Enter … | |
how do i backspace from last number and also clear th? last equation and add a quit button????????? from tkinter import * from tkinter.font import Font def button(frame, text, command=None): ft = Font(family=('Verdana'), size=14) return Button(frame, text=text, font=ft, width=3, command=command) def frame(frame, side=LEFT, bg="black"): f = Frame(frame, background=bg, padx=5, pady=5) … | |
Please help me, I want to make a quiz in python (And a game, if I get the time), can someone help me? I saw the topic projects for beginners, but it was a .dat file (which I opened using notepad 2), I don't know how to use a dat … | |
I have a code which add extra memcache instance at run time, but this makes my keys lost. I know there are several libraries available like consistent_hash, hash_ring but I am unable to use them in my code. I know there is ketama available but couldn't find python code sample … | |
I am trying to work on this problem but am confused with how to approach it. I am trying to create a program in python that analyzes a text file and counts how many time various words are used within it. I understand what I need to do but am … | |
How to exit a program but keep the turtle window open? I have tried exit() but it doesn't keep the turtle window open | |
I have to write the an AVLTree in python, followed all the instructions and I feel I have it just right, only problem is I can't figure out how to display my tree. I have to use the test given below, as well as the 2 methods below in the … | |
Hi, I'm looking for a little help. I'm trying to create a script with the ability to take home page as an argument, printing a message to say something about the site and then validate whether or not this is a valid URL. I'm relatively new to Python and haven't … | |
I know this is stupid but how do i add a quit button? from tkinter import * from tkinter.font import Font def button(frame, text, command=None): ft = Font(family=('Verdana'), size=14) return Button(frame, text=text, font=ft, width=3, command=command) def frame(frame, side=LEFT, bg="black"): f = Frame(frame, background=bg, padx=5, pady=5) f.pack(side=side, expand=YES, fill=BOTH) return f … | |
from graphics import * def patchdrawer(): win = GraphWin("Patch drawer", 100, 100) for x in range(0, 5): for y in range(1, 6): p1 = Point(x * 20, (y - 1) * 20) p2 = Point((x + 1) * 20, y * 20) rectangle = Rectangle(p1, p2) if (x + y) … | |
raceback (most recent call last): File "C:/Python32/n", line 1, in <module> from Tkinter import * # button text list cmdlst = ['7', '8', '9', '+', '%', '4', '5', '6', '-', '**', '1', '2', '3', '*', '//', '.', '0', 'CL', '/', '='] class MyButton(Button): backref = None def Click(self): # back … | |
Hello there i was typing a python code and got this error saying: 26 27 for eil in open("msgs.txt"): # nuskaito ir parodo visas zinutes => 28 date, person , msg = eil.split("#") 29 print(date+person+"<b>"+msg+"</b><br> <hr>") 30 date = '', person = '', msg = ' ', eil = '----\n', … |
The End.