- Strength to Increase Rep
- +15
- Strength to Decrease Rep
- -3
- Upvotes Received
- 584
- Posts with Upvotes
- 494
- Upvoting Members
- 185
- Downvotes Received
- 15
- Posts with Downvotes
- 15
- Downvoting Members
- 14
Re: [QUOTE=;][/QUOTE] You can't mention drinking without some of W.C. Fields' sayings "A woman drove me to drink and I didn't even have the decency to thank her." "Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake." Not drinking related, but one of … | |
Re: You search a dictionary in this way, and note that names would be case sensitive: [CODE]def search(dict1): name2=raw_input("Enter the name whose number is to be found: ") if name2 in dict1: print name2, dict1[name] [/CODE] | |
Re: I am watching fewer shows because of the commercials. To watch any show you have to be willing to watch the commercials, or as I am doing more and more now, recording the show and fast-forwarding through the commercials. If a commercial contains Debbie Boone or insurance sold by the … | |
Re: See the last post here for the general idea [url]http://www.daniweb.com/forums/thread158680.html[/url] You want to use some variable in a while loop that you can set to false if (1) the correct word is guessed, (2) the maximum number of guesses is reached, (3) any other exit criteria. You can also use … | |
Re: Start with tkinter basics. As already stated, the Label isn't going to change, so using cget() on a label does not provide any useful data. Second, start with one get. You have 178 lines of code, and a lot of it is wrong and has to be changed. Take any … | |
Re: Use subprocess.run() https://python.land/operating-system/python-subprocess It receives a list, so it is easy to include parameters. Be sure to read about the shell=True option and decide whether it is necessary or not. | |
Re: Is this correct? from wxPython.wx import * In any case, you may have to install/re-install wxPython. | |
Re: I would guess the problem to be the columnspan or sticky parameters. You can try different combinations of those, but also might want to post to a Tkinter forum like [url=http://www.manning-sandbox.com/forum.jspa?forumID=51]Manning's[/url] as many of us use the Pmw extension which has scrollbars built in. | |
Re: Your indentation is off. Look at a basic tutorial and classes. https://wiki.python.org/moin/BeginnersGuide | |
Re: First, don't use pack() and place(). How is Tkinter to know which one to apply to the widget. Don't start multiple instances of Tk(). Same thing. How is Tkinter supposed to know which one you are referring to. Use a Toplevel() instead. This modified code does what I think you … | |
Re: The standard solution for anagrams is to sort on the letters. So 'ogd' sorted is 'dgo', and a lookup of the 'dgo' key in the dictionary yields the list ["dog", "god"]. Your code would only return whichever one of these words it found first. Also, you should not use "dict" … | |
Re: [quote]The computer should make the user always select from a pile where the number of matchsticks has a remainder of 1 when divided by 4.[/quote] [code]import random # choose some random numbers and the appropriate number to pick up # so that the number of sticks = num*4+1 # no … | |
Re: First try using idle instead of Notepad. You can enter, save, and run the program from Idle. It should be under the python and then idlelib directories, and is something like Idle.py-I don't remember. That will solve the immediate problem. Your solution should work also, so it may be that … | |
Re: You should put this in a function that you can call repeatedly instead of duplicating code. | |
Re: The question itself is not clear [quote]from start to the end number (inclusive)[/quote]but the results do not include the end number [quote] range(1, 11, 2) will return a list of numbers [1,3,5,7,9][/quote]. | |
Re: Take a look at the "Starting Python" sticky at the top of this forum. There are many resources, including the Google (free) online course. | |
Re: The Xerox Palo Alto Research Center, known as Xerox PARC, developed the graphical user interface (GUI), laser printing, WYSIWYG text editors, and Ethernet. And perhaps more importantly developed object oriented programming. | |
Re: How do you determine boundaries? I would suggest that you post some stripped down code, i.e without all of the plotting, etc. as that has nothing to do with "outside boundaries". Include also an explanation of how you would like to determine what is outside the boundaries. | |
Re: Where does dollars come from, and how is it different from total_value def get_left_over_cents(pennies, nickels, dimes, quaters): total_value = get_dollars(pennies, nickels, dimes, quaters) left_over_cents = int(100 *(total_value - dollars)) | |
Re: login() is declared uner the class, even though it is not a member of the class. | |
Re: You have to grid, pack or place widgets to get them to appear http://www.effbot.org/tkinterbook/grid.htm | |
Re: >Can anyone help me? Not without knowing what you have tried. The number buttons is a simple for loop this_row = 2 this_col=0 for num in [7, 8, 9, "*", 4, 5, 6, "-", 1, 2, 3, "+"]: Button(btns_frame, text = num, fg = "black", width = 10, height = … | |
Re: You have made the classic mistake of including even numbers = testing twice as many numbers. Start out with i=3 and add two on each pass. | |
Re: The smallest time displayed is seconds. The function is called every 2/10 of a second, so the clock is not updated if the time to the second has not changed. | |
Re: So we are spending our time on simple toggles huh. This uses a list so the function has access to the previous setting. I was too lazy to create a class with an instance variable. try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk … | |
Re: > chmod u=rwx,g=rx,o=r myfile "This example uses symbolic permissions notation. The letters u, g, and o stand for "user", "group", and "other". The equals sign ("=") means "set the permissions exactly like this," and the letters "r", "w", and "x" stand for "read", "write", and "execute", respectively. The commas separate … | |
Re: A simple split will do the trick test =""" [ "this is a text and its supposed to contain every possible char." ], [ "like *.;#]ยง< and many more." ], [ "plus there are even newlines in it." ]""" x=test.split('[\n') for rec in x: print(rec) print("-"*20) | |
Re: Generlly, you send the button number to the function. Also, you import Tkinter twice. Which one is the program supposed to use? |