I am running a program that I wrote (a compression program {it is not finished yet}), and when I run it, my computer makes a continuous beeping sound (the same sound your computer makes if you press too many keys at once on the keyboard {in windows}). What is the cause of this beeping noise?
Beeping sound [solved]
Collapse
X
-
Tags: None
-
Welcome to the python forum! Thanks for diving in and helping!Originally posted by Subsciber123I am running a program that I wrote (a compression program {it is not finished yet}), and when I run it, my computer makes a continuous beeping sound (the same sound your computer makes if you press too many keys at once on the keyboard {in windows}). What is the cause of this beeping noise?
If you post some code, you give us a better idea of how to help you with your question. Keep posting,
Barton (moderator of this forum) -
maybe you are outputting a beep character, for instance:Originally posted by Subsciber123I am running a program that I wrote (a compression program {it is not finished yet}), and when I run it, my computer makes a continuous beeping sound (the same sound your computer makes if you press too many keys at once on the keyboard {in windows}). What is the cause of this beeping noise?
-kudosCode:print "\xA0"
Comment
-
Since I have not yet finished the program (and there are better compression programs), here is the code:
Code:def read(file): #reads the specified file try: file=open(file,"rb") except: file=open(file,"r") file.seek(globv.filelocation) text=file.read(1024) globv.filelocation=file.tell() file.close() return text def split(): #returns lgroups=[] unique=[] i=0 while i<globv.length: lgroups.append(globv.incoming_data[i]) if lgroups[-1] not in unique: unique.append(lgroups[-1]) i=i+1 return lgroups,unique def int_to_char(integer): #changes the base of numbers to string="" #256, and represents in chars while integer: char=integer%256 integer=(integer-char)/256 string=string+chr(char) return string def compress(file): #controls program globv.stop=False globv.filelocation=0 globv.final=[] while True: globv.incoming_data=read(file) if globv.incoming_data=="": break globv.length=len(globv.incoming_data) globv.chunks,globv.unique=split() globv.numbers=["empty"]*len(globv.chunks) i=0 for chunk in globv.chunks: globv.numbers[i]=globv.unique.index(chunk) i=i+1 globv.max=max(globv.numbers)+1 globv.total=0 for num in globv.numbers: globv.total=globv.total*(globv.max)+num globv.total=int_to_char(globv.total) globv.final.extend([globv.unique,globv.total]) # print globv.unique # print globv.numbers # print max(globv.numbers) print "\n" print globv.total print globv.final # print globv.chunks # print combinations class globv: #variable holding class pass if __name__=="__main__": #for use not as a module import time start_time=time.time() compress(raw_input("Compress a file: ")) # print globv.incoming_data raw_input(time.time()-start_time)Comment
-
Yep, I've got to go with kudos; you are printing a beep character.
I ran your code and this does not happen under IDLE. I recommend NOT using the command line and using an IDE like IDLE (especially because you are not calling compress with command line arguments). There are some really great IDEs out there. You may want to try Stani's Python Editor. (PythonWin works OK, but I don't like it. But it should already be on your system). Keep posting,
BartonComment
-
I use PythonWin, only because it was on my computer, and for some reason IDLE spontaneously stopped working (even though I completely reinstalled Python a few times with a few different versions). Do you know a place where I can get a good Python developer, such as the one you mentioned before, Stani's Python Editor. If I just don't print to the screen, will the beeping stop?Comment
-
If you comment out print of binary data statements, beeping will stop.Originally posted by Subsciber123I use PythonWin, only because it was on my computer, and for some reason IDLE spontaneously stopped working (even though I completely reinstalled Python a few times with a few different versions). Do you know a place where I can get a good Python developer, such as the one you mentioned before, Stani's Python Editor. If I just don't print to the screen, will the beeping stop?
Get spe at http://pythonide.stani.be/.Comment
-
Problem with IDLE is probably your firewall.Originally posted by Subsciber123I use PythonWin, only because it was on my computer, and for some reason IDLE spontaneously stopped working (even though I completely reinstalled Python a few times with a few different versions). Do you know a place where I can get a good Python developer, such as the one you mentioned before, Stani's Python Editor. If I just don't print to the screen, will the beeping stop?Comment
-
I don't think it is: The program won't even start.Originally posted by bartoncProblem with IDLE is probably your firewall.
Thank you, everyone, I solved the beeping problem, and got the "Stani's Python Editor" software.Comment
-
Now that you've got SPE, the whole world of wxPython just opened up.Originally posted by Subsciber123I don't think it is: The program won't even start.
Thank you, everyone, I solved the beeping problem, and got the "Stani's Python Editor" software.
It did for me, anyway, and I like it!Comment
Comment