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

  • Home
  • SEARCH
  • 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 6212717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:34:03+00:00 2026-05-24T06:34:03+00:00

They are same, but which one should I use? http://docs.python.org/library/os.html : os.sep The character

  • 0

They are same, but which one should I use?

http://docs.python.org/library/os.html:

os.sep

The character used by the operating system to separate pathname components. This is ‘/’ for POSIX and ‘\’ for Windows. Note that knowing this is not sufficient to be able to parse or concatenate pathnames — use os.path.split() and os.path.join() — but it is occasionally useful. Also available via os.path.

  • 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-24T06:34:04+00:00Added an answer on May 24, 2026 at 6:34 am

    I’d use os.path.sep to make it very clear that it’s the path separator… But consistency is more important, so if one is already being used, use that. Otherwise, pick one and use it all the time.

    Edit: Just to make sure you’re not reinventing the wheel, though, the path module already has join, split, dirname, and basename functions… So you should rarely need to use os.sep:

    >>> os.path.join("foo", "bar", "baz")
    'foo/bar/baz'
    >>> os.path.split(_)
    ('foo/bar', 'baz')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I always thought they were about the same thing but someone pointed me out
This is the same question for older version of Scala, but they say that
i recently asked question which was closed down linked here. https://stackoverflow.com/questions/3827349/how-to-use-one-openid-across-multiple-domains-closed I did not
...or are they the same thing? I notice that each has its own Wikipedia
What the title says. Are they the same? I've noticed that the first does
What's the difference between mesh and geometry? Aren't they the same? i.e. collection of
I have heard both of these terms used, are they the same thing or
As we know two Set instances are equal iff they contain the same elements
I have two different grid controls on the same form. They share the same
What is the difference? They all are business management solutions. They do the same?

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.