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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:05:00+00:00 2026-06-10T15:05:00+00:00

So I have a function from GDATA API (gdata.sample_util.authorize_client(client, service=client.auth_service, source=client.source, scopes=client.auth_scopes)) which uses

  • 0

So I have a function from GDATA API (gdata.sample_util.authorize_client(client, service=client.auth_service, source=client.source, scopes=client.auth_scopes)) which uses command line to receive arguments. How can I automate that so I can hard-code arguments?

  • 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-10T15:05:02+00:00Added an answer on June 10, 2026 at 3:05 pm

    Do you mean by hard-code arguments, arguments that you do not have to write everytime you call the function, or open the program from the command line? These are called Default Arguments. Check this out:

    http://docs.python.org/release/1.5.1p1/tut/defaultArgs.html

    Example:

    def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
        while 1:
            ok = raw_input(prompt)
            if ok in ('y', 'ye', 'yes'): return 1
            if ok in ('n', 'no', 'nop', 'nope'): return 0
            retries = retries - 1
            if retries < 0: raise IOError, 'refusenik user'
            print complaint
    

    So you can actually call this function in different ways:

    ask_ok('Do you really want to quit?')

    or like this:

    ask_ok('OK to overwrite the file?', 2)
    

    Good luck!

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

Sidebar

Related Questions

I have a javascript function from which I need to call a controller action
In my Java code I have function that gets file from the client in
I have a function from an external source that returns an array of 2
I have a function from django-registration which re-sends an activation email to the given
I have a function from which I would like to return a value as
I have a function from an external lib which takes the following camera parameters:
I have the following function (from the opensource project recast navigation ): /// Derives
I have the following function call from a thread: Thread Move = new Thread(){
I have function LoadTempMovieList(), and need to load movies from sessionStorage. But it seems
I'm calling a function from an input radio button and have this: onClick=\changeBilling('.$results['id'].', this.value)\

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.