Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #1K
~49.8K People Reached
Favorite Tags

30 Posted Topics

Member Avatar for Freaky_Chris

I don't seem to be getting any errors, maybe you could post a screenie? I did: [code=python]import os f = '''txttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttextWEEtxttex.text''' print "Size of file:" print os.path.getsize(f) x=0 print "\nNumber of characters of filename:" for char in f: x=x+1 print x[/code] Result: >>> Size of file: 896 Number of characters …

Member Avatar for rory jackson
2
4K
Member Avatar for ub007

[QUOTE=Gribouillis;682250]See the standard modules getopt and optparse [url]http://docs.python.org/lib/module-getopt.html[/url] and [url]http://docs.python.org/lib/module-optparse.html[/url][/QUOTE] Stop posting useless crap... ub007, if you want to use command arguments use this example: [code=python]import sys for argument in sys.argv: print argument print "Number of arguments:", str(len(sys.argv)) x=0 while x < len(sys.argv): print "sys.argv[" + str(x) + "] =", …

Member Avatar for richieking
0
228
Member Avatar for FreezeBlink

[QUOTE=jrcagle;605307]raw_input("Press any Key")[/QUOTE] I would use this function, but for the text I would prefer using: raw_input("Press Enter to Exit")

Member Avatar for richieking
0
14K
Member Avatar for mahmud2008
Member Avatar for atsuko

[code=python]string = "hi" f = open("filename.txt") contents = f.read() f.close() print "Number of '" + string + "' in your file is:", contents.count("hi")[/code] Replace "hi" with the word you want to count basically. Feel free to ask anymore questions!

Member Avatar for TrustyTony
0
706
Member Avatar for Shadow14l

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). I want to know how to search my way through the packets and filter them. …

Member Avatar for Tech B
0
125
Member Avatar for vegaseat

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 the ball speeeeeeeeeeeeeds UP! Any explanation :O?

Member Avatar for Arkapravo
2
371
Member Avatar for EAnder

If it's an entry box... [code=python]entry = Entry() entry.pack() ##### Type 'hello' into the box print entry.get() >> hello[/code]

Member Avatar for vegaseat
0
820
Member Avatar for mariashahid

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.

Member Avatar for LizR
0
72
Member Avatar for preetisingh

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.

Member Avatar for Shadow14l
0
82
Member Avatar for SoulMazer

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: [code=python]words = ["aero", "aesthet", "andr", "arch", "arch", "ast", "baro",\ "biblio", "bio", "cardi", "chron", …

Member Avatar for Dunganb
0
2K
Member Avatar for csm_tC

[QUOTE=Dekudude;681784]raw_input() is for strings. Try input()...[/QUOTE] 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 an example that works fine. I hope you don't have too …

Member Avatar for Shadow14l
0
262
Member Avatar for mark192

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, or just type it all out. Or just scroll down …

Member Avatar for RayvenHawk
0
284
Member Avatar for agibbons

[code=python]filerz = "c:\\cookie\\win\\etc\\beeeeeeepyyrasdf.doom" def filetype(file): return file.split(".")[-1] print filetype(filerz) >> doom[/code]

Member Avatar for slate
0
315
Member Avatar for bimaljr

I prefer this method [code=python]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 print "\nFile #" + str(x) + ": " + files print "\nTotal number of .txt files in: " + path + " -" print …

Member Avatar for bimaljr
0
8K
Member Avatar for Malwarehunter94

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 most likely will never find yourself overwhelmed with their system. 3. DON'T RIP SPRITES …

Member Avatar for ripsocrates
0
146
Member Avatar for Shadow14l

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... ================================================================ I've seen other people say to hook windows messages and listen for wm_activate, and others... I already have when to …

Member Avatar for Shadow14l
1
16K
Member Avatar for Shadow14l

I am using this function to download files: [code=python]def download(url): urllib.urlretrieve(url, url.split("/")[-1])[/code] I am downloading files from a site, but I don't know the EXACT filename... All I know is the id for them... Example: download("http://site.com/files/489411/") When i am to do that, it automatically resolves the appropriate filename and it …

0
84
Member Avatar for alivip

One way I liked to get words and count them might help you. [code=python]wordlist = string.split(" ") for word in wordlist: print word[/code] Then you could use that again, if you wanted each two words together. [code=python]print wordlist[0], wordlist[1][/code] You should use len(wordlist) to find out the total number of …

Member Avatar for Freaky_Chris
0
244
Member Avatar for sarabhjeet

Like Chris said, change the file extension from .py to .pyw. The console should only be used for basic applications or for debugging.

Member Avatar for sarabhjeet
0
137
Member Avatar for freakin_chris

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 site, they'll tell more people, and eventually your site will catch on …

Member Avatar for Shadow14l
-1
93
Member Avatar for zls11610
Member Avatar for sln

I read somewhere those mac os x's come installed with Python 2.3. Are you sure you have Python 2.4????

Member Avatar for Shadow14l
0
55
Member Avatar for Shadow14l

Nvm :/ Please excuse my blindness. Where's the delete topic button at? :( Please excuse it again. ~Shadow14l

0
56
Member Avatar for cwolfraven

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.

Member Avatar for Freaky_Chris
0
98
Member Avatar for Shadow14l

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 code tag? (python)is it this :P?(/python)

Member Avatar for Shadow14l
0
244
Member Avatar for gotm

You'd want to start by getting the info from the file. [code]allplayerinfo = [] info = open("filename.cvs") data = info.read() info.close() for lines in data: allplayerinfo.append(lines)[/code] Then you should sort the info for every player. Use .split(",") on each individual string line. Organize them all into var lists. Or sort …

Member Avatar for jrcagle
0
140
Member Avatar for tondeuse34

I found a very neat sample of doing this: [code]from ctypes import * import time, curses, win32con, win32gui PUL = POINTER(c_ulong) class KeyBdInput(Structure): _fields_ = [("wVk", c_ushort), ("wScan", c_ushort), ("dwFlags", c_ulong), ("time", c_ulong), ("dwExtraInfo", PUL)] class HardwareInput(Structure): _fields_ = [("uMsg", c_ulong), ("wParamL", c_short), ("wParamH", c_ushort)] class MouseInput(Structure): _fields_ = [("dx", …

Member Avatar for tondeuse34
0
2K
Member Avatar for lllllIllIlllI

Maybe you should try using the webbrowser module!!!!! [code]import webbrowser firefox = webbrowser.get('mozilla') # or 'firefox' firefox.open('http://www.google.com') # any site[/code]

Member Avatar for lllllIllIlllI
0
122
Member Avatar for Shadow14l

Whenever I open a page with urllib or urllib2 (file = urllib.urlopen(urllinkhere)) and when I print it, I get this: [IMG]http://i121.photobucket.com/albums/o229/Shadow14l/boxes1.gif[/IMG] See all the square boxes? Unknown characters or something... Well they are and represent the returns (new lines). If I saved this to a text file, all the boxes …

Member Avatar for Shadow14l
0
107

The End.