988 Posted Topics

Member Avatar for Stefano Mtangoo

Maybe this short example will help: [code=python]# reference across class instances # from one panel class to another panel class import wx import time class MyPanel1(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent, wx.ID_ANY, pos=(0,0), size=(300, 100)) self.SetBackgroundColour("green") self.button = wx.Button(self, label=" panel1 button ") self.button.Bind(wx.EVT_BUTTON, self.buttonClick ) def buttonClick(self, event): """ …

Member Avatar for Stefano Mtangoo
0
101
Member Avatar for god0fgod

To keep related things together, you might want to check into a dictionary: [code=python]# here a,3 b,2 and c,1 are related pairs q = [['c', 'b', 'a'], ['1', '2', '3']] d = dict(zip(*q)) print d # {'a': '3', 'c': '1', 'b': '2'} for key in sorted(d): print key, '-->', d[key] …

Member Avatar for Gribouillis
0
349
Member Avatar for peter1121

Yes, you can use Tkinter. Here is a hopefully helpful explanation how Tkinter draws circles that follow a mouse click. The basics are there, you just have to apply them to your problem: [code=python]# draw a circle with given center (x,y) and radius at mouse click point import Tkinter as …

Member Avatar for Ene Uran
0
206
Member Avatar for Lardmeister

[QUOTE=sneekula;698916]Don't worry about those folks, they will get a slap on the wrist at the most. Just like Neil Bush, Charles Keating and John McCain got on the Savings and Loan scandals a few years back.[/QUOTE]Remember that turd floats!

Member Avatar for sneekula
0
366
Member Avatar for The Dude
Member Avatar for ldk

Works great with an XP, so it could be Vista that srews things up. [code=python]# send text to the clipboard import win32clipboard def txtToClipboard(iTxt): win32clipboard.OpenClipboard(0) win32clipboard.EmptyClipboard() win32clipboard.SetClipboardText(iTxt) win32clipboard.CloseClipboard txtToClipboard('text to paste') # test # or use paste in the editor window data = win32clipboard.GetClipboardData() print data [/code]

Member Avatar for Ene Uran
0
95
Member Avatar for sneekula

If we call folks from Mexico Mexicans and folks from Canada Canadians, what do we call the folks that live in the good old USA? Also, America refers to North, Central and South America.

Member Avatar for Ene Uran
0
249
Member Avatar for The Dude
Member Avatar for The Dude
Member Avatar for harrykokil

This would be a typical Tkinter class creating what looks like a traffic light. I leave it up to you to assign the proper light actions. [code=python]# a simple Tkinter class import Tkinter as tk class TrafficLight(tk.Frame): """inherits tk.Frame""" def __init__(self, parent=None): tk.Frame.__init__(self, parent, bg='green') self.grid() # create a canvas …

Member Avatar for harrykokil
0
114
Member Avatar for TheNational22
Member Avatar for bumsfeld

Congratulations Grim and Henri, a fantastic accomplishment only a few posters have achieved! No wine for me, just a couple of microbrews.

Member Avatar for GrimJack
3
200
Member Avatar for GrimJack

I think Ike should have snowed itself out of existence near the North Pole by now, giving Santa some much needed white fluff.

Member Avatar for GrimJack
0
112
Member Avatar for anthonyms666

I really enjoy Python, take a look at: [url]http://bembry.org/technology/python/StartProgramming.pdf[/url] and: [url]http://www.daniweb.com/forums/thread20774.html[/url] The whole Python package is open source and free from Python.org. If you decide to get Python, download the Windows installer package (.msi) of version 2.5 or 2.6. Stay away from version 3.0 since it will make a few …

Member Avatar for GrimJack
0
106
Member Avatar for corrola

[QUOTE=corrola;701901]Do I need a college degree to be considered?[/QUOTE]It most certainly will help!

Member Avatar for scru
0
156
Member Avatar for iamgame

Nice game! Just a few cosmetic things, there is a lot of empty space, so I would set the height of the frame to 180, and also use a little color with: bkg.SetBackgroundColour('yellow')

Member Avatar for iamgame
0
759
Member Avatar for zeroth

I think the wholesale fraud comes after you elected an official and he/she gets exposed to a hall full of lobbyists.

