Posts
 
Reputation
Loading chart. Please wait.
Joined
Last Seen
0 Reputation Points
70% Quality Score
Upvotes Received
2
Posts with Upvotes
1
Upvoting Members
2
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
Ranked #11.7K
Ranked #2K
~19.7K People Reached
Favorite Forums

13 Posted Topics

Member Avatar for ohmang841

[code] def get_list(): return [raw_input("Please enter a string: ") for i in range(int(raw_input("Please enter the number of strings you want to input\n")))] def shortest(lst): return min(lst, key = len) def longest(lst): return max(lst, key = len) def alpha(lst): return [e for e in lst if e.isalpha()] if __name__ == "__main__": …

Member Avatar for Lardmeister
0
9K
Member Avatar for stevanity

To be fair, top-down isn't a very descriptive name for the category of grammars. If we're using [url]http://java.sun.com/docs/books/jls/second_edition/html/syntax.doc.html[/url] without any modification, then this grammar is probably not suitable for LL(1). The most obvious problem comes from Selector -> . x | . y | . z However, a LL(2) parser …

Member Avatar for stevanity
0
215
Member Avatar for sarfrazashfaq

[code] # Very Loose translation, beware of the globals() and NEVER explicitly translate Perl to Python. See why below. # Assumes that legs, the var referenced by legs, reference, ref, fields, fxall, merge_swap_legs, new_fk_ref, and logg exist if legs in globals(): legs = globals()[legs] else: legs = locals()[legs] if reference …

Member Avatar for leegao
0
244
Member Avatar for Diomedes

Hi, [code] from ctypes import * from see import see import sys class linknode(Structure): pass linknode._fields_ = [ ("nextNode", POINTER(linknode)), ("intData", c_int), ] class linked_list(): """ our own linked list based on ctypes """ head_node = None def add(self, int_data): node_to_add = linknode(intData = c_int(int_data)) if (self.head_node == None): self.head_node …

Member Avatar for TrustyTony
0
705
Member Avatar for Stefano Mtangoo

scp is integrated with ssh so if you can find an openssh server for your platform, you should be in the clear. PS: It's not really recommended to use python for this as there are many steps required to complete this step via scp. If you just need to transfer …

Member Avatar for Gribouillis
0
222
Member Avatar for sab786

well from the top of my head it should be [code]for line in file[/code] instead of the plural form of line. Is this basically how the gist of your script? [code] handle = open("file.file") file = handle.readlines() handle.close() del handle dict = {} for line in file: #Here we just …

Member Avatar for woooee
0
310
Member Avatar for Furtano
Member Avatar for leanne86

And this is where apache's httpd.conf comes to the rescue. cd /etc/httpd/conf cat httpd.conf|grep pstats This will give you the grep for the keyword pstats, and it will give you the static location of the files. And now I'm also going to assume that you're running apache+mod_python as opposed to …

Member Avatar for jlm699
0
192
Member Avatar for Dixtosa

You do realize that C++ only supports ethernet (class 1) protocols and you must write your own wrapper to use higher level protocols (IP, TCP, + UDP) and generate your own packets.

Member Avatar for leegao
0
86
Member Avatar for dieg0s

That would return an error since the last 3 objects are arguments. try [code]s = subprocess.Popen(("grep", "-w", "%s"%variable, Data.txt), stdout = subprocess.PIPE) output = s.communicate()[0][/code]

Member Avatar for jlm699
0
7K
Member Avatar for southafrica1

I've actually ported the python frontend up to 3.0.1, but I've never had experience with the python C API and apparently the C API had some major changes from 2.x to 3.x so I couldn't continue. Here's my best shot: [url]http://www.python-forum.org/pythonforum/viewtopic.php?f=3&t=14122&p=65820#p65812[/url]

Member Avatar for southafrica1
0
175
Member Avatar for penguin22

os.system doesn't emulate a shell environment so that might be the reason why. Try this [code]from subprocess import PIPE, Popen build = Popen(("devenv.exe", "filename.sln", "/Build"), shell = True)[/code] Alternatively put in the whole path of devenv.exe and see where that leads you.

Member Avatar for penguin22
0
158
Member Avatar for catcit

Oh hey, this might help you, I wrote this helper class a while back while doing some work with excel and I decided to upload this onto github a few days ago. [url]http://github.com/leegao/pyXLSX/tree/master[/url] Basic Usage: [code] from xlsx import workbook def lastnums(t,n): return t[len(t)-n:len(t)] Workbook = workbook("workbook.xlsx") extractnums = ("12", …

Member Avatar for sab786
0
133