preflex
Posts: 6
Joined: Sun May 05, 2013 6:38 pm

[SOLVED] Backporting from 3.4

Thu Mar 19, 2015 4:21 pm

Hi. I'm a bit of a python newbie here.

I started a new project recently using python 3.4. I would like to be able to run it on any Python 3.x, so that It will be able to run on Wheezy.

The only offending import that keeps me from being able to run on wheezy is Pathlib. How can I best change my path handling in a cross-platform way, so that it will work on Wheezy or Windows? Should I be using os.path?

One of the offending scripts is here:
https://github.com/Preflex/Clonebay/blo ... kLoader.py

Thanks!
Last edited by preflex on Thu Mar 19, 2015 7:46 pm, edited 1 time in total.

plugwash
Forum Moderator
Forum Moderator
Posts: 3614
Joined: Wed Dec 28, 2011 11:45 pm

Re: Backporting from 3.4

Thu Mar 19, 2015 4:29 pm

preflex wrote: Should I be using os.path?
I would think so but i'm not a python expert.

DirkS
Posts: 10362
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Backporting from 3.4

Thu Mar 19, 2015 6:03 pm


User avatar
paddyg
Posts: 2541
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Backporting from 3.4

Thu Mar 19, 2015 6:16 pm

os.walk seems quite reliable (unbelievable how much scrambling needs to undone for list of files and directories prepared on a mac!)
https://github.com/pi3d/pi3d_demos/blob ... ame.py#L52
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

preflex
Posts: 6
Joined: Sun May 05, 2013 6:38 pm

Re: Backporting from 3.4

Thu Mar 19, 2015 7:08 pm

Awesome! Thanks! It's a drop-in replacement!

Return to “Python”