15,181 Topics

Member Avatar for
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
167
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
315
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
317
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 jo386

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 …

Member Avatar for rproffitt
0
286
Member Avatar for Sibghah

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 …

0
185
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
690
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
637
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
322
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 shandoo1997

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 …

Member Avatar for diafol
0
131
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
507
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
549
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
400
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
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
324
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
313
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

The End.