Member Avatar for Dave Sinkula
1
185
Member Avatar for christina>you

With the millions and millions of books published, one should not be surprised that every now and then one finds one book, where the author was a few bricks shy of a load. Coming back to the subject of this thread: Dark energy and dark matter surely is a hoax …

Member Avatar for GrimJack
0
2K
Member Avatar for jworld2

Why do all the extra work, if Python can do it for you? [code=python]result3=[ 83,97,109,117,101,108,32,83,109,105,116,104,13,10,13,10,84, 104,97,110,107,32,121,111,117,32,102,111,114,32,108,111,111, 107,105,110,103,32,116,104,101,32,111,116,104,101,114,32,119, 97,121,32,111,110,32,116,104,101,32,105,110,99,114,101,97,115, 101,100,32,108,101,118,101,108,115,32,111,102,32,116,111,120, 105,99,32,99,104,101,109,105,99,97,108,115,32,105,110,32,116,104, 101,32,114,105,118,101,114,32,114,117,110,110,105,110,103,32,97, 108,111,110,103,115,105,100,101,32,109,121,32,104,111,109,101] # show the text hidden in the list of ascii values print "".join([chr(x) for x in result3]) [/code]I know, I know, not as much fun as the long …

Member Avatar for jworld2
0
147
Member Avatar for aot

if you open the file with "r" you get: 'str' object does not support item assignment if you open the file with "rb" you get: Insecure string pickle Somehow the new.txt file must be corrupted or used a strange dump() protocol.

Member Avatar for woooee
0
982
Member Avatar for vmanes

[QUOTE=ZZucker;698706]700 Billion Dollars with no strings attached. More giant taxbreaks. Easier ways to send my loot to the Caymen Island Banks. Politicians that give discounts to frequent influence buyers.[/QUOTE]Hey Zoe, let me know if you get the stuff! I would be happy with just 1% (7 Billion Dollars) of the …

Member Avatar for R0bb0b
0
168
Member Avatar for SoulMazer

