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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:47:58+00:00 2026-06-15T11:47:58+00:00

My code to access command line argument: length = len(sys.argv) print length str =

  • 0

My code to access command line argument:

length = len(sys.argv)
print length
str = sys.arvg[0]
print str

gives output :

triongle@triongle.com [~/download/DataInsertionScript]# python IngestDataToMongo.py python_sucks
2
Traceback (most recent call last):
File "IngestDataToMongo.py", line 83, in <module>
str = sys.arvg[0]
AttributeError: 'module' object has no attribute 'arvg'

So, first time len(sys.argv) works but strangely next time gives error on sys.argv[0]. So why is it?

  • 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-15T11:47:59+00:00Added an answer on June 15, 2026 at 11:47 am

    You have written sys.arvg[0] instead of sys.argv[0]. Also be sure to import the sys module, because argv by default belongs to that namespace.

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

Sidebar

Related Questions

Could anyone give me example code to access the command line through VBScript? I
I'm trying this code to access a property but it gives me an error:
I'm writing some code that uses dynamic shared libraries as plugins. My command line
I'm trying to access the command line and execute a command, and then return
I have a load of C# code that runs aspnet_regiis from the command line
I am using some third party code which when given a '-classpath' command line
I have some java code that work on the command line, and need to
I've been trying to use an ffmpeg binary with command line access for a
here's my issue: I have a program in the command line that has access
In our Struts2-Spring application we are using the follwoing lines of code access the

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.