Python Forum
First post and looking for help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
First post and looking for help
#1
Hi all

My first post here (complete novice) Smile

I have no python experience but wonder if it will be a good choice for what I would like to create?
I've only really done HTML and CSS but that was a few years ago.

To get my head into coding I want to create a simple tool to help server admins for a game I play.

The game is Unreal Tournament 99. When adding new maps to a server, you have to place the different file types in different folders. Not a big problem if you adding one or two maps but can be time consuming if wanting to add lots of maps in one go. What I would like to try and create is a script or a tool that does the following:

The server admin manually creates the following folders inside a folder on their desktop:

Maps
Textures
Sounds
Music
System

In that top level folder that contains these subfolders, they unzip all of the new maps/content they want to upload to their server. So now you will have loads of files and those manually created folders.

FYI:

Maps have a .unr extension
Music have a .umx extension
Sounds have a .uax extension
Textures have a .utx extension
System have a .u extension

The server admin then runs the script/tool that moves all of the files into the correct folder.

Any other files would simply be left in the top directory (readme text files etc). Perhaps the script/tool could create those subfolders as well before then moving in the respective files?

I hope this makes sense? Seems a simple thing to create and I think it could help me understand a few things about coding.

Could Python do something like this for me? Or should I consider another language?

I'm not looking for anyone to do it for me - no point as I won't learn.

Just want to understand if Python is a good choice to accomplish this plus any tips you can give me with where to start?

Many thanks and warm greetings. Cool
Reply
#2
Python is one language to do that. Another way is to use some bash scripting.
Both will do what you want pretty well.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
Hello and welcome to Python and the Forums!
Python is very well suited for what you are attemping to achieve.
For navigating and manipulating files & directories take a look at Python's "os" and "pathlib" builtin modules. Though I haven't used "zipfile" module yet, I believe it will handle the (un)zipping your program needs.
Feel free to start a thread if you need help, advice, hit an error etc.

As @wavic suggested, Bash is a good choice if this will be your one-off attempt at coding. But if your plan is also to learn a general purpose programming language along the way, then it is a great starter project to dive into Python :)
Reply
#4
Thank you for the very speedy and helpful replies.
I think I will stick with Python as it is something I want to learn more :)

I'll do some research and make a start.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020