Giter VIP home page Giter VIP logo

rpg-game---under-construction-'s Introduction

Hey! Thanks for checking out my github page.
Check out my website for more info about me.

rpg-game---under-construction-'s People

Contributors

noah6544 avatar

Watchers

 avatar

rpg-game---under-construction-'s Issues

Check if file gets added to directory and rename it.

TLDR: I need an infinite loop under the ( testing_files.py. ) cleanup_directory() function and currently the code works like this:
it declares some variables, creates a variable called old_files (that is the data from os.listdir) gets turned into a tuple so that it can hopefully
be referenced against if a new file gets added into said directory.
If someone sees this don't feel obligated to help, really. it might be better if you dont. I'm probably gonna solve this
tommorow which might teach me a thing or two, so...... maybe some tips

im going to bed for the night, and if someone sees this and cares to help me with a problem that would be appreciated.
the problem I'm having is under testing_files.py.
I'm trying to create an infinite loop that will rename all files to a specific name with a number at the end.
There's a main problem and a little side issue
problem 1. the loop doesn't seem to be working. it will rename the files but won't detect when new files are added.
problem 2. When going to rename the file, it would be ideal to keep...I don't remember. I checked the code and don't remember the problem.
I noticed that this repo had been cloned a few time and I don't know who would want that...maybe they were looking for an actual game...sorry
anyways.

sorry there are so many comments, those were past thougths that probabllye never got flesed out or were just paused so that I
could test run.
I need to write these things down my head is so cloudy.
i have a few more ideas that might work or maybe it will come to me in a dream....

`def cleanup_directory(file_directory, file_name_input):
count2 = 0
renamed = []
old_rename = []
old_files = (os.listdir(file_directory))
old_files = tuple(old_files)
num_of_old_files = len(os.listdir(file_directory))
timecount = 0
new_file_check = False
while True:
for file in os.listdir(file_directory):
#cleaned_file = open(cleaned_file)
src = file_directory + file
dst = file_directory + file_name_input + "_" + str(count2) + file
#split_file_name = os.listdir(file_directory)
#split_file_name = str(split_file_name)
#split_file_name = split_file_name.split(".")
#print(type(split_file_name))
count2 += 1
print(num_of_old_files)
if num_of_old_files >= count2:

            print("passed first if statement")
            os.rename(src, dst)
            if file in old_rename:
                print("passed second if statement")
                pass
            elif file not in old_files:
                os.rename(src, dst)
        else:
            os.listdir(file_directory)
            timecount += 1
            if timecount >= 3:
                time.sleep(5)
                print("sleeping")
                #while new_file_check == False:
                   # if file
                 #   if num_of_old_files

`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.