15,181 Topics
| |
Why am I getting the above error message when I run this program? I'm running this program with an mp3 file as an argument, the mp3 file is in the same directory as the python program. There are 30 space reserved for the Title at positoin 125 from the end … | |
Im working on a small block of code that compares a argumented value to a file seached value. Every time i run the code it and give it the argumented value either lower or higher than i know the searched value is it gives me the opisite answer of what … | |
Based on this ideea **You just wrote a loop allowing the input of 20 names into a list. Alas, you made an error as you entered name number 17. Redesign your input loop, so you can correct the error easily without having to retype the previous 16 names.** I wrote … | |
I'm working on an IDE for a program I'm building, and just found out I need to use ast. I can't seem to find any decent examples to get me started on google... can someone help me out. :) thanks | |
So I have been working with a csv export for a few days now and I have the data almost in the form I need it in. I need some advice on how best to proceed to get to the soltuion I need. Here is the problem: My csv export … | |
I searched daniweb for related questions and google but i canot seem to find my problem in my code When I try to search for a word that exists in my list it returns false This is my code def main(): #the word that I am looking for word = … | |
Hi, I am very new to python and tried putting this code together in order to get an interface the size of the screenb but a canvas only half as tall: OFWidth=OedipusFrame.winfo_screenwidth() OFHeight=OedipusFrame.winfo_screenheight() OedipusFrame.geometry(("%dx%d")%(OFWidth,OFHeight)) OFSHeight = "%d/2" % OFHeight OTStart=Tkinter.Canvas(OedipusFrame, bg="blue", height="%d"%OFSHeight, width="%d"%OFWidth) All equations register correctly, but the frame … | |
I'm trying to write a program to get the artist and album from mp3 files. A simple test run on the Alice in Chanins song Rooster yielded this result -> `b'Rooster\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'` I set read to read(20) and if you count Rooster plus all the \x00s you'll see that it 20, … | |
a=[] f=0 print("BINARY SEARCH") print("ENTER NUMBERS IN ASCENDING ORDER") for i in range(0,9): k=int(input("ENTER THE ELEMENT AT ["+ str(i+1) +"]: ")) a.append(k) s=int(input("ENTER A NUMBER TO BE SEARCHED: ")) #print(a[1]) #exit() l=0 u=9 while[ l <= u ]: m=int( (l + u) / 2) if s==a[m]: f=1 break elif s>a[m]: … | |
I'm going to try and extract the artist and album from the meta data of an mp3 file with python but I need a little help. This is what I get on the tag line when I open an mp3 file in vim: ----> `ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTAGRooster^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@Alice In Chains^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@DIRT^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@1992` This is what … | |
First am I missing any other notable ones? I only want to know about crossplatform standalone source-based modules, so no Gui IDEs. Tkinter Pyjamas wxPython PyGObject (Gtk's successor) Qt I already know that `Tkinter` is the default so it is the obvious choice for crossplatform because of its licensing and … | |
Hey I'm just wondering how to make pop-up windows in tkinter. | |
I have tried a written a code like so re.findall(r'[A-Z]{3}[a-z][A-Z]{3}',string) to find the solution for this python challenge http://www.pythonchallenge.com/pc/def/equality.html it seems so hard to figure out. I'm getting 527 matches and none takes me to the next level. Help or close hints will be appreciated | |
path = './file.txt' os.remove(path) import os `os.remove(path)` is equal to `os.unlink(path)`, so how can I delete the file if it just becomes unlinked? Also I haven't tried to yet, but does `'./file.txt'` work as is or do I must provide the full path? Or do I just need to use … | |
I have been stuck on this python challenge http://www.pythonchallenge.com/pc/def/ocr.html . I am familiar with python re module and regex but I don't seem to get what the challenge wants me to do. If there's anyone else that has been there, I'll need some help | |
Hi I just installed SciPy stack on Ubuntu 14.04. Then I installed python-pyglet. For testing it, I tried the following in python 2.7.6 interactive mode: from sympy import symbols,Plot,sin x=symbols('x') Plot(5*sin(x**3)+x**2) But the only result is « [0] : x ** 2 + 5 * sin(x ** 3), 'mode=cartesian' » … | |
client side code import socket import sys s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("localhost",9999)) path=raw_input("Please enter the complete PATH of your file : ") f=open (path, "rb") l = f.read(2048) while (l): s.sendall(l) l = f.read(2048) s.close() server side code import socket import sys s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("localhost",9999)) s.listen(10) while True: … | |
I'm trying to build an interactive IDE... the IDE has a file testing interface which displays a tree of the called functions in relation to the data in the file being tested. what I want to do is when you select a function referenced in the tree, it'll highlight that … | |
Program For Standard Form def stnfrm(a,b,c): one = (b/(2.0*a)) two = c-((b**2.0)/(4.0*a)) axis = one/-1.0 x = -b/(2.0*a) y = a*(x**2.0)+(b*x)+c print x if a == 1: print "(x + %f)**2 + (%f)" % (one,two) elif a == -1: print "-(x + %f)**2 + (%d)" % (one,two) else: print "%d(x … | |
Ok so I'm trying to make a inter face with a password. my plan is to have a window open up with an input box where you type the password and then when you have the right password it brings you to the second screen with the stuff on it. … | |
my code tries to generate a tree for reversi/othello but it runs into an infinite while loop and i am unable to debug it.The purpose of this code is to make minmax algorithm for the aiplayer.please help. import numpy board=numpy.array([[0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0], [0,0,0,1,2,0,0,0], [0,0,0,2,1,0,0,0], [0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0]]) matrix_list=[numpy.copy(board)] points=[] decoy_list=[] … | |
I have two python script the first once contains my def callers and my command line arguments. The second one contains my defs that i want to use the command line arguments in. I was wondering if there was a way to call the command line arguments into the second … | |
I am working on s code that i want to add command line arguments to. I have read the docs.python page on this subject 3 or 4 times and it still has me conffused. I want to be able to set my base directory, change a send and recive email … | |
hello all; <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <meta charset="UTF-8"> <title>Our Local site</title> </head> <body> <form action="welcome.php" method="post"> <input id="t1" name="t1"type="text" placeholder="table name"><br> … | |
Using python 2.4.3 I'm trying to make a HTTP server which: (1) receives a message with 'POST', (2) makes an answer message, (3) send the answer message back to sender. Step (1) and (2) go well, Step 3 fails.... **sometimes**. It looks like there is some threading issue with the … | |
This snippet implements a pointed set, that is to say an ordinary set of elements with a distinguished element called the basepoint of the set. For example the seven days of the week could be stored in a pointed set, the basepoint being monday because today is monday. It is … | |
Hello please i need some help to rewrite this code in PHP to Python i am totally new in this and need this baddly please help if u can. Thanks a lot. <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>phpChart - Basic Chart</title> </head> <body> <?php function array_delete($array, … | |
I did code for challenge that I saw posted for C# by deceptikon: http://www.daniweb.com/software-development/csharp/threads/479304/coding-challenge-string-to-date Here it is. Of course normally the code would be without prints and put in function, but this is enough for now for me. There could also be normalization from '/' separated form not producing ambiguous … | |
I have a simple menu like this **HTML** <div> <ul> <li> <a href="#">Demo</a> </li> <li> <a href="#">Demo2</a> </li> <li> <a href="#">Demo3</a> </li> <li> <a href="#">Demo4</a> </li> <li> <a href="#">Demo5</a> </li> </ul> </div> **CSS** ul li:nth-child(1){border-top:4px solid red;} ul li:nth-child(2){border-top:4px solid pink;} ul li:nth-child(3){border-top:4px solid blue;} ul li:nth-child(4){border-top:4px solid orange;} Now … | |
How can I return the indexes of RBG? Say `p` is my *Numeric Python array*. >>>x = 58 >>>y = 72 >>>p[y][x] array([255, 255, 255], dtype=uint8) I don't know what a *Numeric Python array* is or how to handle them but I found how to convert it to `['255', '255', … |
The End.