Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8121933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:39:55+00:00 2026-06-06T05:39:55+00:00

from xlrd import * book = open_workbook(File_1.xls) #sheet = book.sheets()[0] #book.sheets() returns a list

  • 0
from xlrd import *

book = open_workbook("File_1.xls")

#sheet = book.sheets()[0]           
#book.sheets() returns a list of sheet objects...     alternatively...
#sheet = book.sheet_by_name("qqqq") #we can pull by name
 sheet = book.sheet_by_index(0)     #or by the index it has in excel's sheet collection

r = sheet.row(0)                    #returns all the CELLS of row 0,
c = sheet.col_values(0)             #returns all the VALUES of row 0,

for i in xrange(sheet.nrows):
print sheet.row_values(5) 

I am reading a file which is in my desktop , but when I am running the script written in python it’s giving error

  Traceback (most recent call last):
  File "C:\Python26\ReadXLS.py", line 6, in <module>
  book = open_workbook("File_1.xls")
  File "C:\Python26\Lib\site-packages\xlrd\__init__.py", line 449, in open_workbook
  ragged_rows=ragged_rows,
 File "C:\Python26\Lib\site-packages\xlrd\__init__.py", line 941, in biff2_8_load
 f = open(filename, open_mode)
  IOError: [Errno 2] No such file or directory: 'File_1.xls'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:39:57+00:00Added an answer on June 6, 2026 at 5:39 am

    You need to cd Desktop before your run Python, as your error message says the file doesn’t exist:

    No such file or directory: 'File_1.xls'
    

    Another fix would be to move the Python file into the same folder as the Excel file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Python script that uses xlrd to obtain data from xls
I am reading data from an xls spreadsheet with xlrd. First, I gather the
I am processing the data reading from test.xls file like so: from sys import
I am maintaining a Python script that uses xlrd to retrieve values from Excel
I am writing a python script to read data from an excel sheet using
from fabric.api import env, sudo def get_hostname(): env.hosts = ['user@host_ip'] env.passwords = {'user@host_ip': 'password'}
from shutil import copy f = open(r'C:\temp.txt', 'r') for i in f.readlines(): print i
I have to port an algorithm from an Excel sheet to python code but
I use xlrd to read data from excel files. For integers stored in the
From previous queries, I have two variables. The first: <list> <item>a</item> <item>b</item> <item>a</item> <item>c</item>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.