939 Posted Topics
| |
| |
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? | |
Re: 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 … | |
Re: [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. | |
Re: 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. … | |
Re: 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. | |
Re: 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?". | |
Re: Give Google control of my desktop? I'm too paranoid for that. | |
Re: 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 … | |
Re: [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 … | |
Re: [url]http://tinyurl.com/nkc352[/url] | |
Re: 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 … | |
Re: 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 … | |
Re: [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) | |
Re: 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 … | |
Re: Stop being a wimp. And sleep 6 hours a day if you need more time. | |
Re: Of course it's slower. Whether or not it's slower enough to make any difference is the issue. For me, it's not. | |
Re: 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] | |
![]() | Re: [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 … |
Re: 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. | |
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. | |
![]() | Re: 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). |
Re: Hey jlm699, how come you called random.seed()? | |
Re: Man, you really messed up the spelling of your nickname there. | |
Re: Please know that this is a security risk. Use the exec function: [code=python] >>> exec("print('df')") df [/code] | |
Re: Who would write a game in C? Why do you hate yourself? W.e. I guess. | |
Re: [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 … | |
Re: 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]. | |
Re: 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 … | |
Re: You're going to have to post the code for do_stuff_with_var. Otherwise we'd just be guessing. | |
Re: [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. | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: [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 … | |
Re: Ubuntu. It's just plain easier out of the box. Hell, even my mom can use it. | |
Re: Except I don't think he meant i there, but rather 1 (the number one). I can never be sure though. | |
Re: 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). | |
Re: [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)! | |
Re: You better hope windowsrefund doesn't find this thread. | |
Re: Of all the dumb, shallow requests I've seen on this site, this has to be the dumbest and shallowest. | |
Re: 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). | |
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 … | |
Re: Does anybody else spot the irony in this? | |
Re: [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. | |
![]() | Re: 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] ![]() |
The End.