- Strength to Increase Rep
- +13
- Strength to Decrease Rep
- -3
- Upvotes Received
- 91
- Posts with Upvotes
- 82
- Upvoting Members
- 45
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
I love life.
- Interests
- Video Games, Movies, Drinking, Fishing, Hiking
- PC Specs
- 1. Windows XP SP2, Core2 Duo @ 2GHz, 2 GB 2. Ubuntu Hardy Heron, Pentium4 @ 2.3 GHz, 2.5 GB 3. Windows…
Re: If you're using a tuple to keep track of what the user has already tried then you'll need to concatenate in the following manner: [code=python] >>> a = () >>> a += 'a' Traceback (most recent call last): File "<input>", line 1, in <module> TypeError: can only concatenate tuple (not … | |
Re: I did this and had a hell of a time figuring it out! Go to Run -> "Run...", then type in [icode]C:\PythonXX\pythonw.exe "$(FULL_CURRENT_PATH)"[/icode] ** Note I use pythonw.exe, you can just as easily use the standard python.exe (I just hate that console window), and when you've got that hit the … | |
Re: [QUOTE=funfullson;1104986]sorry.I saw links but i can not solve my problem yet. ... .but how can i do it?[/QUOTE] You should really follow those links that woooee provided. For this type of task you should be either using pexpect or subprocess PIPES, not [ICODE]os.system[/ICODE]. | |
Re: Here's a way: [code=python] shape = 0 while shape != 4: # Your existing code can go here [/code] Just slap that -blam- into a while loop and you've got a class 5 repeater. | |
Re: [QUOTE=mms6;1029512]anyone plz help me out here[/QUOTE] We're not here to do your homework for you. But good job on copy-pasting your assignment. [QUOTE=masterofpuppets;1029534]hi after reading the specification like 5 times here's what I came up with :)[/QUOTE] Dear MasterofPuppets, You shouldn't be spoon feeding people looking for us to do … | |
Re: Wow turtle is fun to play with :) [code=python] import turtle, time tp = turtle.Pen() tp.color('blue') for k in xrange(51): for j in xrange(k): tp.right(360/float(k)) tp.forward(25) time.sleep(3)[/code] *Oops I didn't mean to post this here, it was supposed to be in the thread asking about turtle *sorry* Editor's note: It's … | |
Re: [QUOTE=Ene Uran;871712]Beer was the national drink of ancient Egypt. The pharoahs even appointed a "royal chief beer inspector" to protect its quality. I don't think there is such a person in the US.[/QUOTE] Well each brewery does employ their own Brew Master that checks the brew on a daily basis, … | |
Re: As far as conversions are concerned there are a number of functions: [QUOTE]int(x [,base]) converts x to an integer long(x [,base]) converts x to a long integer float(x) converts x to a floating-point number complex(real [,imag]) creates a complex number chr(x) converts an integer to a character unichr(x) converts an … | |
Re: Gribouillis I'm not sure if this has been fixed or not (perhaps you're using a newer version of Python where this bug has been eliminated) but when I use your path.join this is what I get: [code=python] >>> from os.path import join as pjoin >>> pjoin("C:", "foo", "bar", "baz") 'C:foo\\bar\\baz' … | |
Re: [code=python] >>> answer =('7', 'Q', '5', 'H', '9', '4', '3', '8', 'L') >>> ''.join(answer) '7Q5H9438L' >>> [/code] | |
Re: Sometimes, if the module isn't in the same place, it is a matter of the path. At the begging of your progam you can do something like: [code=python] import sys sys.path.append('/path/tomy/module') from MyMod import moduleA [/code] However I don't know how Eclipse as an IDE differs in terms of working … | |
Re: If you search this forum for pygame you will find tons of examples of games that our forums members have creating using said module. Either that or google. | |
Re: It depends heavily on the format that you are receiving the time data in. Could you provide us with an example of EXACTLY what you are getting? If it is coming in as a string with the Time Zone then iyou simply use time.strptime(), which will make it very easy … | |
| Re: I believe that [icode]subprocess.call[/icode] is used to open a file as if you had "dobule-clicked" the file's icon. If you're looking to do it "within" python you'll need to search this forum for how others have done it before you. |
Re: [QUOTE=tyincali;724172] (I think (I) (Might) ((See) A Problem) (Here) [/QUOTE] This is improper syntax, you're missing a closing parenthesis ;) No but seriously, to the OP: the error you are getting is trying to tell you that the image file that you're trying to open doesn't exist. You need to … | |
Re: I don't know if this module has been updated to support xlsx, but it provides a method to convert xls to xml: [URL="http://www.lexicon.net/sjmachin/xlrd.html"]xlrd[/URL] | |
Re: You're not multiplying by 2^16 and 2^8 you're shifting by 16 and 8 bits, respectively. By doing so (and then adding), you're able to fit the two letters into a single 16 bit block... or something like that. | |
Re: Greetings, welcome. Wondering what version of Python you're using and on which platform? First a tip: Don't EVER use tabs for Python indentation. It's pretty much standard practice to use 4 spaces instead. Most text editors can be set up to handle this. Here: Read over [URL="http://www.python.org/dev/peps/pep-0008/"]PEP 8[/URL], and then … | |
Re: An even easier workaround for being able to import modules from ANY directory is to modify the sys.path variable at run time. So at the beginning of your code do something like this: [code=python] import os,sys sys.path.append('/path/to_my/module') import my_custom_module [/code] And if you're working with a hard-coded windows path make … | |
Re: Please use code tags so that your indentation is not lost, and so that we may better read your posts. Code tags go like this: [noparse][code=python] # MY code goes between these tags! [/code][/noparse] | |
Re: [QUOTE=vegaseat;1038164]My advice, get rid of Vista as soon as you can.[/QUOTE] And if that's not an option make sure you're both installing and running all these things by right-clicking the executable and selecting "Run as Administrator" | |
Re: [QUOTE=mahela007;1041780]Is it possible to keep writing the output of a program on the same line instead of moving to a new line every time? The output should be written over the preceding output. An example would be a kind of counter... say a number that counts from 1 to 10 … | |
Re: Without using list comprehension: [code=python] f = open( "data.txt" ) lines = f.readlines() f.close() f = open( "data2.txt", 'w' ) for line in lines: line = line.strip() if line: f.write( "%s " % line ) f.write( "\n" ) f.close() [/code] | |
Re: I've used [URL="http://icofx.ro/"]IcoFX[/URL] in the past with no trouble | |
Re: It is impossible to answer your question without more information. If you are implementing a CGI HTTP server you should reference the following module, which may already provide some of the functions you're looking for: http://docs.python.org/library/cgihttpserver.html#module-CGIHTTPServer | |
Re: You could create your own class based on dictionary that checks whether that key already exists in `__setattr__` and then add the value to a list/tuple. When you do your `get()` you can then use `isinstance` to act accordingly. | |
Re: Use code tags: [noparse][code=python] #Code in here [/code][/noparse] This will make your code readable for us forum members, which in turn helps us to solve your problem. In order to limit the number of guesses, you should be using an [icode]if guesses == allowed_guesses:[/icode] statement, or something similar. | |
Re: Can you try just [icode]import myfile[/icode], without the .pyd? | |
| Re: [QUOTE=leegeorg07;903214]Hi, me again, sorry if this sounds completely noobish but I have no idea what to do, even with shadwickman's help could anyone help?[/QUOTE] You have no idea what to do with regards to what? You don't know how to download the files? Browse the source tree? What? |
Re: [QUOTE=sneekula;862497]It's time again to poll the well educated folks at DaniWeb about the possible cause of the end of humanity on earth.[/QUOTE] I foresee an unavoidable uprising of our machines against us. Machines kill people at alarming rates, and we only keep trying to make them better and smarter... more … |