939 Posted Topics

Member Avatar for sab786
Member Avatar for serkan sendur
Member Avatar for Dan08
Member Avatar for scru

Are you sure you want to know? Go ahead and post below to find out. Let's start with me. Why do I suck, folks?

Member Avatar for ddanbe
0
108
Member Avatar for Dan08

Well, I'm not Dan, but here's a little hack adapted from [url]http://www.dotnetspider.com/resources/15834-eject-close-cd-tray.aspx[/url] for Python. It's only two lines of code! To open: [code=python] import ctypes ctypes.windll.winmm.mciSendStringW("set cdaudio door open", None, 0, None) [/code] To close: [code=python] import ctypes ctypes.windll.winmm.mciSendStringW("set cdaudio door closed", None, 0, None) [/code] Note, if you're using …

Member Avatar for Dan08
0
224
Member Avatar for Ancient Dragon

[QUOTE=jbennet;545355] all the vista-ness makes it kinda hard to read the cards[/QUOTE] Yes, because large cards and type [I]DOES[/I] make it harder to read! The instigators! I've never been much of a hearts player though.

Member Avatar for MosaicFuneral
0
156
Member Avatar for Ene Uran

Kim Jong-il: It's time to launch an offensive on those imbeciles. Something that will make them squirm and rue the day that they did that one thing to piss me off, bringing their societies to a [URL="http://en.wikipedia.org/wiki/Professor_Chaos"]general disarray[/URL]! Ideas? New Intern: Let's bring their websites down for a couple hours. …

Member Avatar for MosaicFuneral
0
174
Member Avatar for adam291086

This method is probably a bit less efficient than other suggestions you'll get, but it's just one line: [code=python] new_list = [item[:1] for item in old_list] [/code] Question. Why don't you use tuples instead of lists for the inner structure? They use less memory than lists.

Member Avatar for adam291086
0
122
Member Avatar for teonghan

break is such an ugly construct! Structure your while loops better. That way they are more natural to read and I don't have to spend a second or two figuring out "Why is he break-ing here?".

Member Avatar for scru
0
2K
Member Avatar for Menster
Member Avatar for rishabhv
0
297
Member Avatar for sneekula

What is anti-virus? Call me naive but I run my Vista naked. I figure I can avoid 90% of infection problems by just not clicking links/opening suspicious programs/using certain MS software. It makes me chuckle to think about just how sorely wrong I could be; my system could be riddled …

Member Avatar for vegaseat
0
230
Member Avatar for Menster

