Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

How to list existing files on the URL of a Github repository?

$
0
0

@Luc wrote:

I tried this but it doesn’t work. Any help is welcomed. Thanks a lot.

import os
import pathlib

pathdirectory = pathlib.Path('https://github.com/thegithub/therepository')

def list_files():
    files = []
    for filename in os.listdir(pathdirectory):
        path = os.path.join(pathdirectory, filename)
        if os.path.isfile(path):
            files.append(filename)
    return files

found = list_files()

OSError: [WinError 123] the file name, directory name or volume lable syntax is ncorrect

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles