I have a string which I split in a list on spaces, one of the items in the list is for example, this: "/home/hoeter/PycharmProjects/Renpy/window.py"
The end result I want is to make it come out like this:
window.py="/home/hoeter/PycharmProjects/Renpy/window.py"
In Javascript I would do something like:
var string = "/home/hoeter/PycharmProjects/Renpy/window.py";
for (var i = string.length; i>1; i--)
{
if(string.charAt(i) === "/")
{
temp = string.substring(i+1, string.length);
string = temp + "=" + '"' + string + '"';
console.log(string);
i = 0;
}
}
>>> window.py="/home/hoeter/PycharmProjects/Renpy/window.py"
But for loops don't work this way in Python, I've seen some for loops with enemurate but I don't understand how I can implement that with what I want.
In the end I want to go through the entire list with for split in splits and concatenate the results into one string
for i in range(len(str)-1,1,-1):window.py=...Do you have an object namedwindowwith an attributepy? I'm not sure I understand.