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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:26:06+00:00 2026-06-17T08:26:06+00:00

I’m have an issue about displaying the files from a network drive on Windows.

  • 0

I’m have an issue about displaying the files from a network drive on Windows.

path = "\\\\nexus\\File Server\\Technical\\MyDrive\\Software\\Releases\\%s\\%s\\" %(release, module)

where \\nexus\ is a network drive.

My main issue is given that a user enters correct variables, i’m unable to show the contents of the directory requested (the contents of ‘module’).

Things I’ve tried

  1. os.listdir(path)
    The issue with the line above is that it returns a windows error [123] which is, a can not find directory error. This is because listdir() seems to double all the back slashes
    resulting in :

     "\\\\\\\\nexus\\File Server\\\\Technical\\\\MyDrive\\\\Software\\\\Releases\\\\release\\\\module\\\\"
    
  2. print(glob.glob(path))
    I didn’t really know exactly how it works 😛 but it seems just to display the directory supplied and not the contents of the ending directory

      \\nexus\File Server\Technical\MyDrive\Software\Releases\release\module\"
    

I’ve seen an os.walk however im not sure how its works, in that how does it defines what is the base directory /directories and what is the rest of the path

Extra notes: The contents of ‘module’ will always be a zip file, also the directory will generally contain at maximum five zip files.

  • 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-17T08:26:06+00:00Added an answer on June 17, 2026 at 8:26 am

    Just tested on my XP PC, Python 2.7, SMB share \\myshare

    os.listdir('\\\\myshare') # Fails with "WindowsError: [Error 53] The network path was not found"
    
    os.listdir('\\\\myshare/folder') # Succeeds
    

    I think some of the confusion could be caused by WindowsError showing the repr() of the path, rather than the actual path –

    >>> repr(path)
    "'\\\\myshare'"
    >>> str(path)
    '\\myshare'
    

    If this is a Python 3 & unicode problem, I suggest trying to fix the string first:

    path = "\\\\myshare\folder"
    path = bytes(path, "utf-8").decode("unicode_escape")
    print os.listdir(path)
    

    (unfortunately I can’t test this since I don’t have Python 3 installed, but please let me know if it works and I’ll edit my answer)

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

Sidebar

Related Questions

I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
I have a text area in my form which accepts all possible characters from
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I have thousands of HTML files to process using Groovy/Java and I need to
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a reasonable size flat file database of text documents mostly saved in
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't

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.