407 Posted Topics
Re: The Gamucci Micro Electronic Cigarette (a rechargeable, electronic, smoke anywhere cigarette) for £49.95 should be the perfect gag gift. | |
Re: Maybe Mojave was really XP with a little Apple pizzazz thrown in. | |
Re: [QUOTE=omol;675719]It's not that they forgot, it's that 2 digits took up one hell of alot less memory than 4. It's from a time when people were forced to close things to stop memory leaks because there was that little of it. Not like now, who cares if you loose a … | |
Re: [QUOTE=Ene Uran;672211]... That is the way geography is taught in our public schools. ...[/QUOTE]You are giving the educational level of the US public school system too much credit. Of course I went to a Roman Catholic school, and we at least covered parts of Italy. | |
Re: In the second approach you should use class1.btn.config(command = self.update) | |
Re: Tutorials for the wxPython GUI toolkit: not bad ... [url]http://wiki.wxpython.org/AnotherTutorial[/url] this is one I like ... [url]http://zetcode.com/wxpython/[/url] | |
Just a place you can bitch about the different generations. Don't be bashful, spill your opinionated guts! Here is my analysis: Oldies Generation ... people born before 1930 Silent Generation ... people born between 1930 and 1945 Baby Boomers ... people born between 1945 and 1961 Generation X ... people … | |
Re: [QUOTE=Lardmeister;660521]What other purposes would you do in a church?[/QUOTE]One of our neighborhood churches was converted into a dance studio. | |
Re: Let's put some bigotry on the other shoe: What is the difference between a man and a government bond? Bonds mature What did God say after creating man? I can do better What do you call a man with half a brain? Gifted What does a man consider as a … | |
Re: Create a frame in your top window and put your widgets on that. A frame destroy will destroy the frame and the widgets on it. Now you can create a new frame and widget set. | |
Re: You have to let your function return something and assign it after the call: [code=python] something = 1 def dosomething(): something = 2 return something print something something = dosomething() print something [/code] | |
Re: I love my country, it's the government I fear! | |
Re: Windows supports real multitasking, it can boot and crash simultaneously. | |
Re: These are the name, age arguments of that particular instance linking back to the superclass. In other words, each inherited superclass is unique to that instance. | |
Re: As far as I understand it, Python has a very efficient builtin memory manager and user memory allocation is not need or wanted. | |
Re: Maybe something like this: [code=python]def bubbleSort(list1): swap = False for j in range(len(list1)-1): for k in range(len(list1)-1-j): if list1[k] > list1[k+1]: list1[k], list1[k+1] = list1[k+1], list1[k] swap = True if swap == False: break list1 = [4, 6, 2, 8, 1] bubbleSort(list1) print list1 # [1, 2, 4, 6, 8] … | |
Re: There are plenty of good jobs around the LA area, somebody has to take care of all the damaged hero veterans. | |
Re: Look in "Starting wxPython (GUI code)" right on this forum, for instance: [url]http://www.daniweb.com/forums/post624835-12.html[/url] | |
Re: There are some dangling lines in your code like: Link_Name,Link_Model,Router_A,Router_B,Data_Rate,Direction,COIN=fields or CELL_NAME, SWITCH, SWITCH_NAME, LONG, LAT, COINS=fields Are those comments? If yes, they need a # in front. | |
Re: Nice observation! Trap the error with try/except like this: [code=python]def my_func(aaa, main_var=None): try: mvar = [key for key, val in main_var.items() if val==aaa][0] print aaa, main_var, mvar except: print aaa # other code follows pass def main(): test_var = 123 my_func(test_var, vars()) my_func(123, vars()) my_func(456, vars()) my_func(123) main() """ my … | |
Re: I just saw that in my LA neighborhood: $4.99 for a gallon (3.8 liters) of regular gasoline. I guess the fuel wars are on in the good old USA! For our friends in Europe, that's 0.85 Euro per liter. | |
Re: Watching and listening to the surf come in, is very inspiring to my creativity. Not quite sure how my notebook handles sand and salt. | |
Re: Looking for a male couch/mouse potato with a large beer belly and a minor amount of hair on top, should be ugly enough to scare any insects out of my place. | |
Re: anakastakis: Thank you for giving the rest of us the solution of your problem. | |
Re: The internal run (ctrl/F9) is pretty klutzy when you have even the slightest error in your code, it simply shuts down!!!! The external run (alt/F9) behaves more normal, showing you the error message in the output window. So, I would say use alt/F9. The little green run symbol should have … | |
Re: Save your script as somefilename.py and double click on the name to run it from the Windows file manager. Or better, use the editor of an IDE like IDLE, DrPython or PyScripter to write your code and run it from there. See: [url]http://www.daniweb.com/forums/thread20774.html[/url] | |
Re: Use something like this: [code=python]self.button2 = Button(frameToolbar, text="PRINT", bg="light green", width=5, relief=RAISED, font=("Verdana", "9", "bold"), command=self.print_) self.button2.grid(row=0, column=0) self.button = Button(frameToolbar, text="CLOSE", bg="red", width=5, relief=RAISED, font=("Verdana", "9", "bold"), command=self.destrparent) self.button.grid(row=0, column=1) self.button1 = Button(frameToolbar, text="SUM", bg="light blue", width=5, relief=RAISED, font=("Verdana", "9", "bold"), command=self.mult) self.button1.grid(row=0, column=2) [/code] Please use code tags … | |
Re: You have simple use the try/except error routine: [code=python]numblist = [1 , 2 , 3, 5, 6, 7, 8, 9, 11] for i in numblist: try: if numblist[i] == numblist[i + 1] - 1: print 'yay' else: print 'gap' except: pass [/code] | |
Re: Hopefully it's 41 month at hard labor! Oh yes, no computer in the prison cell, and let his cellmates be 350 pound horny roughnecks. | |
Re: Go Settings/Preferences/Calltips and mark enable. It works, but is rather poorly implemented. | |
Re: Welcome to the world of self! Just a side note, the Python style guide recommends to start class names with upper case and function/method names with lower case. If you write larger programs, this really helps. The Python style guide by GVR himself: [url]http://www.python.org/peps/pep-0008.html[/url] | |
![]() | Re: You could use module re and its sub() method. ![]() |
Re: I suggest you study your class notes more carefully. Here is a short example that might help you: [code=python]class Die(object): def __init__(self, v): """ the constructor of the class self 'carries' the instance dice initially has value v """ self.value = v def __str__(self): """overload __str__ will be used in … | |
Re: Wonder why it's called "The Stupid Test" and not "The Smart Test"? | |
Re: Eating a large amount of beans and then do one or more of the following: Take a bubble bath. Get my teeth checked at the dentist. Go to an IRS audit. Go to jury duty. | |
Re: I wonder if folks celebrate Mothers Day in every country on Earth? | |
Re: Paranormal experts say the peak of people's ability to see ghosts is when they're 7 years old. Sorry, I put this in here by accident, but then it could fit here just as well. | |
Re: The standard try/except way would be: [code=python]def choose(s): try: return "You entered " + { '1' : "one", '2' : "two", '3' : "three" }[s] except: return "Bad input" var1 = raw_input("Input a number between one and three: ") print choose(var1) [/code]Or straight foreward with dictionary method get(): [code=python]def choose2(s): … ![]() | |
Re: Vegaseat has given Tkinter a namspace tk. Good coding practice to avoid method collisions, and to tell folks that read your code where the method came from. Is that what's confusing to you? | |
Re: The whole thing is a little bit like the painted flags on some military uniforms. Most folks don't know what they are for. I always thought that the stars where the LOL count. | |
Re: With Python that is a simple task: [code=python]import os # list just the files in a given folder folder = 'C:/Temp' for (paths, dirs, files) in os.walk(folder): # testing, this shows a list of filenames print files # now loop through the list of filenames for filename in files: # … | |
Re: [QUOTE=Igor_MK;602567]ok I used: [code=python] diffInstance = difflib.Differ() diffList = list(diffInstance.compare(list1, list2)) [/code] and this returns a list of words with + - before them. As I read and understand probably - means just list1 has the word, and + that just list2 has the word. And I'm not getting and … | |
Re: Oh, how sweet it is of you to think of your mother on her special day! | |
Re: [QUOTE=joshSCH;523925]You serious? Yahoo has been sucking the last few years. Yahoo should take the money and run... and I guarantee that's what they'll do.. And yeah, of course Microsoft wants dominance on the web.. However, they wont have long.. Once the dems take control of all three branches of government, … |
The End.