Forum: C# Oct 14th, 2008 |
| Replies: 4 Views: 445 I'd suggest starting by opening up the image file in binary "rb", and depending on what is a line for you, extract them out accordingly. |
Forum: C# Oct 14th, 2008 |
| Replies: 2 Views: 1,398 I think he is submitting this as a snippet... |
Forum: C# Oct 14th, 2008 |
| Replies: 1 Views: 752 Use a codec to encode your video before you upload it, it usually greatly decreases the size of your video, and some new ones barely reduce quality that it's unnoticeable. |
Forum: Python Sep 21st, 2008 |
| Replies: 12 Views: 3,919 I'd use a while loop if you're gonna use two different lists. If you want to use a for loop, I'd suggest using a dictionary to store values and keys.
Here's an example of the while loop:
words =... |
Forum: Python Sep 1st, 2008 |
| Replies: 2 Views: 1,403 Stop posting useless crap...
ub007, if you want to use command arguments use this example:
import sys
for argument in sys.argv:
print argument |
Forum: Python Sep 1st, 2008 |
| Replies: 5 Views: 659 Never use input(), always consider the user may accidentally put in a string character. That way you can handle it appropriately.
Anyways csm_tC, you need to use a try & except block.
Here's... |
Forum: Python Sep 1st, 2008 |
| Replies: 6 Views: 1,231 If it's an entry box...
entry = Entry()
entry.pack()
##### Type 'hello' into the box
print entry.get()
>> hello |
Forum: C# Aug 23rd, 2008 |
| Replies: 3 Views: 412 In vc#, when you start a method (by typing a period "."), it will automatically pop up ALL the methods known. Start typing which one you want and it will go to it, hit enter to accept the right one,... |
Forum: Python Aug 17th, 2008 |
| Replies: 4 Views: 3,177 filerz = "c:\\cookie\\win\\etc\\beeeeeeepyyrasdf.doom"
def filetype(file):
return file.split(".")[-1]
print filetype(filerz)
>> doom |
Forum: Python Aug 17th, 2008 |
| Replies: 8 Views: 1,180 I prefer this method
import os
path = ('c:\\stuff\\countfiles\\')
print "Counting all .txt files in: " + path
x=0
for files in os.listdir(path):
if files.endswith('.txt'):
x+=1
... |
Forum: Python Jul 27th, 2008 |
| Replies: 1 Views: 572 I thought I knew how packets worked, but I'm just not understanding how to capture and read them...
I am playing this online game which is connected to a server (some server off of battle.net).
... |
Forum: Python Jul 14th, 2008 |
| Replies: 4 Views: 3,070 Thanks a lot, I was looking for an easy answer like this!!!!! |
Forum: Python Jul 13th, 2008 |
| Replies: 4 Views: 3,070 It doesn't support those, I was looking for a module, or another method to do that. |
Forum: Python Jul 13th, 2008 |
| Replies: 4 Views: 3,070 I just need some code that will return a string of the name of the current activated window title/name.
I've spent almost hours looking for a simple example though...
... |
Forum: Python Jul 6th, 2008 |
| Replies: 0 Views: 1,405 I am using this function to download files:
def download(url):
urllib.urlretrieve(url, url.split("/")[-1])
I am downloading files from a site, but I don't know the EXACT filename... All I... |
Forum: Python Jun 9th, 2008 |
| Replies: 5 Views: 1,257 string = "hi"
f = open("filename.txt")
contents = f.read()
f.close()
print "Number of '" + string + "' in your file is:", contents.count("hi")
Replace "hi" with the word you want to count... |
Forum: Game Development May 21st, 2008 |
| Replies: 6 Views: 4,865 The tutorials are on that yoyo site :)
They are very helpful. Check them out some time, just use google, you'll get somewhat of an exact url :P |
Forum: Game Development May 19th, 2008 |
| Replies: 6 Views: 4,865 1. Decide the exact characters you want to be in your game. See if you can get them then. Use variables to set the turn numbers and length.
2. Gamemaker 7 makes gamemaking incredibly easy. You... |
Forum: Show Off your Projects May 19th, 2008 |
| Replies: 10 Views: 2,607 Ahhh, beeps caught me off my guard O.o
They get a bit annoying :/ |
Forum: Pay-Per-Click Advertising May 19th, 2008 |
| Replies: 2 Views: 10,575 I know it may seem silly, but you should purchase a domain. More people would be interested in your site if it was .com/.net/.org
Also tell all of your friends about it, and if it's a good enough... |
Forum: Python May 19th, 2008 |
| Replies: 7 Views: 843 You probably syntaxed the the file incorrectly :P
import os
filepath = "C:\\Documents and Settings\\Username\\Desktop\\coolapps\\pythonprograms\\zomglongfilename.file"
info =... |
Forum: Python May 19th, 2008 |
| Replies: 3 Views: 716 Like Chris said, change the file extension from .py to .pyw. The console should only be used for basic applications or for debugging. |
Forum: Python May 18th, 2008 |
| Replies: 8 Views: 748 Is this what you mean?
string = "Hi I hope this helps!"
wordlist = string.split(" ")
print "None", wordlist[0], "- 0"
for x in range(len(wordlist)):
try:
jstring = wordlist[x]... |
Forum: Python May 18th, 2008 |
| Replies: 4 Views: 6,195 I have a question!!!!!
Whenever you put your mouse over something, that makes one of those floating labels appear when you hover over something something interesting happens.
What happens is... |
Forum: Python May 18th, 2008 |
| Replies: 7 Views: 843 I don't seem to be getting any errors, maybe you could post a screenie?
I did:
import os
f =... |
Forum: Python May 18th, 2008 |
| Replies: 1 Views: 443 I read somewhere those mac os x's come installed with Python 2.3.
Are you sure you have Python 2.4???? |
Forum: Python May 18th, 2008 |
| Replies: 0 Views: 327 Nvm :/
Please excuse my blindness.
Where's the delete topic button at? :(
Please excuse it again.
~Shadow14l |
Forum: Python May 18th, 2008 |
| Replies: 4 Views: 1,545 If that doesn't work, you can always try:
repr() |
Forum: Python May 18th, 2008 |
| Replies: 8 Views: 919 Yeah, that example works well enough for a solution.
My friend used to always forget to escape. After he learned that, he went on to url's. He was extremely confused, mixing up backspaces along... |
Forum: Python May 18th, 2008 |
| Replies: 8 Views: 748 One way I liked to get words and count them might help you.
wordlist = string.split(" ")
for word in wordlist:
print word
Then you could use that again, if you wanted each two words... |
Forum: Python May 18th, 2008 |
| Replies: 8 Views: 919 Chris, you forgot the escape the forward slashes in your example with the directories :P
Cwolfraven, don't forget to use "\\", for every directory name. |
Forum: Python May 18th, 2008 |
| Replies: 2 Views: 1,593 Thanks, the other time I tried the python tag, I put quotes around "python" xD |
Forum: Python May 17th, 2008 |
| Replies: 2 Views: 1,593 I just want a console to run. When I use this function, I don't ever want the automatic tk window to appear. How would I use this function without any gui?
*Also on a side note, what is the python... |
Forum: Python May 14th, 2008 |
| Replies: 2 Views: 385 You'd want to start by getting the info from the file.
allplayerinfo = []
info = open("filename.cvs")
data = info.read()
info.close()
for lines in data:
allplayerinfo.append(lines) |
Forum: Python May 12th, 2008 |
| Replies: 4 Views: 1,366 I found a very neat sample of doing this:
from ctypes import *
import time, curses, win32con, win32gui
PUL = POINTER(c_ulong)
class KeyBdInput(Structure):
_fields_ = [("wVk",... |
Forum: Python May 12th, 2008 |
| Replies: 3 Views: 2,190 Maybe you should try using the webbrowser module!!!!!
import webbrowser
firefox = webbrowser.get('mozilla') # or 'firefox'
firefox.open('http://www.google.com') # any site |
Forum: Python May 12th, 2008 |
| Replies: 3 Views: 4,778 I would use this function, but for the text I would prefer using:
raw_input("Press Enter to Exit") |
Forum: Python May 12th, 2008 |
| Replies: 2 Views: 445 Thank you very much Jeff, that really helped me. Now the only thing I am concerned with is remembering to replace the "\r".
Thanks again!
-Shadow14l |
Forum: Python May 11th, 2008 |
| Replies: 2 Views: 445 Whenever I open a page with urllib or urllib2 (file = urllib.urlopen(urllinkhere)) and when I print it, I get this:
http://i121.photobucket.com/albums/o229/Shadow14l/boxes1.gif
See all the... |