4,305 Posted Topics
Re: I agree, this seems to be an IDE problem at times, since IDEs have their own output area. | |
Re: There are not enough Hungarians to sort some of my arrays. :) | |
Re: 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 = … | |
Re: Your mind gets better with good experience. Eventually you learn to avoid painting yourself into a corner. | |
| |
Re: Megabucks is my third brindle Cairn Terrier and looks a lot like Toto in the movie The Wizard of Oz. | |
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 … | |
Re: Maybe your depression is more deep-rooted and shows through in your applications. You might want to look for medical help. | |
Re: 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 … | |
Re: I keep a rather comprehensive data base of good code examples. Search by keywords. It makes coding life easier. | |
| |
Re: 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 ''' | |
Re: # error redirection=0 to console # error redirection=1 to dialog window app = wx.App(1) | |
Re: You could try to or the permissions with '|' | |
Re: try: # for Python2 import Tkinter as tk import tkFileDialog as tkfd except ImportError: # for Python3 import tkinter as tk import tkinter.filedialog as tkfd | |
Re: # error redirection=0 to console # error redirection=1 to dialog window app = wx.App(1) | |
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. | |
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. | |
Re: 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 ''' | |
Re: The problem seems to be in one of your library files. Can't help you since Python25 has died many years ago. | |
Re: Give us a short sample of one of your CSV files and what you want to accomplish. | |
Re: It's a long code, but you may have and endless loop somewhere. | |
Re: 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 … | |
Re: I think you need to be more specific. | |
Re: > 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. | |
Uses the PySide GUI toolkit's QtMultimedia module to play a specified sound. You can change frequency/pitch and volume of the sine wave. | |
Re: 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 | |
Re: Using global variables is clumsy and leads to errors. You should declare modlidvar as global in function valider() to be consistent. | |
Re: "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 | |
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. | |
Re: Not sure if PythonCard has this in its widget list. With wxPython you have to ... **import wx.lib.filebrowsebutton** | |
Re: I remember playing around with it, but didn't see any advantages over C++. | |
![]() | Re: I would simply stick with 32bit versions of Python. |
Re: 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))) | |
Re: You need to print count value | |
Re: Makes me wonder which computer language Albert Einstein would have use had he lived long enough. | |
Re: command takes a function reference and **return** is no such object | |
Re: 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. … | |
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. | |
Re: What are the sizes of backg.png and supptruck.png? | |
Re: I have really not aged in the last 20 years. Maybe I have always been old? | |
Re: What kind of files are you talking about? | |
Re: You could avoid upper case letters with `original = raw_input('Enter a word: ').lower()` | |
![]() | Re: I would go with Python and C++, these OOP languages have much in common. |
The End.