[Tutor] Rép. : parsing Spreadsheet document

Luhmann luhmann_br at yahoo.com
Thu Dec 10 14:27:27 CET 2009


If you just want to load the data into python one time, rather than connecting to the file, it would be more handy to paste the cells from the clipboard. 
Here's how I do it on windows:

from win32clipboard import * #("pywin32" module required)
def pastetable():	OpenClipboard()	try: a=GetClipboardData(13)	except:		CloseClipboard()		return None	CloseClipboard()	a=a.split('\r\n')	for n, b in enumerate(a):		a[n]=b.split('\t')	return a


      __________________________________________________________________
Obtenez l'adresse de courriel parfaite: @ymail.com or @rocketmail.com. Obtenez votre nouvelle adresse maintenant à  http://cf.new.mail.yahoo.com/addresses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20091210/1dea65b2/attachment.htm>


More information about the Tutor mailing list