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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:02:17+00:00 2026-05-28T15:02:17+00:00

I am analyzing the repo script from Google (instructions at http://source.android.com/source/downloading.html ) The repo

  • 0

I am analyzing the repo script from Google (instructions at http://source.android.com/source/downloading.html)

The repo script is written in Python. There is a part in there that says:

if sys.argv[-1] =='#%s' % magic

Can somebody explain semantically what that line means? I am a bit rusty on my Python. The entire block of code for this is:

magic='--calling-python-from-/bin/sh--'
"""exec" python -E "$0" "$@" """#$magic"
if __name__ == '__main__':
    import sys
    if sys.argv[-1] =='#%s' % magic:
        del sys.argv[-1]
  • 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-28T15:02:20+00:00Added an answer on May 28, 2026 at 3:02 pm

    One piece at the time:

    • sys.argv holds the list of command line arguments passed to a Python script. Meaning that sys-argv[-1] is the last argument.
    • '#%s' % magic. The % formats your string, which means the where you see %s there’s going to be the value of magic (if magic is not a string it will be converted: str(magic)). In your code that string is going to be: '#--calling-python-from-/bin/sh--'.
    • del sys.argv[-1]. This is self-explainatory: means that the last value of the list sys.argv is going to be removed.

    All together it means that: if the last command line argument is #--calling-python-from-/bin/sh-- that argument is going to be removed from sys.argv.

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

Sidebar

Related Questions

Is there any HTML code analyzing tool that suggests tips to improve the HTML
Is there an Android-native API which would help me analyzing raw PCM data? (Just
Are there any algorithms available for analyzing the complexity of an image? Basically I'm
I've written a custom task for analyzing code coverage results. While building the entire
I am analyzing someone else's PHP code and I've noticed that the input HTML
I'm analyzing a code from the website and I tried it on my side
I'm analyzing music mp3 files. What I'm doing is extracting the audio data from
Analyzing the location.hash with this simple javascript code: <script type="text/javascript">alert(location.hash);</script> I have a difficult
I'm analyzing some Python code and I don't know what pop = population[:] means.
I am analyzing a problem from an old asp.net site made by one of

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.