1,175 Posted Topics
![]() | Re: Vpython is good for 3D and plotting, but the slider is more than rude! ![]() |
Re: A college physics professor was explaining a particularly complicated concept to his class when a pre-med student interrupted him. "Why do we have to learn this stuff?" one young man blurted out. "To save lives," the professor responded before continuing the lecture. A few minutes later the student spoke up … | |
Re: Sailing on Lake Michigan, cool and crisp with a minimum of floating plastic bags! | |
Re: The new drink: Osama, two shots and a splash of water | |
Re: There are even people addicted to second hand smoke! Little kids in particular. | |
Re: XML data stream starts with an opening tag '<' more elaborately '<?xml' | |
Re: This Tkinter example moves a ball (circle) in a horizontal line, but you can change that to a vertical line: [code]# a Tkinter moving ball that wraps around try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk root = tk.Tk() root.title("Tkinter Moving Ball") w … | |
Re: The 19th hole on the golf course is the bar in the club house! | |
| |
Re: I remember reading the story about a fellow who sold bagels on the honor system in the coffee rooms of a corporate office building in Washington DC. The building had their top managers on the upper floor and 'worker bees' on the lower floor. He discovered that the folks on … | |
Re: Runtime versions (in your case msvcr90.dll) of the Microsoft C compiler have to be shipped with any program that has been compiled with it. Since Python26.dll has been compiled with this version, the appropriate runtime version can be included without problems. In the matter of fact, your Python 2.6 Windows … | |
Re: [B]Please do not feed the driver's Ego[/B] | |
Re: Engraved on a gravestone: "It distresses us to return work that is not perfect" | |
Re: [QUOTE=paulthom12345;866525]Yeah, i get this a lot with wxPython. Something on the lines of wx.App must be created first. And IDLE will not freeze, but it will not run the code again until you restart it.[/QUOTE]Hmm, interesting, never had that happen. Can you show a small sample code where this happens? … | |
It's time again to poll the well educated folks at DaniWeb about the possible cause of the end of humanity on earth. | |
![]() | Re: I finally got them all to work. Kinda neat! Can hardly wait until you get some good sound with it! What does Rpg mean? Reverse Polish Game? |
Re: Generally you would save the following three code files in the same directory: class Tank as [B]tank.py[/B] class Grid as [B]grid.py[/B] your main code as [B]tank_game.py[/B] then run tank_game Note that filenames for modules tank and grid are case sensitive! | |
Re: i,ROBOT Will Smith fights a robot conspiracy to break the "a robot can't harm a human" union rules. | |
Re: What is your problem? How does it manifest itself? | |
Re: Function wget() is not part of Python. However you can extract a picture from a URL easily, as shown in this code snippet: [url]http://www.daniweb.com/code/snippet563.html[/url] | |
Re: Using a huge antenna during a thunderstorm will give you free electricty, but it is somewhat dangerous. | |
Re: woooee, you only missed this: ararik pulled up an old thread to attach a homework question. I already told him not to double post. | |
Re: You major problem is that __init__() uses double underlines prefix and postfix. Also, remember that the module name and its file name are case sensitive! Here is an example: [code=python]# save module as tank.py (file name is case sensitive!) class Tank (object): def __init__(self, name): self.name = name self.alive = … | |
Re: With the advent of Python3 Tkinter has turned into a package called tkinter. I usually add a try/except to pick the right import: [code=python]# a simple Tkinter number guessing game # shows how to create a window, an entry, a label, a button, # a button mouse click response, and … | |
Re: You can also calculate pi with this simple mathematical formula: [B]4*.atan(1)[/B] :) | |
Re: Child: "Mom, why do you have strands of grey hair mixed in with your dark hair?" Mother: "Every time you disobey, I get one strand of grey hair. If you want me to stay pretty, you better obey." Child after some thinking: "Mom, why is Grandma's hair all grey?" | |
| |
Re: You could use id(): [code=python]word = "example" print id(word) # eg. 41369728 [/code]Let me warn you, Python really used the globals dictionary to match variable name with content. | |
Re: [B][COLOR="Green"]Adult Material Inside![/COLOR] [/B] | |
Is there a reliable way to 'pluralize' english words with Python? | |
Re: I would imagine that Dallas and Arlington Home Inspectors listen to the sound of all those Dollar bills the are cheating their unsuspecting customers out of. Seriously, I find that classical music is best for any good programming language. | |
Re: I do like Miss Palin, she has single- handedly done more damage to the Republican ticket than anyone could imagine in their wildest dreams. Good work Sarah! Keep it up! | |
In the Netherlands many schools have adopted graves of Allied servicemen killed in action during WW2, keeping those graves in excellent condition. | |
Re: It acts like container.catalog_object has been used as the variable name for a string somewhere in your code. [code=python]books = container.getBookTitleToCatalog() for book in books: params=urlencode({'code':book.id}) container.catalog_object(book, '/APP_New/app-home/app-information/Publications/showBookDetails?%s'%params) [/code] | |
Re: To confuse variable [B]Foo.__privatebar[/B] with [B]Foo._Foo__privatebar[/B] would be a hard thing to do. As you can see, Python uses [B]name mangling[/B] to protect a private variable. | |
Re: Your code seems to work well, except your grade assignments are a little strange to me. Here would be a slightly different approach to some of your code: [code]""" assume these are the contents of file student.txt Fred, Nurke, 16, 17, 22 Jack, Sprat, 12, 13, 19 """ # create … | |
Re: [QUOTE=pherro;1231244]how can I develop a program in PASCAL that counts the number of words in a paragraph[/QUOTE]Pascal is a very old style language. I don't think it would come even close to Python's modern syntax and features. You could try the Delphi/Python forum at DaniWeb. The closest thing you could … | |
Re: I would create a class Order with the following methods: new_order update_order show_orders | |
Re: You can use a dialog window in conjunction with a main window. Here is a wxPython example: [code]# a wxPython general frame with a dialog window # the dialog shows full size even it the frame is minimized import wx import wx.calendar as cal class MyCalendar(wx.Dialog): """create a simple dialog … | |
Re: You don't create a class by listing it's methods as variables! | |
Re: Don't worry, Goldman has enough money to prevail in the political arena! | |
Re: Ouch! You may want to read up on the basics and use a few test prints. |
The End.