backwards

How to see if code is backwards compatible for Python?

Okay basically i have some code that i am trying to make it play nicely with ESRI's geoprocessor. However ESRI's geoprocessor runs on Python 2.2, 2.3, 2.4, 2.5. We need to make our tools work on any version. So I've spent a lot of time working and coding workarounds for different versions, such that the wrapper geoprocessor has identical...

In Java, howd do I iterate through lines in a textfile from back to front

Basically I need to take a text file such as : Fred Bernie Henry and be able to read them from the file in the order of Henry Bernie Fred The actual file I'm reading from is >30MB and it would be a less than perfect solution to read the whole file, split it into an array, reverse the array and then go from there. It ...

efficiently list items in tuples starting at end

I'd like to list the items in a tuple in Python starting with the back and go to front. Similar to: foo_t = tuple(int(f) for f in foo) print foo, foo_t[len(foo_t)-1] ... I believe this should be possible without Try ...-4, except ...-3. Thoughts? suggestions? ...

Linux command line script to renumber files backward

I have JPG files numbered 3006-3057 that I would like to reverse number. I would be content renaming them by adding a backwards number count to the beginning of the name: img_3006.jpg > 99_img_3006.jpg and img_3057.jpg > 48_img_3057.jpg. ...

How to determine the amount of entries an array has?

I'm trying to loop through an array backwards, so I figured I could try $Array = Array("One", "Two", "Three", "Four", "Five"); For ($Entry = Amount_of_values($Array); $Entry = 0; $Entry = $Entry-1){ Echo $Array[$Entry] . " "; //Should be Five Four Three Two One } but I have no idea how to retrieve the amount of values in an array ...