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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:37:53+00:00 2026-05-26T15:37:53+00:00

I am printing environment variables, but there are not printed in a sorted way

  • 0

I am printing environment variables, but there are not printed in a sorted way :

    for variable in os.environ:
        print("   " + variable + "=" + os.environ.get(variable))

I would like to sort os.environ. I tried to put os.environ in a list(), but the sort function is not working.

Any clue?

Thank you

  • 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-26T15:37:54+00:00Added an answer on May 26, 2026 at 3:37 pm
    for name, value in sorted(os.environ.items()):
        print("   " + name + "=" + value)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an environment variable pointing to the WiX bin directory path? I want
I am building a website and would not like to reconfigure the website from
Printing button is not shown in the report toolbar when they are opened in
When printing RFC documents on my A4 format printer I noticed that I print
I'm developing printing solution for MS Office 2007. Office automation is not right for
I know about the %USERPROFILE% system defined environment variable on Windows XP (and Vista
When I try to run my ASP.NET app from my development environment I get
I'm comfortable with determining connection strings by environmental variable in general, but the connection
Basically I'd like to use the NUnit plugin for TeamCity (the program, not necessarily
I have Installshiled script which define CATALINA_HOME as environment Variable initially. same script after

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.