Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~34.6K People Reached
Favorite Forums
Favorite Tags

13 Posted Topics

Member Avatar for vegaseat

First of all i LOVE these code snippets you did for various Python topics, i find them EXTREMELY helpful. With that said, i'm wondering what does the term "hash order" mean? I've seen the word "hashable" used several times now with Python and do not understand what it is referring …

Member Avatar for vegaseat
1
7K
Member Avatar for vegaseat

i have spent the last hour trying to figure out this section of code from above. [CODE]def translate(match): return wordDic[match.group(0)][/CODE] Can anyone PLEASE explain what this is doing and how it works?

Member Avatar for Gribouillis
0
20K
Member Avatar for vegaseat

Can someone please explain to me the difference between these 2 lines: [CODE]if lastchar in punctuations:[/CODE] and [CODE] if key in '.!?':[/CODE] Why in one case can we check against a list of string values and in the other case against a string ?

Member Avatar for Ene Uran
3
803
Member Avatar for Skrell

I recently came across this code on the internet and I'm having a very hard time understand how it works. I was hoping someone could comment the code a bit in order to help me learn it better? I understand most of it, but get lost when any of the …

Member Avatar for Skrell
0
293
Member Avatar for Skrell

First, i'm new to C and trying to teach it to myself so be gentle. All i'm trying to do is malloc a block of memory so that i can store a few strings. These strings are to be pointed at by an array of pointers so that as i …

Member Avatar for Skrell
0
100
Member Avatar for vegaseat

Would someone mind explaining the code: [CODE]def print_timing(func): def wrapper(*arg): t1 = time.clock() res = func(*arg) t2 = time.clock() print '%s took %0.3fms' % (func.func_name, (t2-t1)*1000.0) return res return wrapper[/CODE] as i don't understand how "res" works or what func is doing ?

Member Avatar for Skrell
1
4K
Member Avatar for Skrell

After MANY hours searching online documentation, i still cannot find some simple examples of using the subprocess module to execute commands in the windows console and read back in the output from said command(everything is for unix). So for example, if i wanted to do something like use 7z.exe to …

Member Avatar for Skrell
0
108
Member Avatar for TrustyTony

Ok now that i've found your code, as I am a newb, would you mind explaining the openhook concept a bit as i don't full grasp it?

Member Avatar for TrustyTony
0
950
Member Avatar for Skrell

Why does this return None? [CODE]list1 = ['Herring','used','to','be','abundant','in','the','AtlAntic','Ocean','then','herring','got','overfished'] print list1.sort(key=lambda s : s.count('a'))[/CODE]

Member Avatar for JoshuaBurleson
0
112
Member Avatar for Skrell

I am trying to use the fileinput.input() module to read in the lines from a bunch of files in a directory and occasionally receive an IOerror exception. What is the best way to handle this exception so that if 1 of the items in the list i'm feeding fileinput,input() generates …

Member Avatar for TrustyTony
0
498
Member Avatar for Skrell

Newbie here! I am trying to make a simple python program that when called from the command line, would search all the .txt files in a given directory for a given string inside the files by typing something like this > python mygrep.py ":" "C:\" Also, i want to specifically …

Member Avatar for TrustyTony
0
208
Member Avatar for Skrell

Can someone please explain these results to me and why they are different: >>> 7339520/(1024.0*1024) 6.99951171875 >>> print "%0.3f" % (7339520/(1024.0*1024)) 7.000 >>>

Member Avatar for Gribouillis
0
102
Member Avatar for Skrell

I can't seem to find this answer anywhere. All i want to do is write a list of numbers to a file using the file.write() method however i wanted to format the numbers as if i had been using a print statement. When you print you can use %0.2f for …

Member Avatar for markfw
0
228

The End.