4,305 Posted Topics

Member Avatar for HiHe
Member Avatar for vegaseat
0
338
Member Avatar for ddanbe
Member Avatar for ddanbe
0
105
Member Avatar for dreking6

Mildly modified so it will actually work ... from Tkinter import * import tkMessageBox def m_km(): content = int(E1.get()) # force floating point division km = content/1000.0 #print(km) # test tkMessageBox.showinfo("Answer" , "%f km" % (km)) root=Tk() label = Label(root, text="converter", relief=RAISED) label.pack() E1 = Entry(bd=5) E1.pack() E1.focus() L1 = …

Member Avatar for dreking6
0
2K
Member Avatar for minitauros
Member Avatar for theguitarist

Your mind gets better with good experience. Eventually you learn to avoid painting yourself into a corner.

Member Avatar for Reverend Jim
0
386
Member Avatar for Trap910
Member Avatar for jingda

Megabucks is my third brindle Cairn Terrier and looks a lot like Toto in the movie The Wizard of Oz.

Member Avatar for <M/>
0
430
Member Avatar for imBaCodes
Member Avatar for vegaseat
Member Avatar for vegaseat

So you want to find out which day of the week you were born. Well at least some of us do. I actually wrote this program because my whole family was born on Sundays, and my friends didn't believe it! An oldie but goodie, moved from DeSmet C to Turbo …

Member Avatar for 1baga
3
2K
Member Avatar for nitin1

Maybe your depression is more deep-rooted and shows through in your applications. You might want to look for medical help.

Member Avatar for nitin1
-1
509
Member Avatar for Tcll

I have always regarded Eclipse as bloated, and since it is written in Java, very sluggish. Now, Visual Studio is gigantic and hopefully a little quicker. If you already have VS then Python Tools might just be the answer. For me, portability is very important. Comparing the 8MB PyScripter IDE …

Member Avatar for Tcll
0
657
Member Avatar for london-G

I keep a rather comprehensive data base of good code examples. Search by keywords. It makes coding life easier.

Member Avatar for <M/>
0
119
Member Avatar for Klahr_R
Member Avatar for james.lu.75491856

Python baby ... ''' factorial_oneliner.py get the factorial of integer n ''' fact = lambda n:[1,0][n>1] or fact(n-1)*n # test it ... print(fact(53)) ''' result ... 4274883284060025564298013753389399649690343788366813724672000000000000 '''

Member Avatar for vegaseat
0
171
Member Avatar for pythonforlife
Member Avatar for bumsfeld
0
460
Member Avatar for lewashby
Member Avatar for lewashby

try: # for Python2 import Tkinter as tk import tkFileDialog as tkfd except ImportError: # for Python3 import tkinter as tk import tkinter.filedialog as tkfd

Member Avatar for vegaseat
0
1K
Member Avatar for pythonforlife

# error redirection=0 to console # error redirection=1 to dialog window app = wx.App(1)

Member Avatar for vegaseat
0
226
Member Avatar for vegaseat

A simple way to create rainbow colored text on your web page. Just cut and paste the code into Notepad, save as Rainbow.htm and run it on your browser.

Member Avatar for Troy III
3
600
Member Avatar for vegaseat

In today's environment where just about anyone can snoop around your e-mail, it is prudent to securely encrypt your more private writings. This little Python program will make it easier to do so.

Member Avatar for vegaseat
4
456
Member Avatar for lewashby

This works ... s = '1234567897' number = 7 print(s.count(str(number))) ''' 2 ''' This gives you an error since str variable name interferes with str() function name ... str = '1234567897' number = 7 print(str.count(str(number))) ''' TypeError: 'str' object is not callable '''

Member Avatar for lewashby
0
1K
Member Avatar for james.lu.75491856

The problem seems to be in one of your library files. Can't help you since Python25 has died many years ago.

Member Avatar for Gribouillis
0
3K
Member Avatar for Hamza_4
Member Avatar for Hamza_4
0
384
Member Avatar for Turo1
Member Avatar for nytman

