4,305 Posted Topics
You can access the sound chip to play midi voices using winmm.lib, or in case of Dev C++ the libwinmm.a library. There are 128 midi voices to pick from, anything from the Acoustic Grand Piano = 0 to the Gunshot = 127. | |
| |
Re: [QUOTE=Azmah;1571184]What is python for?[/QUOTE] Python was developed to make programming your computer easier and quicker. | |
Re: Gee, here I thought the Brits only riot during soccer games. | |
Re: The Python Shell is only used to test short Python statements. Any regular Python programs are written on the editor of one of the IDEs available. If your friends have a Unix computer Python is most likely installed. With Windows computers you can encourage your friends to download and install … | |
Re: As they say in Las Vegas "Good Luck!" All we ever get is excessive heat warnings and smog from California wildfires. | |
Re: The effects of the sun on communications and computers ... [url]http://www.youtube.com/watch?v=NrIx6BKO6IE[/url] | |
Re: This would fix it, but I would rather go with a formal instance ... [code]class OffSwitch(object): def __init__(self): self.keycheck='off' def turnOff(self,key): if key==self.keycheck: SystemExit else: print('will continue') switchword=input('Enter a word: ') OffSwitch().turnOff(switchword) [/code] ![]() | |
Re: ... you wear black rimmed glasses that have been taped with white hospital tape, and your shirt has a pocket protector with about twenty pens sticking out of it. The perfect stereotype! :) | |
Re: Python27 and higher ... [code]# pad with leading zeroes print( "value is {v:0{digits}n}".format(v=2, digits=3) ) """result --> value is 002 """ [/code] | |
| |
Re: gasp has had it's last gasp (no pun intended) a long time ago For those who are curious, look here: [url]https://launchpad.net/gasp[/url] | |
| |
![]() | Re: Electric storage devices are not quite there yet to make a practical electric car. Might be just around the corner. If I would drive my electrical car by myself, would that be self-driven? |
Re: To read and manage Portable Document Files you can use the open source ReportLab toolkit (written in Python) from: [url]http://www.reportlab.org/rl_toolkit.html[/url] | |
Re: Leading a large country like the US is a thankless task at best. So, whoever manages to buy his or her way into the presidency will be an idiot to some, a savior to others, and hopefully a decent person to most of us. Unfortunately in the US news casts … | |
Re: Actually, Area 52 is much more interesting and rewarding. Area 51 is a military research facility that does boring things like perpetual motion helicopters, fusion differentiators, laser multipliers, tanks that use use water as fuel and such. | |
Re: You might want to check the example of a simple threading decorator here: [url]http://www.daniweb.com/software-development/python/threads/20774/1576229#post1576229[/url] It will show you that time.sleep() can run in the background. | |
Re: Take a look at the code snippet at: [URL]http://www.daniweb.com/code/snippet66.html[/URL] | |
Re: Here is an example, where the target and replacement words are in a dictionary. The Python module re is used to do the gruntwork ... [code=python]# read a text file, replace multiple words specified in a dictionary # write the modified text back to a file import re def replace_words(text, … | |
Re: Or do this ... [code]s = "04 f8 00 50 4f 30 fb 47 28 62 a7 6d 50 02 02 00 d2 7f 00 00" hs = "" for b in s.split(): hs += "\\x%02x" % int(b, 16) print(s) print(hs) ''' 04 f8 00 50 4f 30 fb 47 … | |
[B]Search for your answer first![/B] If you're having a problem, chances are good that someone else has had the same problem. Please search the forum for existing answers before starting a new thread. Nothing is more irritating to a long time member than to answer the same question for the … | |
Re: If I remember correctly, easygui is just a bunch of tkinter based dialog boxes. As a GUI toolkit it is BS to say it politely. Spend some time learning tkinter, it is a pretty powerful GUI toolkit, and you get used to GUI design and thinking. More advanced is PyQT … | |
Re: Hmm, tested mawe's code and it worked just fine ... [code]# mawe's vertical barschart def ascii_barchart(lst): for row in range(max(lst), 0, -1): for elem in lst: if elem >= row: print "# ", else: print " ", print lst = [2, 4, 7, 10, 8, 5, 3, 1] ascii_barchart(lst) '''my … | |
Re: Like tony mentioned, take a look at: [url]http://www.daniweb.com/software-development/python/threads/191210/1576303#post1576303[/url] | |
![]() | Re: If you used the Windows installer file python-2.6.6.msi, then the 'IDLE' IDE should work by double clicking on file C:\Python26\Lib\idlelib\idle.pyw Otherwise it's your firewall setting. |
Re: Hint, for instance, binary 10010 is calculated as 1*16+0*8+0*4+1*2+0*1 = decimal 18 | |
![]() | |
Re: PIL will be your answer. Here is an example ... [code]# load, resize and save image with Python Imaging Library (PIL) # optionally display images using Tkinter # PIL from: http://www.pythonware.com/products/pil/ # or # http://www.lfd.uci.edu/~gohlke/pythonlibs/ from PIL import Image # pick an image file you have .bmp .jpg .gif. .png … | |
Re: What does rf1 look like? Need only a few data lines. As far as I understand csv.writer() turns all data into strings, however you can specifiy the quote character this way: writer1 = csv.writer(wf1, quotechar="'") I know that's hard to see, but this is a single quote inside double quotes. … | |
Re: [QUOTE=bryceson;1589405]After looking through it, i found that the connection is not constant. meaning even though i connected to the basic authenticated web address, the connection fell through after and the authentication was no longer valid. In order to get the data to the web address, i found that i had … | |
One more application of the Python Image Library (PIL). This short code creates thumbnails from all JPEG files in the current folder. The thumbnail image file is prefixed with a T_ and saved to the same directory. The program checks for existing files with this prefix, so we don't create … | |
Re: Perhaps you can use this to help you ... [code]// attempt to trap arrow keys // tested with Code::Blocks 8.02 #include <stdio.h> static int get_code(void); // System dependent key codes enum { KEY_ESC = 27, ARROW_UP = 256 + 72, ARROW_DOWN = 256 + 80, ARROW_LEFT = 256 + 75, … | |
Re: If you use [B]power(2, 7)[/B] with the missing return the output is 7, this might give you a hint. Moral, use return or you get gibberish! | |
Re: Certain languages can be used for scripting within programs written with perhaps other languages. Interpreted languages like Python can be used for scripting and regular programming. The Python interpreter can be packaged into a relatively small linked library file. | |
Re: I think you are correct since the OP only made one post at all. | |
Re: Hmm ... [code]a = list(range(10)) print a[::-----1] [/code] | |
Re: Python27 is simply a more advanced Python26 with a fair number of Python3 features thrown in to help the user in the transition to Python3. | |
Re: Just in case you have an older version of Python ... [code]test_text = "dog,cat,bird,good,bad,blah1,blah2,blah3" # let's save the test text to a file ... fname = "aatest.txt" fout = open(fname, "w") fout.write(test_text) fout.close() # now you can read it back and print it ... fin = open(fname) text = fin.read() … | |
Re: The nice thing about using a list of (char_frequency, char) tuples is that they also sort the characters that have matching frequencies ... [code]# create a list of (char_frequency, char) tuples import pprint text = "supercalifragilisticexpialidocious" # create a character list of the text ch_list = list(text) # create a … | |
Re: Use [B]import wx.lib.newevent[/B] | |
Re: There are people that blame the sun for their beach sunburn. | |
Re: Python 3.2.1 final is supposed to be released on June 19th. Curious if they fixed that Windows induced '\n\r' bug. | |
Re: Check out: [url]http://www.daniweb.com/software-development/python/threads/191210/1576303#post1576303[/url] | |
Re: Arguing about religious preferences is even worse than arguing about political preferences. ![]() | |
Re: Yes, PyQT comes with the designer! See: [url]http://www.daniweb.com/forums/post1108430.html#post1108430[/url] |
The End.