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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:02:14+00:00 2026-06-04T23:02:14+00:00

I made a simple python script to post data on a website. #Imports url_to_short

  • 0

I made a simple python script to post data on a website.

#Imports

url_to_short = sys.argv[1]

post_url = 'https://www.googleapis.com/urlshortener/v1/url'
headers = {'Content-Type': 'application/json'}

data = {'longUrl': url_to_short}
post_data = json.dumps(data)

req = urllib2.Request(post_url, post_data, headers)
resp = urllib2.urlopen(req)

if resp.getcode() == 200:  
    content = json.loads(resp.read())

#Other stuff

Now I thought lets check my script for coding standards with pylint tool.

My pylint output is as follows:

************* Module post
C:  1,0: Missing docstring
C:  6,0: Invalid name "url_to_short" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C:  8,0: Invalid name "post_url" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C:  9,0: Invalid name "headers" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)

# Other stuff

Now, my question is why pylint is showing my variable names as Invalid name. Is naming variable this way a wrong coding convention.

My complete pylint output.

  • 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-04T23:02:16+00:00Added an answer on June 4, 2026 at 11:02 pm

    As your code is not contained in a class or function it is expecting those variables to be constants and as such they should be uppercase.

    You can read PEP8 for further information.

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

Sidebar

Related Questions

I made simple python program to generate big text file: import sys import random
I've made myself a simple event system in python, and I found that the
This module is part of a simple todo app I made with Python... def
I made a simple jquery script to sort content of the page on clicking
I made this simple function to filter the data. I add the symbols that
So, I made a simple socket server using python. And now I'm trying to
I have a simple question about Python: I have another Python script listening on
I've made two versions of a script that submits a (https) web page form
I have made a simple server -client code in python socket programming. Client side
I have a simple python script that just takes in a filename, and spits

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.