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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:03:49+00:00 2026-06-04T14:03:49+00:00

File F:\ake\pa\th\help.py, line 268, in main print type(outputs[x]) KeyError: ‘0’ My file is quite

  • 0
File "F:\ake\pa\th\help.py", line 268, in main
print type(outputs[x])
KeyError: '0'

My file is quite large, so these are the places outputs is seen, in order of how they should be executed:

outputs={}

#now in another function
global another_var,outputs

#if malarkey...
elif lines[row][col]=="0":
    outputs["0"]=str(state) #state is either 0 or 1

#back in original function
global outputs

for x in nums:
    print outputs[x], #line 268

I really am not sure why I am getting the error above.

  • 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-04T14:03:50+00:00Added an answer on June 4, 2026 at 2:03 pm

    It is difficult to tell without minimal code to try to run, but the most likely thing is that your elif lines[row][col] == "0": isn’t triggering when you expect it to. Print something when you reach there to make sure it is.

    Also, do print outputs immediately before the error (or, catch the error and print it then) to see exactly what is in it. Between those two things, you should see something different to what you’re imagining is going on.

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

Sidebar

Related Questions

File main.py, line 52, in <module> r2n(name) File C:\Users\Riki\Documents\Universita\Erasmus\Personalization and Metadata modeling 02817\Final Project\friends_followers__redis_to_networkx.py,
File 1: asdffdsa File 2: asdfjklfdsaHGUik How do I read these binary files with
file.each_line do |line| #skip the first one/not a user 3.times { next } if
File.open(path, 'r').each do |line| row = line.chomp.split('\t') puts #{row[0]} end path is the path
File C:\Users\Tom\Desktop\Tetris!\tetris.py, line 206, in typeSet Globals.blockArray[i].x.append(7) IndexError: list index out of range I
/* * File: main.cpp * Author: c1004527 * * Created on February 15, 2012,
File structure: Code : <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Metnik EL Logo</title> </head>
file location is: yiiroot/framework/widjets/assets/gridview/jquery.yiigridview.js I need to change one line in this file so
File /usr/local/lib/python2.5/site-packages/libxml2.py, line 1, in <module> import libxml2mod ImportError: /usr/local/lib/python2.5/site-packages/libxml2mod.so: undefined symbol:xmlTextReaderSetup >>> import
File /srv/xxxx/venv/lib/python2.6/site-packages/django/core/files/storage.py, line 193, in delete os.remove(name) OSError: [Errno 13] Permission denied: '/srv/notxxxelinq/app/xxx/site_media/xx/xxx/20101217T194905.document.pdf' I've

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.