15,190 Topics
![]() | |
This script is to be a 5x5 grid of buttons, one saying "Click Me" and the rest "Don't Click Me." A correct click scores a point, an incorrect click costs a point. The buttons get shuffled after each click. The player has 60 seconds to maximize his score. The script … | |
How to combine two class? so the output can be equal... here's my code.. class year: def __add__(self, year): return (year) class day: def __add__(self, day): return (day) class month: def __add__(self, month): return (month) class Date: def __call__(self, year, month, day): return (year, month, day) class Delta(year, month, day): … | |
# This program converts US measurements # to metric measurements. # Constants for valid values VALID_VALUE = 0 MAX_TEMP = 1000 def main(): print(''' 1.Miles to Kilometers. 2.Farenheit to Celsius. 3.Gallons to Liters. 4.Pounds to Kilograms. 5.Inches to centimeters. 6.Exit. ''') input('What would you like to convert?') if selection == … | |
question: write in python to take five input values and output: a)the highest value b)the lowest value c)the average (i need help with my homework) | |
What software do you recommend for drawing layouts to be implemented in a ttk application? I'm looking for something simple and clutter-free where there aren't 10 zillion options I don't want. All I really need is basic shapes corresponding to the shapes of ttk widgets and a way to place … | |
Hello, I'm trying to plot this function with using this values: Rh = 9.8 H0 = 0.063 def Thickness_H(H0, r, Rh): return float(H0)*np.exp(float(r)/float(Rh)) r = np.linspace(0,1, 10) x =Thickness_H(H0, r, Rh) plt.plot(r, x) plt.show() I'm trying to defind r like what i know but this dose not work, I'm getting … | |
Hi, I'm working on this problem in my python programming class and need help with part of it. I need to have it display a "F" for anyones grade that is below 60, and also have it display the amount of "F" students, as well as the percentage of students … | |
Help please, im using python 3 and im trying to print the state with maximum and minimum population from a text file...This is what the text file contains. Alabama AL 4802982 Alaska AK 721523 Arizona AZ 6412700 Arkansas AR 2926229 California CA 37341989 Colorado CO 4939456 Connecticut CT 3581628 Delaware … | |
I need help with just one line. I need an "F" to be displayed on the same line the student with 45 points. I keep getting the "F" to display on a new line below the 45. I guess something is wrong with my if statement. I also need to … | |
Am trying to write asimple python programm that harvest data from facebook . like if i type in akey word like "new york" it brings me all events posted on facebook with a connection to newyork. | |
I am quite new to python programming and having trouble with this program. This is what my GUI looks like [Click Here](https://gyazo.com/5e45577a99ae131dfa4a1a9a42cbfb0e) . What I am trying to acomplish is by have the two comboboxes select the units and then calculate them. Code: self.measurements = StringVar() self.Combobox_Length_Left = ttk.Combobox(self.length_frame, textvariable … | |
This is my 2nd question on python/tkinter... I'm experimenting on containers to maximise code reuse but I seem to be stuck at attempting to display the image for the ContainerImage section although at runtime it does set the background to black and displays the text just not the image. Would … | |
I am using Python/Pandas. I need to split personal names so that names that end in "Van Dyke", both words end up in the last name. So, if the name is Richard Wayne Van Dyke, Wayne is the middle name and Van Dyke is the last. Complicating matters are names … | |
import time def add(numbers): a = 0 for num in numbers: a += num return a add_numbers = [] def subtract(numbers): b = 0 for num in numbers: b -= num return b sub_numbers = [] def multiply(numbers): c = 0 for num in numbers: c *= num return c … | |
I am writing an **automation test** using **python**, where an **android app** records an audio and stores it in a specific directory within the internal storage (sdcard0) of the android device. I need to check whether the **recording** (recordingX.mp3) actually exists with the same name within the specific directory or … | |
Hello, I got this error: `IndentationError: expected an indented block` Im new to python and only used to php, i have no idea what to do. #!/usr/bin/python import numpy as np import argparse import cv2 cap = cv2.VideoCapture(0) while(True): # Capture frame-by-frame ret, frame = cap.read() # Operations orig = … | |
I got this code on using splash screens and liked it however, I'm unable to get the text to update based on the current event(in the example it's just a range of numbers). Would love to get some input on what I'm doing wrong here. Thank you from tkinter import … | |
So, I have to make a dice rolling sim. for my class project. I had it working until I had to make it loop. There is an invalid syntax with the closing quotation marks. ` roll_another ("Yes or no? If yes,4,6,or8?"):` Because I am fairly new, I don't know many … | |
I am a beginner in computer programming and need help with this problem: Create a script that prompts the user to provide the number of pennies, nickels, dimes, and quarters. Display back the value of the coins in dollars and cents. Here is my code so far, everything is good … | |
Dear Python coders, I am new to python programming and I am trying to solve an assignment. The question is stated below; Create a function that does the following 1. Accepts as the first parameter a string specifying the data structure to be used "list", "set" or "dictionary" 2. Accepts … | |
Hello all. I apologize in advanced if this has been asked before but I have not been able to find this information via google or searching here. Everything I found is related to how a for loop works. I know how to use a for loop in python and what … | |
I have to store the scores of people in a text file as an array, and I should be able to add each record on the array. This is the part of the code where the scores are being stored: if group == "a": with open("class scores A.csv", "a+") as … | |
I have a txt file within there are three articals recognizable by the html tags < doc > < / doc> As a result i need to count the words in each artical and get a result like this: [the] -> [1, 20] -> [2, 34] -> [3, 12] [author] … | |
I have been teaching myself Python and wanted to create something useful while learning. I am using wxPython to create the interface. The app works if I use the mouse to click the buttons. I've been trying to get it to recognize operation key-ins like addition using the num pad … | |
what is my best approach to deal with negative floating values in Python3? I know I can remove the negative all together with strip but I'd like to return the negative result if possible Example the following code returns a math domain error due to the negative number: eps = … | |
[CODE]# -*- coding: utf-8 -*- from PyQt4 import QtGui from PyQt4.QtCore import * import sys import os class VideosToMp3(QtGui.QWidget): def __init__(self, parent = None): super(VideosToMp3, self).__init__(parent) ''' Labels and GUI ''' extension = QtGui.QWidget() download_label = QtGui.QLabel("Enter YouTube video URL:") self.download_line_edit = QtGui.QLineEdit() file_label = QtGui.QLabel("Enter file name (optional):") self.file_line_edit … | |
Basically, I'm working with zipimport to load plugins. These plugins contain binary modules which can only be loaded via retrieving their data. Copying them to a temporary directory is stupid, so how can I get a handle to a dynamic process which I can inject the stream into before it's … | |
Hi, I have problem with very simple telnet connection script.: import sys import telnetlib from telnetlib import Telnet HOST = 'localhost' command="clear cable modem reset all" print "Start telnet connection" tn = telnetlib.Telnet(HOST) tn.set_debuglevel(9) print tn.read_until("CMTS>") print tn.read_all() tn.write("logout\n") print tn.read_all() In pycharm run log i see : Start telnet … | |
Hi. I have a python script that i run on my raspberry pi that would connect to a usb sensor and get a value each 0.5 seconds and output the results. I wanted to make a web app to view the data in realtime instead of using terminal so i … ![]() | |
I'm making a program that identifies the word position in a sentence. For example, in the sentence ASK NOT WHAT YOUR COUNTRY CAN DO FOR YOU ASK WHAT YOU CAN DO FOR YOUR COUNTRY The word 'COUNRTY' appears in the 5th and 17th positions. **This is what I have so … |
The End.