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

  • Home
  • SEARCH
  • 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 6548353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:56:26+00:00 2026-05-25T11:56:26+00:00

I am trying execute my Python script as: python series.py supernatural 4 6 Supernatural

  • 0

I am trying execute my Python script as:

python series.py supernatural 4 6
Supernatural : TV Series name 
4 : season number
6 : episode number

Now in my script I am using the above three arguments to fetch the title of the episode:

import tvrage.api
import sys

a =  sys.argv[1] 
b = sys.argv[2]
c =  sys.argv[3]

temp = tvrage.api.Show(a)
name  = temp.season(b).episode(c)  # Line:19
print ( name.title)

But I am getting this error:

File "series.py", line 19, in <module>:
  name = super.season(b).episode(c) 
File "C:\Python26\Lib\site-packages\tvrage\api.py", line 212, in season
  return self.episodes[n] KeyError: '4'

I am using Python 2.6.

  • 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-25T11:56:26+00:00Added an answer on May 25, 2026 at 11:56 am

    The Python TVRage API is expecting integers, not strings (which is what you get from argv):

    name = temp.season(int(b)).episode(int(c))
    

    will correct the error, if season 4 episode 6 exists.

    You should take a look at the command line parsing modules that come with Python. For 3.2 / 2.7 or newer, use argparse. For older versions, use optparse. If you already know C’s getopt, use getopt.

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

Sidebar

Related Questions

I'm trying to execute a python script (through a python process) under another user.
How can execute sql script stored in *.sql file using MySQLdb python driver. I
I'm trying to execute a asp.net webservice using jquery. When I pass only one
I have a python script I am trying to debug in eclipse. I can
I'm trying to write a python script that does the following from within a
I'm trying to create a database connection in a python script to my DB2
I'm trying to build a Python application using pyGTK, treads, and sockets. I'm having
I'm trying to build a C++ extension for python using swig. I've followed the
I'm coding a Python script which is using the application pdftk a few times
I'm trying to execute a few python scripts in order to manipulate some images

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.