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 800701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:19:47+00:00 2026-05-14T23:19:47+00:00

So OK if I run this wrong code: csvReader1 = csv.reader(file(‘new_categories.csv’, rU), delimiter=’,’) for

  • 0

So OK if I run this wrong code:

csvReader1 = csv.reader(file('new_categories.csv', "rU"), delimiter=',')
for row1 in csvReader1:
    print row1[0]
    print row1[8]
    category_sku = str(row[8])
    if category_sku == sku:
        classifications["Craft"] = row[0]
        classifications["Theme"] = row[1]

I get:

    Knitting
    391
    Traceback (most recent call last):
      File "upload_all_inventory_ebay.py", line 403, in <module>
        inventory_item_list = get_item_list(product)
      File "upload_all_inventory_ebay.py", line 294, in get_item_list
        category_sku = str(row[8])
    NameError: global name 'row' is not defined

Where Knitting and 391 are exactly right, of course I need to refer to row[8] as row1[8]…k so I do this:

    csvReader1 = csv.reader(file('new_categories.csv', "rU"), delimiter=',')
    for row1 in csvReader1:
        print row1[0]
        print row1[8]
        category_sku = str(row1[8])
        if category_sku == sku:
            classifications["Craft"] = row1[0]
            classifications["Theme"] = row1[1]

And I get this:

...........
Crochet
107452
Knitting
107454
Knitting
107455
Knitting
107456
Knitting
107457
Crochet
108200
Crochet
108201
Crochet
108205
Crochet
108213
Crochet
108214
Crochet
108217

108432
Quilt
108451

108482

108488
Scrapbooking
108711
Knitting
122363
Needlework

Beading

Crafts & Decorating

Crochet

Crochet

Crochet

Traceback (most recent call last):
  File "upload_all_inventory_ebay.py", line 403, in <module>
    inventory_item_list = get_item_list(product)
  File "upload_all_inventory_ebay.py", line 292, in get_item_list
    print row1[0]
IndexError: list index out of range

Where the output you see there is every effing thing in column 0 and column 1 !!!!!!!!!! Why? And WHY is row1[0] out of range if it wasn’t before. YAY Fridays!

  • 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-05-14T23:19:48+00:00Added an answer on May 14, 2026 at 11:19 pm

    The output contains results from every row because you are printing the 1st and 9th columns for every row.

    row1[0] is out of range for whatever row that is because there aren’t any items on that particular line of the file. You can’t access the first item in row1 if row1 doesn’t have any items to access. Check row1 on each loop to see if it has anything in it.

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

Sidebar

Ask A Question

Stats

  • Questions 415k
  • Answers 415k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I would use an generic List(of ZipFile) for this. They… May 15, 2026 at 8:57 am
  • Editorial Team
    Editorial Team added an answer It seems that the delegate selection is much more intelligent… May 15, 2026 at 8:57 am
  • Editorial Team
    Editorial Team added an answer Windows time stamps are always recorded in UTC. They will… May 15, 2026 at 8:57 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.