You could roll your own function, something like this ... def isnumeric(s): '''returns True if s is numeric''' return all(c in "0123456789.+-" for c in s) With today's challenged educational levels this may not pass the test. A more fool proved version ... ''' isnumeric.py test a numeric string s …

Member Avatar for nytman
0
19K
Member Avatar for danielsikes
Member Avatar for james.lu.75491856

> I am a computer, dumber than any human and smarter than an administrator. Use this as an example text for a program your boss will see.

Member Avatar for james.lu.75491856
0
475
Member Avatar for vegaseat

Uses the PySide GUI toolkit's QtMultimedia module to play a specified sound. You can change frequency/pitch and volume of the sine wave.

2
1K
Member Avatar for entropic3105

Here are some links ... http://www.daniweb.com/software-development/python/tutorials/47392/multimedia-introducing-the-webbrowser-module http://www.daniweb.com/software-development/python/code/459779/select-a-sound-file-and-play-it-wxpython http://www.daniweb.com/software-development/python/code/454835/let-pygame-play-your-midi-or-mp3-files http://www.daniweb.com/software-development/python/code/216601/musical-beeps-python http://www.daniweb.com/software-development/python/code/357467/getting-tksnack-sound-module-to-work-with-python3

Member Avatar for vegaseat
0
369
Member Avatar for Ismatus3

Using global variables is clumsy and leads to errors. You should declare modlidvar as global in function valider() to be consistent.

Member Avatar for vegaseat
0
202
Member Avatar for rmad17

"Dive Into Python" Mark Pilgrim's free online book, novice to pro, is updated constantly, and has been rewritten for Python3 http://diveintopython3.net/ check appendix A for Py2-to-Py3 differences

Member Avatar for rmad17
0
313
Member Avatar for wayce
Member Avatar for vegaseat

This code snppet uses the wx.lib.filebrowsebutton.FileBrowseButton widget to pick a file, in this case a '.wav' sound file, and plays it with the wx.Sound widget.

Member Avatar for vegaseat
1
1K
Member Avatar for james.lu.75491856

Not sure if PythonCard has this in its widget list. With wxPython you have to ... **import wx.lib.filebrowsebutton**

Member Avatar for vegaseat
0
108
Member Avatar for NardCake

I remember playing around with it, but didn't see any advantages over C++.

Member Avatar for james.lu.75491856
0
215
Member Avatar for revellution
Member Avatar for stealthless

Take a close look t this ... user_input_list = [] while True: user_input = input("Enter an integer: ") # condition to exit loop if user_input == "done": break user_input_list.append(int(user_input)) #print(user_input_list) # test print("The sum of your numbers is {}".format(sum(user_input_list)))

Member Avatar for edward.okech.5
0
228
Member Avatar for stealthless
Member Avatar for bumsfeld

Makes me wonder which computer language Albert Einstein would have use had he lived long enough.

Member Avatar for rubberman
1
332
Member Avatar for m_ishwar
Member Avatar for Schol-R-LEA
0
223
Member Avatar for Jacklittle01
Member Avatar for Jacklittle01

Here is an example ... """ con_setup2.py Using cx_freeze with Python33 to package a console program to an executable file (.exe in Windows OS). Might want to put a console-wait-line in at the end of your program. Put this setup program and your console program file into the same directory. …

Member Avatar for vegaseat
0
370
Member Avatar for vegaseat

The wxPython Phoenix project can be used with Python version 2 and version 3. The project applies pretty much the familiar wxPython code. Here we are testing a dragable borderless frame.

Member Avatar for vegaseat
3
1K
Member Avatar for 26bm
Member Avatar for Xantipius
Member Avatar for Stuugie

I have really not aged in the last 20 years. Maybe I have always been old?

Member Avatar for BigPaw
0
439
Member Avatar for kamald123
Member Avatar for toniann.midori

You could avoid upper case letters with `original = raw_input('Enter a word: ').lower()`

Member Avatar for vegaseat
0
158
Member Avatar for napninjanx

The End.