Search Results

Showing results 1 to 4 of 4
Search took 0.00 seconds.
Search: Posts Made By: ghostdog74 ; Forum: Python and child forums
Forum: Python 1 Day Ago
Replies: 8
Views: 200
Posted By ghostdog74
use a html parser for this job, such as BeautifulSoup. If you don't want to, then another way is to read the whole html, split on "</div>", go through each element in the list, check for "<div...
Forum: Python 1 Day Ago
Replies: 1
Views: 126
Posted By ghostdog74
you do it systematically using the same way to read single level dict
d={'AAA': {'KEY1':'text1', 'KEY2':'text2', 'KEY3': 'text3', 'KEY4': 'text4'},
'BBB': {'BBB1':{'KEY1':'text1', 'KEY2':'text2',...
Forum: Python May 31st, 2007
Replies: 3
Views: 2,386
Posted By ghostdog74
one method i always use is the os.path.join() method.

dir = os.path.join("C:\\","documents and settings","user","desktop")
starcraftpath = os.path.join(dir,"starcraft.exe")

takes care of the...
Forum: Python Apr 17th, 2007
Replies: 5
Views: 1,055
Posted By ghostdog74
if in the file, the content is indeed this:

[1,2,3,4]

then when you read the file line by line, you can use eval() to turn it into a list

for line in open("file"):
alist = eval(line)
...
Showing results 1 to 4 of 4

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC