14,951 Topics

Member Avatar for
Member Avatar for btp06b

# 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 == …

Member Avatar for Freshly
0
491
Member Avatar for firdevs

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)

Member Avatar for slate
0
158
Member Avatar for Mickey_2

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 …

Member Avatar for slate
0
127
Member Avatar for ALosh99

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 …

Member Avatar for ALosh99
0
309
Member Avatar for grand_78

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 …

Member Avatar for Freshly
1
534
Member Avatar for j.parkerrrr

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 …

Member Avatar for slate
-2
356
Member Avatar for grand_78

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 …

Member Avatar for Brandon Hatch
0
202
Member Avatar for Hussein aslam8

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.

-2
166
Member Avatar for Regan_1

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 …

Member Avatar for Regan_1
0
2K
Member Avatar for sureshk75

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 …

Member Avatar for Gribouillis
0
2K
Member Avatar for mattrweaver

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 …

Member Avatar for snippsat
0
3K
Member Avatar for Bandit_

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 …

Member Avatar for Gribouillis
0
301
Member Avatar for Karthik_4

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 …

Member Avatar for Karthik_4
0
3K
Member Avatar for brugernavn

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 = …

Member Avatar for brugernavn
0
1K
Member Avatar for sureshk75

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 …

Member Avatar for sureshk75
0
1K
Member Avatar for Kara_2

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 …

Member Avatar for Gribouillis
0
316
Member Avatar for grand_78

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 …

Member Avatar for BustACode
0
2K
Member Avatar for Zubenna

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 …

Member Avatar for Gribouillis
0
913
Member Avatar for Cabba23

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] …

Member Avatar for Cabba23
0
243
Member Avatar for colby.christensen

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 …

Member Avatar for colby.christensen
0
688
Member Avatar for steven.rose.94

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 = …

Member Avatar for steven.rose.94
0
343
Member Avatar for -ordi-

[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 …

Member Avatar for Ha
0
634
Member Avatar for Tcll

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 …

Member Avatar for Tcll
0
319
Member Avatar for ns9969

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 …

Member Avatar for rproffitt
0
1K
Member Avatar for nic56208

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 …

Member Avatar for Gribouillis
0
492
Member Avatar for Arsal_1

How to make script like this? **$python script.py 1. Register 2. Login 3. View User Choose with number :** I can make a script for Register and Login, but i still confusing make a script for view user. Spoiler For View User: **Choose with number : 3** (If still not …

Member Avatar for Gribouillis
0
540
Member Avatar for IIMorphII

Hey, First: Hello, i'm new here :lol: And here my question: It's a very short question: Is it possible to get the screen size (resolution) with pygame and how do i get it?

Member Avatar for diliupgabadamudalige
0
17K
Member Avatar for suraj32

Hi, I have a python script that I run everyday at 00:00 as a cronjob & its lasts for about 5-6 hours. I want supervisor to monitor the script & restart if it hangs/crashes in the middle. I have done something like this: [program:python_script] command=python run.py directory=/home/user stdout_logfile=/home/user/py_out.log redirect_stderr=true autorestart=true …

Member Avatar for cereal
0
396
Member Avatar for reminem

Hello Everybody, I searched the the internet and this forum, but cannot find the solution for my problem. Started with python and have this code (part of): import requests `def Send_invitation(): data = {"bsn": e3.get(), "initialen": e2.get(), "achternaam": e1.get(), "geslacht": e4.get(), "geboortedatum": e5.get(), "postcode": e6.get(), "emailadres": e7.get(), "screening_type": e8.get()} response …

Member Avatar for reminem
0
329
Member Avatar for anonstu3

Where do I begin? How would I go about forming a code of my own that is 'original'? I have seen everything that has already been done before. I will accept any kind of help with examples and how to go about doing this. I am new at this and …

Member Avatar for Brandon Hatch
0
210

The End.