- Strength to Increase Rep
- +13
- Strength to Decrease Rep
- -3
- Upvotes Received
- 227
- Posts with Upvotes
- 180
- Upvoting Members
- 85
- Downvotes Received
- 37
- Posts with Downvotes
- 31
- Downvoting Members
- 20
student
- Interests
- computers biology physics chemistry poetry
- PC Specs
- Toshiba 655D Notebook
| |
Re: According to the many TV crime shows it doesn't pay to be a criminal. | |
Re: Baked chicken with corn bread, beans and mashers. Love those mashed potatoes! Too young to drink ethanol! O.J. will do. | |
What kind of places or situations to you find the people to be best friends with? Is there a good reason why one place works better than others? A small poll of suggestion is attached. I should have added Sports, the Internet and Travel to the poll. | |
| Re: I wonder if there are any comic characters left to make movies with. |
Re: [QUOTE=lukescp;1104415]I tried what you have above; it seems the vars() statement in line 3 requires quotes around 'food': [code] vars()['food'] = 123 [/code] Otherwise works perfect.[/QUOTE] That is fine if you want to do this: [code]vars()['food'] = 123 print food # --> 123 [/code]The original code wanted to print bread … | |
Re: The GUI toolkit Pyside is a package and should be in folder side_packages. It is a "third party" package that needs to be installed by you. | |
| Re: Assuming you are using Python2, you could do it like this: [code=python]print("Enter zero for the value you are looking for:") s = d = t = 0 while True: s = input("Speed (miles/hour): ") d = input("Distance (miles): ") t = input("Time (hours): ") if s == 0: s = … |
Re: Over the past 20 years in Switzerland, health costs have grown 80 percent and insurance premiums 125 percent. However voters this Sunday overwhelmingly voted down a switch from private insurance to a mandatory government run insurance program. Swiss net salary is 4,950 Swiss francs (4,100 euros, $5,268), health premiums are … | |
Re: gmorcan, using Python module timeit and a rather small prime number like 999979, your function is 2700 times slower than vegaseat's function. | |
Re: I downloaded the encode picture from above and applied this little code: ''' PIL_HideText_decode.py get the hidden text back from an encoded image ''' from PIL import Image def decode_image(img): """ check the red portion of an image (r, g, b) tuple for hidden message characters (ASCII values) """ width, … | |
Re: Vegaseat's code more elegant: ''' tk_button_toggle6.py using itertools.cycle() to create a Tkinter toggle button ''' import itertools try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk def toggle(icycle=itertools.cycle([False, True])): state = next(icycle) t_btn['text'] = str(state) root = tk.Tk() t_btn = tk.Button(text="True", width=12, command=toggle) t_btn.pack(pady=5) … | |
Re: Have been looking for something like that, thanks! Clever application of base64 code. | |
Re: The biggest loser at our weight-loss club was an old lady. We asked her how she did it. "Easy," she said. "Every night I take my teeth out three hours earlier." | |
Re: To get this to go without the GUI freezing up in some loop you have to use threading. See: http://wiki.wxpython.org/LongRunningTasks?highlight=%28start%29|%28stop%29 | |
Re: Don't forget this great sticky: http://www.daniweb.com/software-development/python/threads/32007/projects-for-the-beginner | |
Re: Why bother with a class? from datetime import datetime as dt # make this work with Python2 or Python3 try: input = raw_input except: pass # start the count start = dt.now() # test the counter with a key board response time # or put your own code you want … | |
Re: Sounds interesting, so i put it all together: [code]message = "just a simple test!" key = 11 coded_message = "" for ch in message: code_val = ord(ch) + key if ch.isalpha(): if code_val > ord('z'): code_val -= ord('z') - ord('a') coded_message = coded_message + chr(code_val) else: coded_message = coded_message + … | |
Re: In the real world there are a lot of half true things. What do you do with those? | |
Re: Generally: import wx class MyEvents(object): """separate events into this class""" def __init__(self, parent): self = parent def button1Click(self, event): self.label.SetLabel("Button1 left clicked") def button2Click(self, event): self.label.SetLabel("Button2 left clicked!!!") class MyFrame(wx.Frame, MyEvents): """MyFrame inherits wx.Frame and MyEvents""" def __init__(self, parent, mytitle, mysize): wx.Frame.__init__(self, parent, wx.ID_ANY, mytitle, size=mysize) # create buttons and … | |
Re: `a=a+b-(a=b); //Swaping` works for floats | |
Re: New York city is expecting up to 2 feet of snow on Monday. That's tough on a big city and all the commuters. | |
Re: I think open source implies that Swift will be developed by and for the Linux community. | |
Re: An interesting play with iterators and generators: [code]it = iter(range(9)) # note iterator it depletes within zip() mylist = list(zip(it, it, it)) print(mylist) '''my output --> [(0, 1, 2), (3, 4, 5), (6, 7, 8)] ''' [/code]I tested this with Python26. | |
Re: If you are interested in mathematics, there is a large number of projects you can participate in at: [URL]http://www.projecteuler.net/[/URL] You can use any language, but Python seems to be popular. Girls, don't be scared, mathematics is not just for the guys! | |
Re: Interesting this Python code. I highlighted the code and pasted it into IDLE editor and it runs fine. I am using Python 2.5. | |
Re: The abbreviation "LOL" first appeared in print in 1973. | |
Re: Some good project ideas are here: http://www.daniweb.com/software-development/python/threads/32007/projects-for-the-beginner | |
Re: Wear a dust mask! |