Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
~7K People Reached
Favorite Forums
Favorite Tags
Member Avatar for nuaris

How do I read a .txt/.csv file from an internet address? For example: http:\\[url]www.internetaddress.com\file.txt[/url] I don't think file() would work for this. Thanks

Member Avatar for snippsat
-1
5K
Member Avatar for nuaris

[ICODE]class classA: #saved as classA.py def __init__(self): print "class A" printB() def printB(): print "B"[/ICODE] [ICODE]>>> classA() class A Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> classA() File "C:\Documents and Settings\Owner\Desktop\timetable\classA.py", line 5, in __init__ printB() NameError: global name 'printB' is not defined[/ICODE] Using the class …

Member Avatar for yinchao
0
2K
Member Avatar for nuaris

How do I use classes in python? Do I import them? For example: class classA: def __init__(self): print "class A" class classB: def __init__(self): classA_list = [] for i in range(5): classA_list.append(classA()) #list of classA objects This works if I have both classes in one file. But if the classes …

Member Avatar for nuaris
0
148
Member Avatar for nuaris

How do I read something from DOS? For example, doing a command in DOS, like 'dir'/etc. and writing the output to a variable in python? I know about the listdir() function, 'dir' in DOS is just an example.

Member Avatar for BearofNH
0
194
Member Avatar for nuaris

Lists have the append() function to add an item to the end of the list. Is there a similar function to add to the end of dictionaries? Update() doesn't seem to work. Example: >>> a = {'a':'a'} >>> b = {'b':'b'} >>> c = {'c':'c'} >>> a {'a': 'a'} >>> …

Member Avatar for nuaris
0
746