[QUOTE=Menster;910528]Whats the general opinion here: Are all programmers stoners? (If my colloquialism is lost across borders i'm talking about marijuana) Some two-bit sales person came and chirped me the other day that sales will always be the more powerful branch of the industry because they're the deal makers, they're more …

Member Avatar for Menster
0
142
Member Avatar for rockyman12
Member Avatar for Zetlin

Line four didn't get you [I]anything[/I]? You should've gotten an IO error; you're not supposed to read from files you open for writing. If even you had opened the file as w+, you still should've gotten that blank line, because of the position you are in the file (past what …

Member Avatar for Zetlin
0
328
Member Avatar for Narue

For those not knowing how to use IRC, here is a quick recipe on how to join the daniweb channel. You will need: Mozilla Firefox web browser Directions: 1. Install that chatzilla add-on from here: [url]https://addons.mozilla.org/en-US/firefox/addon/16[/url] (search for the button that says "add to firefox" and press it. A dialog …

Member Avatar for lllllIllIlllI
0
698
Member Avatar for MosaicFuneral

[QUOTE=jephthah;888286]i just recently made the switch from creamy to chunky. sometimes extra chunky. it's like, "where have you been all my life?"[/QUOTE] N/A (pretend this is a positive rep, since I already down repped you today)

Member Avatar for jephthah
0
392
Member Avatar for joshSCH

St. Vincent doesn't have illegal immigrants. Everybody wants to LEAVE St. Vincent! You should be flattered that so many people are desperate to come to your country, that they would risk their lives and voyage over miles of sea in a stupid little boat (Cubans). Don't get me wrong; I …

Member Avatar for GrimJack
1
1K
Member Avatar for serkan sendur
Member Avatar for MosaicFuneral
0
210
Member Avatar for ndeniche
Member Avatar for ditz
0
1K
Member Avatar for OffbeatPatriot

Of course it's slower. Whether or not it's slower enough to make any difference is the issue. For me, it's not.

Member Avatar for OffbeatPatriot
0
264
Member Avatar for tomtetlaw

First of all python has no variables. Here's how to check if a name is defined in local namespace: [code=python]"name" in locals()[/code] and global namespace: [code=python]"name" in globals()[/code]

Member Avatar for sneekula
0
129
Member Avatar for sravan953

[QUOTE=sneekula;898994]If you use the Windows OS: [code=python]# get the character of a key pressed (no return key needed) # works only in the command window and with Windows OS # msvcrt.dll is the MS C library containing most standard C functions from msvcrt import getch print "press a char key …

Member Avatar for scru
0
493
Member Avatar for MK12

Aw hell nah. I'm not gonna debug that for you. But, is this supposed to be a game? Why isn't it interactive? If it is, how do I play it? I actually love this silly game.

Member Avatar for scru
0
2K
Member Avatar for scru

So as an outside observer, I'm curious about what you think of each other's nations, and whose is better. Just some topics to get you started: Entertainment, Enterprise, Education, Healthcare, People, Don't think too much.

Member Avatar for jbennet
0
333
Member Avatar for sravan953

Just in case you don't fine wxGlade or BoaConstructor to be quite what you need (or if you just can't get past how ugly they are), you can try QtDesigner for pyQT (comes with the pyQT package).

Member Avatar for sneekula
0
2K
Member Avatar for MONODA
Member Avatar for andriod
Member Avatar for andriod
0
226
Member Avatar for besktrap

Please know that this is a security risk. Use the exec function: [code=python] >>> exec("print('df')") df [/code]

Member Avatar for abhigyan91
0
12K
Member Avatar for tiger86
Member Avatar for vegaseat
0
203
Member Avatar for jephthah

[QUOTE=jephthah;893083]Dear little Greek letter Omega, how do I love thee? Let me count the ways. Your smooth lines and the parallel symmetry of your gently swelling curvatures, descending in a pendulous manner before convexly arising to cleave together at your magnificent center. Damn the font size 12! You shall always …

Member Avatar for scru
1
177
Member Avatar for max.yevs

Save the program as program.py, and double click to run. You may need to put an input() statement at the end in order to keep the script from immediately exiting after execution. I recommend going through the [URL="http://docs.python.org/3.0/tutorial/index.html"]official python tutorial[/URL].

Member Avatar for carapace
0
176
Member Avatar for jephthah
Member Avatar for akkkk

What you need to do is read one word at a time from the file and check that word for capitalization. Here's an example: [code=python] word = "" char = fobj.read(1) while char: if char == " ": if word.istitle(): print word word = "" else: word += char char …

Member Avatar for akkkk
0
214
Member Avatar for -Xlayer-

You're going to have to post the code for do_stuff_with_var. Otherwise we'd just be guessing.

Member Avatar for -Xlayer-
0
292
Member Avatar for drjay1627

[code=python] from ctypes import * class Trie(Structure): _fields_ = [("foo", c_char, ("bar", ARRAY(c_char, 10))] [/code] Don't have a testing machine in front of me so that code might be slightly off.

Member Avatar for scru
0
140
Member Avatar for pymatio

Reminds me of the time I wrote a barebones css parser for myself. Good times. Not sure what exactly what you're going at, but try: [code=python] for page in css: f = open(page, "r") lines = f.readlines() count = 1 obcount = 0 ebcount = 0 probwithfile = False for …

Member Avatar for pymatio
0
108
Member Avatar for enzogoy

Does your server require authentication? (logging in before you can send) If it does, you have to use the PEAR set of email methods, because mail() does not support SMTP authentication.

Member Avatar for gingank
0
154
Member Avatar for sciguy77

How you run an app at startup is platform specific and has nothing to do with Python. I suggest you consult your target OSes' manuals to determine how to do this for each platform. As for blocking other programs from starting, I have a strong suspicion that you would be …

Member Avatar for woooee
0
152
Member Avatar for pupspark

[QUOTE=pupspark;891264][CODE]print "INSERT QUIZ INTRO" choices1() def choices1(): print "The SNES Star Fox games ran off of/was used to advertise what advancement?" print "1: 32 Bit color" print "2: Argonaut's Super FX Chip" print "3: Voice-like sound effects" print "4: Higher Frame rates" 001();[/CODE] There's code past this but I imagine …

Member Avatar for siddhant3s
0
206
Member Avatar for TheNNS

Ubuntu. It's just plain easier out of the box. Hell, even my mom can use it.

Member Avatar for krnekhelesh
0
776
Member Avatar for rasizzle

Except I don't think he meant i there, but rather 1 (the number one). I can never be sure though.

Member Avatar for woooee
0
117
Member Avatar for TerabyteST

Yes there is a way. Use python's [URL="http://docs.python.org/library/ctypes.html"]ctypes[/URL] Maybe someone else can give you an example of how to use it. Or maybe you can just look at the documentation (it's not hard).

Member Avatar for scru
0
152
Member Avatar for TerabyteST

[QUOTE=evstevemd;890138]Embedding image? Yes possible but sound? Not sure![/QUOTE] Of course, just about anything can (and it has nothing to do with python)!

Member Avatar for scru
0
120
Member Avatar for tiger86
Member Avatar for max.yevs

Of all the dumb, shallow requests I've seen on this site, this has to be the dumbest and shallowest.

Member Avatar for vegaseat
0
150
Member Avatar for codedhands

Have a look at WPF with Ironpython. If anyone wants to create a totally customized UI look on Windows, WPF is what I recommend, because it's just horrible trying to get it done easily with other toolkits (I've tried them all).

Member Avatar for scru
0
99
Member Avatar for scru

Hi, I suck at math. I've been working a 2d (yes 2d) library lately at it's been making my head spin. The terminology, the equations, all of it. What I want to do is get good at math, or at least stop sucking. Does anybody know a good book a …

Member Avatar for certifmix123
0
257
Member Avatar for sussy123
Member Avatar for ithelp

[QUOTE=dtcmusic;884412]I do have a key that is unused as yet on my keyboard, the Eject Seat key, it's next to the Escape key. I've attached a photo...[ATTACH]10364[/ATTACH][/QUOTE] Nice try but that is not a key.

Member Avatar for vegaseat
0
164
Member Avatar for sravan953

Not sure what you mean... [code=python] import urllib import string open_site=urllib.urlopen('http://www.sravan953.blogspot.com') read_site=open_site.read() value=str(read_site) print value [/code]

Member Avatar for sravan953
0
170

The End.