14,946 Topics

Member Avatar for
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
315
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
242
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
342
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
633
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
395
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
328
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
Member Avatar for aaron.breen.50

Alright i am totaly new to python and could really use some help. I need a program that will run and starting at "2:00" count down all the way to "0:00". The left side being minutes and the right side being seconds. so 120 seconds total. I have no idea …

Member Avatar for rproffitt
0
8K
Member Avatar for lavanyarao

I am getting this problem . my python code is for i,j in nltk.pos_tag(words): print i,j if 'JJ' in j: pj=(list(swn.senti_synsets(i,'a'))[0]).pos_score() print "pj:" ,pj elif 'RB' in j: pr =(list(swn.senti_synsets(i,'r'))[0]).pos_score() print "pr:" ,pr elif 'NN' in j: pn =(list(swn.senti_synsets(i,'n'))[0]).pos_score() print "pn:" ,pn elif 'VB' in j: pv =(list(swn.senti_synsets(i,'v'))[0]).pos_score() print "pv:" …

Member Avatar for Brandon Hatch
0
323
Member Avatar for giancan

Dear all, I need help with unicode. After reading a lot on several webpages I still cannot solve my problem. I have a wx window in python. In one field I set a filename, say "áio" (stupid name, but just to give you the idea). If I want to create …

Member Avatar for Gribouillis
0
311
Member Avatar for bumsfeld

Using the wx.lib.pdfwin.PDFWindow one can read Adobe PDF files (.pdf) with wxPython. The PDF file format is popular document file format allowing mixing of text and graphics. The GUI toolkit wxPython's newer wx.activex module allows one to use the ActiveX control, as if it would be one wx.Window. It actually …

Member Avatar for bucefala
0
2K
Member Avatar for eniacpx

I keep getting "List index out of range" when trying to execute this code, but for the life of me I cannot figure out why, If anyone has any experience coding linux gDesklets this would help. File: StockWatcher.display [code] ... parser.dataSet = stockInfo.html ... [/code] stockInfo.html is an object containing …

Member Avatar for Gribouillis
0
5K

The End.