Search Results

Showing results 1 to 9 of 9
Search took 0.00 seconds.
Search: Posts Made By: solsteel ; Forum: Python and child forums
Forum: Python Oct 21st, 2009
Replies: 2
Views: 203
Posted By solsteel
If it's not builtin, it must be imported from another module.>>> getattr(list, '__module__')
'__builtin__'
>>>
Forum: Python Sep 19th, 2008
Replies: 2
Views: 2,249
Posted By solsteel
Use string method strip() to remove newline characters.
for line in lines:
filemenu.add_cascade(label=line.strip())
Forum: Python Sep 14th, 2008
Replies: 10
Views: 1,498
Posted By solsteel
obj[:3] is a slice of the time.struct_time object. The asterisk preceding the list returned by the slice expands the list into individual elements. Example:>>> d = time.strptime('16/06/2010',...
Forum: Python Sep 12th, 2008
Replies: 10
Views: 1,498
Posted By solsteel
I thought my use of enumerate() would give you enough information. Here's the code again with code to write to the Excel file (untested):print "\nLooping through the file, line by line."
workbook =...
Forum: Python Sep 11th, 2008
Replies: 10
Views: 1,498
Posted By solsteel
Decide what types of objects that need to be converted. If needed, create a function to make each conversion type. An exception should occur on any failed conversion. If all conversions fail, return...
Forum: Python Jul 14th, 2008
Replies: 3
Views: 1,133
Posted By solsteel
It appears that you omitted an operator:
yIntercept = y1 - (((y2 - y1)/(x2 - x1))(add operator here)(x1))
Forum: Python Jul 1st, 2008
Replies: 4
Views: 1,604
Posted By solsteel
>>> s = 'XXXXX -\n\t XXXX'
>>> ''.join(s.split())
'XXXXX-XXXX'
>>>
Forum: Python May 7th, 2008
Replies: 10
Views: 2,478
Posted By solsteel
Try this:
csv.reader(str(self[filename]).split('\n')The argument to csv.reader can be any iterable object that produces a string each time its next() method is called.
Forum: Python Mar 13th, 2007
Replies: 6
Views: 2,472
Posted By solsteel
If I understand you correctly, there are several ways:

# Update the local namespace
>>> for i in range(25):
... exec "%s = %d" % ('var'+str(i), 0) in None

# Update the global namespace...
Showing results 1 to 9 of 9

 


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

©2003 - 2009 DaniWeb® LLC