15,181 Topics

Member Avatar for
Member Avatar for MustafaScript
Member Avatar for Niloofar24

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?

Member Avatar for Niloofar24
0
30K
Member Avatar for Niloofar24

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 …

Member Avatar for vegaseat
0
4K
Member Avatar for Niloofar24

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 …

Member Avatar for vegaseat
0
5K
Member Avatar for rhys_1

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'): …

Member Avatar for Ene Uran
0
315
Member Avatar for Johnny Blaz

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.

Member Avatar for Gribouillis
0
201
Member Avatar for jac@

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 …

Member Avatar for HiHe
0
534
Member Avatar for Julie_2

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 …

Member Avatar for Julie_2
0
499
Member Avatar for giancan

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

Member Avatar for giancan
0
233
Member Avatar for lewashby

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?

Member Avatar for lewashby
0
199
Member Avatar for Froweey

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 …

Member Avatar for Gribouillis
1
149
Member Avatar for zac_2

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 …

Member Avatar for Froweey
0
167
Member Avatar for ShilohAmi

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

Member Avatar for ShilohAmi
0
1K
Member Avatar for vegaseat

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.

1
327
Member Avatar for ShilohAmi

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

Member Avatar for ShilohAmi
0
241
Member Avatar for A_Dubbs

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 …

Member Avatar for vegaseat
0
13K
Member Avatar for webmeat

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 …

Member Avatar for Gribouillis
0
223
Member Avatar for Foday_1

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 …

Member Avatar for HiHe
-1
241
Member Avatar for doule

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 …

Member Avatar for Gribouillis
0
224
Member Avatar for amin2005
Member Avatar for HiHe
-2
112
Member Avatar for differentiation

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 …

Member Avatar for HiHe
0
249
Member Avatar for Decode098

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 …

Member Avatar for HiHe
0
300
Member Avatar for Niloofar24

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

Member Avatar for HiHe
0
310
Member Avatar for Niloofar24

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?

Member Avatar for HiHe
0
340
Member Avatar for Afi83

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 …

Member Avatar for Gribouillis
0
595
Member Avatar for Niloofar24

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 …

Member Avatar for vegaseat
0
841
Member Avatar for python3

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

Member Avatar for amin2005
0
345
Member Avatar for huskeraider

**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: …

Member Avatar for Gribouillis
0
282
Member Avatar for Niloofar24

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

Member Avatar for Gribouillis
0
435
Member Avatar for harsh.khanna.37

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 …

Member Avatar for HiHe
0
136

The End.