Message78339
| Author |
ncoghlan |
| Recipients |
ncoghlan, skip.montanaro |
| Date |
2008年12月27日.04:24:11 |
| SpamBayes Score |
0.003997797 |
| Marked as misclassified |
No |
| Message-id |
<1230351852.39.0.694414055794.issue4755@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
A new function sounds like a good solution to me. How about just calling
it "os.path.commonpath" though?
I agree having a path component based prefix function in os.path is
highly desirable, particularly since the addition of relpath in 2.6:
base_dir = os.path.commonpath(paths)
rel_paths = [os.path.relpath(p, base_dir) for p in paths] |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2008年12月27日 04:24:12 | ncoghlan | set | recipients:
+ ncoghlan, skip.montanaro |
| 2008年12月27日 04:24:12 | ncoghlan | set | messageid: <1230351852.39.0.694414055794.issue4755@psf.upfronthosting.co.za> |
| 2008年12月27日 04:24:11 | ncoghlan | link | issue4755 messages |
| 2008年12月27日 04:24:11 | ncoghlan | create |
|