4,305 Posted Topics

Member Avatar for vegaseat

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.

Member Avatar for moxy
3
3K
Member Avatar for mrnutty
Member Avatar for vuyiswamb
Member Avatar for TrustyTony

[QUOTE=Azmah;1571184]What is python for?[/QUOTE] Python was developed to make programming your computer easier and quicker.

Member Avatar for Azmah
4
775
Member Avatar for frogboy77
Member Avatar for Micko

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 …

Member Avatar for darkside2205
0
327
Member Avatar for Dani

As they say in Las Vegas "Good Luck!" All we ever get is excessive heat warnings and smog from California wildfires.

Member Avatar for Dani
0
112
Member Avatar for royng
Member Avatar for Shanti C

The effects of the sun on communications and computers ... [url]http://www.youtube.com/watch?v=NrIx6BKO6IE[/url]

Member Avatar for Netcode
0
924
Member Avatar for JoshuaBurleson

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]

Member Avatar for Enalicho
0
242
Member Avatar for sneekula

... 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! :)

Member Avatar for Netcode
0
674
Member Avatar for pseudorandom21
Member Avatar for TrustyTony

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]

Member Avatar for Purkinje
1
195
Member Avatar for abdelhakeem
Member Avatar for nick.crane
0
451
Member Avatar for shasta90

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]

Member Avatar for ~s.o.s~
0
1K
Member Avatar for Serunson
Member Avatar for Falcon25

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?

Member Avatar for blackcathacker
2
400
Member Avatar for sneekula

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]

Member Avatar for rogerluz
0
282
Member Avatar for pseudorandom21

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 …

Member Avatar for pseudorandom21
0
660
Member Avatar for Sadun89

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.

Member Avatar for Netcode
0
168
Member Avatar for aot

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.

Member Avatar for txfoo
0
1K
Member Avatar for pretu

Take a look at the code snippet at: [URL]http://www.daniweb.com/code/snippet66.html[/URL]

Member Avatar for jayeshkamble143
0
599
Member Avatar for sneekula

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

Member Avatar for halamas
0
20K
Member Avatar for debasishgang7

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 …

Member Avatar for debasishgang7
0
1K
Member Avatar for vegaseat

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

Member Avatar for bumsfeld
6
768
Member Avatar for jodata26

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 …

Member Avatar for SamarthWiz
0
386
Member Avatar for sys73r

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 …

Member Avatar for sys73r
0
764
Member Avatar for hughesadam_87

Like tony mentioned, take a look at: [url]http://www.daniweb.com/software-development/python/threads/191210/1576303#post1576303[/url]

Member Avatar for hughesadam_87
0
118
Member Avatar for rickyfre

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.

Member Avatar for vegaseat
0
105
Member Avatar for cesione
Member Avatar for N1GHTS
0
2K
Member Avatar for Unhnd_Exception
Member Avatar for Thropian

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 …

Member Avatar for Thropian
0
14K
Member Avatar for Caraka

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

Member Avatar for Caraka
0
869
Member Avatar for AnjaliThukral

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

Member Avatar for vegaseat
-1
1K
Member Avatar for vegaseat

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 …

Member Avatar for thenate
1
2K
Member Avatar for asrockw7

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

Member Avatar for vegaseat
0
7K
Member Avatar for dotancohen

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!

Member Avatar for vegaseat
0
200
Member Avatar for mariko

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.

Member Avatar for vegaseat
0
165
Member Avatar for jml101
Member Avatar for vegaseat
0
721
Member Avatar for TrustyTony
Member Avatar for TrustyTony
3
673
Member Avatar for hszforu

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.

Member Avatar for hszforu
0
194
Member Avatar for debasishgang7

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

Member Avatar for vegaseat
0
157
Member Avatar for vlady

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 …

Member Avatar for vlady
0
1K
Member Avatar for Eswarimallur
Member Avatar for Ancient Dragon
Member Avatar for TrustyTony

Python 3.2.1 final is supposed to be released on June 19th. Curious if they fixed that Windows induced '\n\r' bug.

Member Avatar for vegaseat
0
223
Member Avatar for katrien202

Check out: [url]http://www.daniweb.com/software-development/python/threads/191210/1576303#post1576303[/url]

Member Avatar for Ene Uran
0
80
Member Avatar for mrnutty

Arguing about religious preferences is even worse than arguing about political preferences.

Member Avatar for iamthwee
2
1K
Member Avatar for jingda
Member Avatar for Lardmeister
0
372
Member Avatar for ultimatebuster

Yes, PyQT comes with the designer! See: [url]http://www.daniweb.com/forums/post1108430.html#post1108430[/url]

Member Avatar for vegaseat
0
138

The End.