BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup

Join the forum, it's quick and easy

BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks
Would you like to react to this message? Create an account in a few clicks or log in to continue.
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Latest topics
» Dropped Out of College to Pursue Web Dev and Life Pursuits in General
Python - List All Files In Directory By Extension Empty4/7/2024, 2:34 pm by SnB@BWH

» Bully Made It Into a BIG Video 400K Views
Python - List All Files In Directory By Extension Empty4/7/2024, 6:58 am by Bully@WiiPlaza

» Wii Play Tanks
Python - List All Files In Directory By Extension Empty3/24/2024, 2:46 pm by helpmeout

» [Bypass Paywalls] (Global) @magnolia1234 - GitLab
Python - List All Files In Directory By Extension Empty3/18/2024, 3:55 am by Seth@WiiPlaza

» [Download] Mary Shelley's Frankenhole
Python - List All Files In Directory By Extension Empty3/16/2024, 8:29 am by Seth@WiiPlaza

» Completely Custom Modded Controllers (Undetectable)
Python - List All Files In Directory By Extension Empty3/5/2024, 1:55 pm by Shadow@BWH

» (Zombies) Drink perks code?
Python - List All Files In Directory By Extension Empty3/5/2024, 1:24 pm by Shadow@BWH

» Die Rückkehr zu STEAM und WARFACE
Python - List All Files In Directory By Extension Empty3/2/2024, 3:54 am by Seth@WiiPlaza

» First person hand model change?
Python - List All Files In Directory By Extension Empty2/28/2024, 4:53 am by Ad3lamac611

» {RELEASE} Field Raider Firefox v1.72 by Seth@WiiPlaza
Python - List All Files In Directory By Extension Empty2/21/2024, 8:52 am by naxil

Search
 
 

Display results as :
 


Rechercher Advanced Search

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar

Country Statistics
Free counters!

You are not connected. Please login or register

Python - List All Files In Directory By Extension

2 posters

Go down  Message [Page 1 of 1]

SnB@BWH

SnB@BWH
Admin & Writer

Python - List All Files In Directory By Extension Screen19

Code:
import os


y = input("Enter a filepath: ")
x = input("Enter file extension: ")

for f in os.listdir(y):
    if f.endswith(x):
        print(f)



Last edited by SnB@BWH on 8/22/2019, 1:45 am; edited 1 time in total

Bully@WiiPlaza

Bully@WiiPlaza
 
 

It's actually better to post code as text so it can be copied but nice job Smile

SnB@BWH

SnB@BWH
Admin & Writer

I was thinking it would be better for people to write it out by hand, so they get the feel for it, but I will post as text from now on, but include picture as well for syntax reference. And thanks! Smile I'm catching onto Python quite a bit. It's a language that is simple, vastly featured with libraries, and incredible amount of documentation and support. It's a language I am happy to be learning.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum