407 Posted Topics

Member Avatar for Salem

jbennet, you are simply exceptional! Remember half the people you know are below average.

Member Avatar for GrimJack
0
110
Member Avatar for ZZucker

Just an accumulation of funny news lines: Governor Chiles Offers Rare Opportunity To Goose Hunters (The Tallahassee Democrat) Gators To Face Seminoles With Peters Out (The Tallahassee Bugle) Messiah Climaxes In Chorus Of Hallelujahs (The Anchorage, Alaska Times) Textron Inc. Makes Offer To Screw Company Stockholders (The Miami Herald) Something …

Member Avatar for sneekula
0
95
Member Avatar for ZZucker

Here is your chance to ask a 'smart' question in an attempt to have one of those real smart DaniWeb Geek members answer it. If the question just makes you think or smile, that is good enough too! Please no computer questions. :) Okay, to start out: Why does a …

Member Avatar for Lardmeister
0
1K
Member Avatar for Astudent
Member Avatar for Azurea

I haven't had too many problems with wxPython programs on Vista, but the OS has screwed me up in many other ways. Whenever I can I use an older XP machine. Maybe you can relax the super childish default security scheme they use to a lower level?

Member Avatar for shadwickman
0
138
Member Avatar for liquoriser21

If you reprogram her, it wll last a day. If you teach her how to program, ........ (she will reprogram you)

Member Avatar for vegaseat
0
239
Member Avatar for Alex Edwards

Yeah, the credit card, a necessary evil, always use it, but also always pay it up in time. I have plenty of foolish friends who spend half their income on cedit card interest. Some of those cards make a loan shark look friendly! Also remember that Joe Biden was behind …

Member Avatar for Alex Edwards
0
158
Member Avatar for etechsupport
Member Avatar for ZZucker

Picked from newspaper classifieds: '83 Toyota hunchback -- $2000 Just in time for deer season: 2 wire mesh butchering gloves, one 5-finger, one 3-finger, pair only $15 Bill's septic cleaning "We haul American made products" Our sofa seats the whole mob and is made of 100% Italian leather. Joining nudist …

Member Avatar for sneekula
0
83
Member Avatar for leegeorg07

Sometimes a test print will help you visualize what is going on: [code=python]def insertion_sort(qq): for j in range(1, len(qq)): key = qq[j] i = j - 1 while (i >=0) and (qq[i] > key): qq[i+1] = qq[i] i = i - 1 qq[i+1] = key # test print ... print …

Member Avatar for ZZucker
0
295
Member Avatar for pyth0n

One more way for the fun of it: [code=python]import random let = [ 'a', 'b', 'c', 'd', 'e', 'f', 'g' ] random.shuffle(let) while len(let): print let.pop() [/code]

Member Avatar for pyth0n
0
5K
Member Avatar for ganil123

You can use the module inspect: [code=python]import inspect class C1(object): def __init__(self): print "C1" def f1(self): print "f1" pass def f2(self): print "f2" pass inst1 = C1() try: print inspect.ismethod(inst1.f1) # True print inspect.ismethod(inst1.f2) # True print inspect.ismethod(inst1.f3) # 'C1' object has no attribute 'f3' except AttributeError, error: print error …

Member Avatar for lllllIllIlllI
0
227
Member Avatar for doeman

Here is another way you can skin it: [code=python]def sum_cube(n, sum=0): if n > 0: x = n**3 return sum_cube(n-1, sum+x) else: return sum print sum_cube(5) # 225 [/code]

Member Avatar for ZZucker
0
100
Member Avatar for odinaryman

[QUOTE]Choose to think for yourself rather than letting someone else do it for you. [/QUOTE]That does not sound very devout and pious.

Member Avatar for GrimJack
0
110
Member Avatar for Serunson

[QUOTE=HiHe;716878]Hehe, my English is good? I hope you mean capitalization. Just smile, you could be the British Bush, "bushing" the proper language. Just "funnen" you! :)[/QUOTE]Take it easy HiHe. When you are as cute as young jbennet, than any "bushin" of the English language can be forgiven!

Member Avatar for jbennet
0
203
Member Avatar for planetPlosion

This should eventually work: [code=python]class MainFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, title = 'Sentence Generator', pos = (200, 75), size = (WINDOW_WIDTH, WINDOW_HEIGHT)) self.background = wx.Panel(self) self.makeBtn = wx.Button(self.background, label = 'Make') self.makeBtn.Bind(wx.EVT_BUTTON, self.displaySentence) self.resultBox = wx.TextCtrl(self.background, style = wx.TE_READONLY | wx.TE_MULTILINE) self.hBox = wx.BoxSizer() self.hBox.Add(self.resultBox, proportion = 1, border = …

Member Avatar for planetPlosion
0
89
Member Avatar for GrimJack
Member Avatar for vmanes
Member Avatar for The Dude
Member Avatar for lllllIllIlllI

Yeah vega, VPython is an interesting module for 3D modeling (free too). I played around with it and came up with this: [code=python]import visual as vs vs.scene.width = 500 vs.scene.height = 500 vs.scene.title = "draw a cone on a ring (drag with right mouse button)" # avoid autoscale (autoscale default=True) …

Member Avatar for ZZucker
0
527
Member Avatar for jcafaro10

Here is an example of re module's sub(): [code=python]import re # replace all ;,. characters with _ p = re.compile(r'[;,.]') s = 'hi;your,face.is;on,fire' print p.sub('_', s) # hi_your_face_is_on_fire [/code]or: [code=python]import re s = 'abc123' p = re.compile("[a-z A-Z]") # subbing with an empty string "" amounts to strip print p.sub("", …

Member Avatar for ZZucker
0
124
Member Avatar for kattastic

[QUOTE=bumsfeld;714948]Don't go to just any church, go to Catholic Church![/QUOTE]I agree! My church has helped me many times when I was down.

Member Avatar for ZZucker
0
160
Member Avatar for The Dude
Member Avatar for sleign
Re: hey

There are tricky computer languages and there are nice ones. Which one are you taking?

Member Avatar for Denniz
0
122
Member Avatar for Criswell
Member Avatar for sneekula

Canada has no president. Canada's government is a Parliamentary democracy (federal constitutional monarchy) whose Monarch is Queen Elizabeth II. Canada has a Prime Minister.

Member Avatar for Ene Uran
0
249
Member Avatar for defience

In your code [B]source[/B] is not a list or tuple. You can use a helper [B]print source [/B]to look at it.

Member Avatar for woooee
0
1K
Member Avatar for TheNational22

Give this a try and see if it works: import subprocess subprocess.call(['posidbfw', '/alt', '1', '1'])

Member Avatar for sneekula
0
157
Member Avatar for tb808kid

I think you want module curses, that one has setsyx(y, x) that puts the cursor to where you want to print on the screen. Check: [url]http://docs.python.org/lib/curses-functions.html[/url]

Member Avatar for tb808kid
0
131
Member Avatar for blackcorner

[QUOTE=Aia;702917]Regex it is just that, [URL="http://www.regular-expressions.info/tutorial.html"]regular expression[/URL]. A pattern describing some text.[/QUOTE]Yes we know! How about learning some Python first before giving primitive lectures. We are trying to help people and keep a friendly atmosphere here! BTW, if you need help with the module re, simply type help(re). Or go …

Member Avatar for ZZucker
0
213
Member Avatar for knish

A class should only group functions together that belong together. I would also avoid globals, they are devils as your program grows. A class handles globals within the class using self.

Member Avatar for woooee
0
167
Member Avatar for lllllIllIlllI

If you look into Main.py, you find: [code=python]def opj(path): """Convert paths to the platform-specific separator""" st = apply(os.path.join, tuple(path.split('/'))) # HACK: on Linux, a leading / gets lost... if path.startswith('/'): st = '/' + st return st [/code]The problem is that the 'wx code demo stuff' is unnecessarily complex on …

Member Avatar for lllllIllIlllI
0
177
Member Avatar for predator78

On first blush, you need to create your wordlist outside the loop, or you will keep appending to it all the time: [code=python]#decode scrambled word from a word list in 30 sec or less. matches = [] thelist = [] myvar = -1 c = -1 p = -1 wordlistfile …

Member Avatar for ZZucker
0
212
Member Avatar for vmanes

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.

Member Avatar for R0bb0b
0
168
Member Avatar for vmanes

"For the things we have to learn before we can do them, we learn by doing them."

Member Avatar for ZZucker
0
127
Member Avatar for Mr_Grieves

[QUOTE=Mr_Grieves;695650]Aha -- I just needed to rtfm a bit more clearly. In the fine print on [URL="http://docs.python.org/lib/typesseq-strings.html"]http://docs.python.org/lib/typesseq-strings.html[/URL], it says the alternate form (with the # flag) gives this behavior, so: [code] >>> print "%#.4g" % 6.340024e-34 6.340e-34 [/code] I've been looking for this solution for so long, I'm beside myself …

Member Avatar for ZZucker
0
97
Member Avatar for The Dude
Member Avatar for omol
0
78
Member Avatar for The Dude
Member Avatar for zandiago
Re: Ufo

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.

Member Avatar for R0bb0b
0
487
Member Avatar for steven woodman

GrimJack, I am impressed. You are unquestionably the smartest person on this forum!

Member Avatar for GrimJack
0
192
Member Avatar for ~s.o.s~

Just imagine, someday I might be able to write such an important memo to my underlings, I mean associates, I mean partners, I mean coworkers, I mean colleagues, I mean friends, ...

Member Avatar for sneekula
3
427
Member Avatar for Dave Sinkula

Too bad the next Olympic games are not in Russia, or we could boycott that again! Maybe we should move the next games to Gruzya.

Member Avatar for sneekula
3
300
Member Avatar for alc6379

What a poor example of Python, violates all the Zen! There is an outcry for loops and functions. [code=python]import this [/code]

Member Avatar for ZZucker
0
524
Member Avatar for vic huebner

You may want to use a Device Context widget like the one used in: [url]http://www.daniweb.com/forums/showpost.php?p=688718&postcount=74[/url]

Member Avatar for ZZucker
0
95
Member Avatar for Dave Sinkula

The terminator and the chipmunk are at the same intellectual level.

Member Avatar for GrimJack
0
610
Member Avatar for 5akeytech

So, why is China listed as number one when the USA has by far the most medals?

Member Avatar for bumsfeld
0
41
Member Avatar for The Dude

[QUOTE=The Dude;672088]If this is real i feel bad for her!! [url]http://www.drudge.com/news/111229/most-pathetic-obituary-ever[/url][/QUOTE]Well, it didn't exactly say where she would be in her afterlife. Maybe her husband and son were involved in politics!

Member Avatar for R0bb0b
0
128
Member Avatar for lllllIllIlllI

[QUOTE=paulthom12345;676092]Hi I have made a program that uses a GUI for most of its functions but as soon as i change it to an exe using py2exe all the buttons turn all square and everythin looks like it came from windows 98 rather than XP. Is there any way to …

Member Avatar for lllllIllIlllI
0
903
Member Avatar for GrimJack

[QUOTE]Cook your hamburger all the way through. No runny eggs. Wash your vegetables. Peel your fruit.[/QUOTE]In all those cases it's bacteria, poor sanitary practices, not poisons the corporation put in there!

Member Avatar for GrimJack
0
101
Member Avatar for Lardmeister

Looks like the USA is beating all the other countries easily again! We need something to make us feel good!

Member Avatar for Ene Uran
0
162

The End.