15,181 Topics
| |
For example the 'x'in if ans*ans*ans != abs(x): | |
Hi. How can i open a mp3 file and play it in python? There is a mp3 file on my Linux desktop and i want to open it from a python file and play it. What should i do? | |
Hi everybody. I have problem with .pack() and .grid(). I have to use this line: mywin.pack(fill=BOTH, expand=YES) I have used .grid every where on my file but now here i have copied a pice of code from some where and have pasted to my file, as you see it has … | |
Hello. When we want to insert a vlue into a table in sqlite, we use this line, right? cursor.execute('INSERT INTO colors Values ("red", "blue")') As we can see above, we want to insert 2 words and we type them as when we are typing whole the codes. But i want … | |
memoryc = open("cipher.txt", "a") memoryd = open("decipher.txt", "a") #------------------------------------------------------------------------------- choice = input("cipher, decipher or memory") #------------------------------------------------------------------------------- if choice == "cipher": message = input("What is your message?") key = int(input("What is your key?")) coded_message = "" for ch in message: code_val = ord(ch) + key if ch.isalpha(): if code_val > ord('z'): … | |
https://friendpaste.com/mTdjXilQ0bVQJpsoCu1Wf i am having the error (float' object has no attribute 'insert').I am getting the same error with append. any solutions??? I am using python 3.4.2 .Thanks in advance. | |
Hello i am new to programming i trying to solve the follwing Allow 6 different players to throw dice 100 times The results sholuld be stored in the collection SCORES. Read the contents of SCORES and output many times in total each number was thrown. Also output whether or not … | |
I cant figure out what arguements to use or really even what arguements are. #Template for Program 2 #The keyword "pass" is a placeholder that does nothing #Move each line of original code into the appropriate module #Add arguments to calcBMI() and displayResults() as needed #original code -- not in … | |
Hi, I have two dictionaries and what I would like to do is to search if an item from dict1 is present at least 3 times in dict2. If so, do something. At the moment, I have something like this for line2 in list2: to_find=line2[3]+line2[4] if to_find in dic1: new_string=((" … | |
if I have something like the following file = open(filename, 'rb') for line in file: #do stuff Once I find what I'm looking for in file and it's placed in the line variable, how could I then capture that position withing file, not just line? | |
Greetings: I've noticed that many people on these boards have experience using PyGame, so I thought it would be cool if i shared a creation I am currently developing. This creation is called **PyDark**. Basically, PyDark is a *2D game framework* built on-top of Python and PyGame. What makes PyDark … | |
I'm making a shooting game, how would I make the gun point towards the mouse cursor? Here's part of my code: y = 100 x = 100 screen = pygame.display.set_mode((800,600)) p = pygame.image.load("Person.png") player = pygame.transform.scale(p, (34, 86)) pygame.key.set_repeat(1, 1) mx, my = pygame.mouse.get_pos() while True: screen.fill(white) for event in … | |
| Hi, is that possible Tkinter to play a video? And if not possible so what GUI programming that you can recomended? I already search in google, find a few but there's dead link.. I need to show 2 windows, first the original video, and the second is video after processing |
I used csv data readily available from http://www.weatherdatadepot.com/ to create a multiline plot of the average monthly temperatures of a given location. | |
| If I have an array >>> a=np.array([[1,2,1],[3,4,2],[6,5,3],[7,8,4]]) >>> a array([[1, 2, 1], [3, 4, 2], [6, 5, 3], [7, 8, 4]]) and I want to find if first column which have value=6 and if second column have value=5 using "IF" "ELSE" I try with: b=6 c=5 if (b in a[:,0]) … |
I am doing my homework and am having trouble on a certain problem. [I]4) A certain CS professor gives 100-point exams that are graded on the scale 90-100:A, 80-89:B, 70-79:C, 60-69:'D, <60:F. Write a program that accepts an exam score as input and prints out the corresponding grade.[/I] We have … | |
Hi everyone, I am having trouble comprehending or digesting the programming mentality. I'm learning Python and while I completely understand the syntax as well as the language itself, my problem is more toward the comprehension of thinking like a programmer. For example, once a programming exercise is explained, it all … | |
def fileToString(filename): myFile = open(filename, "r") myText = "" for ch in myFile: myText = myText + ch return myText def countVowels(text): vcount = 0 vowels = ['a','e','i','o','u'] for letter in text: if (letter in vowels): vcount = vcount + 1 return vcount write a program to calculate the following … | |
Hi, I am working on a GUI (more correctly, trying to), but I just don't really get it to work the way I want. The idea is to have a first list, where the user chooses one of the choices. Then depending on that choice, a new window pops out … | |
| |
The code that has been attatched (i couldnt post it for some reason) produces the error message: Traceback (most recent call last): File "filename", line 36, in <module> for i in range(len(bytesmessage)/7): TypeError: 'float' object cannot be interpreted as an integer In this line for i in range(len(bytesmessage)/7): The variable … | |
I'm currently making a program that saves the longest and shortest words in a sentence inside a list but i cant seem to append multiple words in a list as well as enter multiple sentence and only stop after a specific text or number is inputed. Python gui still confuses … | |
Hi everybody. I'm using python to create sql database. I created a test.db file and then made a table on it with the name "fims" and inserted some data on it.... title text, year text and director text. And then set values for them. Now when i type "sqlite3 test.db" … | |
Hello. I have used ScrolledText in my code, the scroll bar that appears is attached to the frame and although it scrolls the text box contents, I want that it was attached to the text widget itself. What can i do? | |
Hello, I have an one dimension numpy array with 1 to 5 numbers. I need to map these values to corresponding numbers between 0.76 to 1.24 with 0.12 interval. Then the problem is the find exact values in one array and fill the exact index in the second array. for … | |
Hello friends :) I'm almost familiar with Tkinter and Kivy frameworks, but i'm looking for other python GUI frameworks, soething better than Tkinter. Kivy is also great but i need to watch more tutorial videos and i'm not able to do that right now. Can you introduce a better and … | |
Hello, As Homework, we had to do the most boring thing known to Mankind, Mathletics. It is so easy. Mathletics links to live Mathletics where you have to answer as many Math questions as possible in 60 seconds. Later on, I found that Mathletics could be used as a challenge. … | |
**My goal:** search webapps folder to find all .war files and make sure a folder exists with the same name(indicating .war expansion) **My Code:** import os import stat file = open("hosts.txt","r") for servername in file: path = '\\\'+servername.strip()+'\\d$\\tomcat\\Servers\' server_name = servername.strip() for r,d,f in os.walk(path, topdown=False): for files in f: … | |
Hello everybody. I need a quick help. I have a problem with running my python file code. I use Linux. I had a file with the name "app3.py" file on the Desktop; then i removed ".py" from the end of the name of the file; so now i have "app3" … | |
I wanted to make a pattern in form- a b b c c c d d d d so far i've reached a a b a b c a b c d with this code for a in range (0,4): count=0 for y in range(0,a+1): print chr(ord('a')+ count), count+=1 print … |
The End.