For the many of you who still want to know the solution, make variable 'a' a global: [code=python]words = ["aero", "aesthet", "andr", "arch", "arch", "ast", "baro",\ "biblio", "bio", "cardi", "chron", "cosm", "crat", "cycl", "dem", "dont",\ "dogma", "dox", "esth"] answers = ["air", "sense", "man", "man", "chief", "ancient", "star", "weight",\ "book", "life", …

Member Avatar for Dunganb
0
2K
Member Avatar for scru

I wonder if all those annoying Cirtcuit City popups on DaniWeb are considered spamming?

Member Avatar for bumsfeld
0
182
Member Avatar for The Dude
Member Avatar for Ancient Dragon

Jerome Allen "Jerry" Seinfeld is funny, Bill Gates is the opposite. The result is big fat ZERO.

Member Avatar for vmanes
0
166
Member Avatar for zandiago
Re: Ufo

[QUOTE=ZZucker;527660]I have watched Star Trek "The Motion Picture" a few times. There the living thing is the spaceship itself, hard to miss since it is about the size of Texas. Interesting concept. Something like this might be possible.[/QUOTE]That movie kind of blows your mind! Brings up the thought that the …

Member Avatar for R0bb0b
0
486
Member Avatar for Dave Sinkula
Member Avatar for ~s.o.s~
Member Avatar for Alex Edwards
Member Avatar for sneekula
0
185
Member Avatar for Ene Uran

Only for experts: [url]http://www.funnyjunk.com/movies/1498/Kissing+Prank/[/url]

Member Avatar for sneekula
1
73
Member Avatar for Dave Sinkula

There are quite a few US military advisers in this Georgia country trying to rearm Georgia to NATO standards. Maybe the Russians want to get get even with the Georgians for sending them the one thing that has killed more Russians than aything else --> Joseph Stalin! I find it …

Member Avatar for sneekula
3
300
Member Avatar for William Hemsworth

Chinese Translations (if you are Chinese don't read this): Has your flight been delayed? - Hao Long Wei Ting? I got this for free - Ai No Pei I bumped into a coffee table - Ai Bang Mai Ni Please, stay a while longer - Wai Go Nao? They have …

Member Avatar for ~s.o.s~
3
120
Member Avatar for Stefano Mtangoo

[QUOTE=evstevemd;686076]Just to add on that, I want to put my icons in a folder named icons in the same folder as my script. How do I reference them in code without error "File so and so.png does not exist" Thanks again[/QUOTE]On Windows you do a "./icons/myicon.ico" for example.

Member Avatar for Stefano Mtangoo
0
78
Member Avatar for Ene Uran

Just got a PM on DaniWeb with this sender: From Miss Patricia Dick Abidjan,Cote D'Ivoire The rest is a typical Nigerian financial scam! Did anybody else get this? The user name was blessing12

Member Avatar for Lardmeister
0
161
Member Avatar for massivefermion

Since you know Python's syntax, get to know the modules and what they do. Also, get involved with a project you want to accomplish. For some beginner's project ideas look at: [url]http://www.daniweb.com/forums/thread32007.html[/url]

Member Avatar for Stefano Mtangoo
0
102
Member Avatar for pravdexter
Member Avatar for Ene Uran
0
276
Member Avatar for lllllIllIlllI

I ran your code and it took over my computer. It took me forever to get it back to normal again. There is something wrong with your application of sendkeys or pyhook! To tell you the truth, I won't even try to figure it out.

Member Avatar for lllllIllIlllI
0
370
Member Avatar for lllllIllIlllI

PyGame isn't very useful as a typical GUI toolkit, but if you want to have fun with images, animation, sound, video etc. it is great. Like the name says, it's a good toolkit for game development with Python. Here is a typical example for drawing shapes: [code=python]# draw random circles …

Member Avatar for Ene Uran
0
110
Member Avatar for PalomoBlanco

[QUOTE=PalomoBlanco;677443]I've got the "antivirus vista 2009" (worm or virus, I don't know), it did his thing and immediately offer to clean my computer for 90 dollars, that's why I got mad, they mess your computer and then try to steal your money!! People who does not know how to fix …

Member Avatar for R0bb0b
0
203
Member Avatar for Dave Sinkula

Ah, "poodly", meaning act like a well trained poodle, a new word for the dictionary. JB, how is your former main poodle, forgot his name, doing these days? Strange, when I look at dogs I think of poodle being French, terrier being English, and dachshund being German.

Member Avatar for GrimJack
0
610
Member Avatar for leegeorg07

There was a suggestion of using PortablePython on a stick (USB Flash Drive), would that work?

Member Avatar for Ene Uran
0
79
Member Avatar for Ene Uran

Just noticed that I passed the ever so sweet 1000 postings mark! Isn't DaniWeb great!

Member Avatar for mackone
2
108
Member Avatar for Lardmeister
Member Avatar for Ene Uran
0
162
Member Avatar for besktrap

Also ballSpeed = [0,4] means move the ball 0 pixels along the x axis and 4 pixels along the y axis. Pixels have to be integers. When you set it to [0,0] it stops of course.

Member Avatar for besktrap
0
235
Member Avatar for Ancient Dragon

That is the way geography is taught in our public schools. I think it is also the map that hangs in Dick Chainey's basement office.

Member Avatar for ZZucker
1
80
Member Avatar for leegeorg07

My advice for you is to study up on the very basics of Python. Your code is simply loaded with too many rudimentary mistakes!

Member Avatar for Ene Uran
0
122
Member Avatar for ZZucker

[QUOTE=bumsfeld;670757]It takes government by the people for the people, not government by lobbyist for lobbyists.[/QUOTE]Let's all become lobbyists, then we are back to normal.

Member Avatar for R0bb0b
0
305
Member Avatar for Salem

I think the new Pope is quite hip! Let's support the poor fellow with your tax deductible donation!

Member Avatar for sneekula
0
155
Member Avatar for Scuppery
Member Avatar for abetageek
-2
275
Member Avatar for Salem

[QUOTE=Aia;662168]Main purpose is to learn how to better tailor targeted ads to you and yours. Now the possibilities for other uses are limitless, or I should say; limited only by their imagination. I leave to you to speculate who "they" are.[/QUOTE]Could be George Bush's "National Spy Agency" run by the …

Member Avatar for jwenting
0
92

The End.