-3

I have Python 2.6.6 version and I don't have access to install new modules like pandas,xlrd,xlwt.

I want to read Excel using Python . Is it possible to read Excel using Python with default modules present in Python.

Sujit Dhamale
  • 885
  • 8
  • 12
  • Probably this can help you: [How to install python modules without root access?](https://stackoverflow.com/questions/7465445/how-to-install-python-modules-without-root-access) – Georgy Mar 07 '18 at 21:20

2 Answers2

0

1) if you are using an IDE ex. PyCharm then you can drag an drop the file in your workspace or project and open it like this --> open("myfile.csv") it will be opened as a csv (comma seperated value) 2) otherwise, use --> the file complete path such as open("User/Desktop/myfile.csv")

in both cases use --> with open(.....) as f: for x in f: write some code here.. and in this case x represents an element or cell in your excel file

Mohamed Abdou
  • 395
  • 2
  • 10
0

Based on this link: http://davis.lbl.gov/Manuals/PYTHON/library/csv.html you should be able to use reader and writer commands by importing csv. You can also define different delimiters:

import csv

FileReader = csv.reader(open('FileName.csv', 'rb'), delimiter=' ',quotechar='|')

Moreover, you can map the data you are reading into a dict using DictReader.

Georgy
  • 6,348
  • 7
  • 46
  • 58