Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.04; 'paths': 0.07; 'scripts': 0.09; 'content-type:multipart/signed': 0.09; 'filename:fname piece:signature': 0.09; 'url:packages': 0.09; 'api': 0.11; 'server,': 0.12; 'subject:file': 0.13; 'wed,': 0.13; 'wrote:': 0.15; 'library': 0.15; 'archive,': 0.16; 'content- type:application/pgp-signature': 0.16; 'filename:fname piece:asc': 0.16; 'filename:fname:signature.asc': 0.16; 'module:': 0.16; 'stdlib.': 0.16; 'cc:addr:python-list': 0.16; 'looked': 0.16; 'linux': 0.18; 'received:internal': 0.19; 'ryan': 0.19; 'cheers,': 0.19; 'cc:2**0': 0.21; 'linux,': 0.22; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'received:10.202': 0.23; 'received:10.202.2': 0.23; 'received:66.111': 0.23; 'received:66.111.4': 0.23; 'received:messagingengine.com': 0.23; 'received:smtp.messagingengine.com': 0.23; 'modules': 0.25; 'remote': 0.28; "didn't": 0.29; 'cc:addr:python.org': 0.30; 'student': 0.30; 'kelly': 0.30; 'thanks': 0.30; '(including': 0.30; 'url:au': 0.31; 'there': 0.34; 'question': 0.35; 'url:python': 0.36; 'python.org': 0.36; 'disk': 0.37; 'platforms': 0.37; 'but': 0.37; 'some': 0.37; 'using': 0.38; 'received:192': 0.38; 'could': 0.38; 'url:org': 0.38; 'user': 0.38; 'subject:: ': 0.38; 'case,': 0.38; 'platform': 0.38; 'header:Mime-Version:1': 0.39; 'files,': 0.39; 'would': 0.40; 'more': 0.60; 'your': 0.61; 'details': 0.65; 'zip': 0.65; 'ever': 0.65; 'making': 0.66; 'memory,': 0.67; 'visit': 0.68; 'intend': 0.73; 'to:addr:yahoo.com': 0.83; '10:44': 0.84; 'url:fs': 0.84; 'immediately,': 0.91 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version; s=smtpout; bh=FiC1r2t2qK/Kir7CRRRZSoIjul0=; b=fpev2+gaac0rt7ztQnlswXDGFyNz0oXWWOQeqExHVWOdbZCHB7psr2NzFB7fcIh/tSXOVmbNrS/D2je3ofgiT3v5uswy5T5muS2R9Y0uPj5Q210UD8zoHOYpSYFO7F3BUegqreQ6bD9ir5lC3XKNm8vh8pHb/uUjN6fVxkp/lG0= X-Sasl-enc: F1J/PzxdcTM7nd3vo1W2MZGqNqZHIFVhHPkv36MJ25pP 1308869694 Subject: Re: doing cross platform file work From: Ryan Kelly To: Tim Hanson In-Reply-To: <201106221044.57169.tjhanson@yahoo.com> References: <201106221044.57169.tjhanson@yahoo.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-5DxiPQhf9sl5UFFYOfkZ" Date: Fri, 24 Jun 2011 08:54:45 +1000 Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 63 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308869704 news.xs4all.nl 14148 [::ffff:82.94.164.166]:36769 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8335 --=-5DxiPQhf9sl5UFFYOfkZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2011-06-22 at 10:44 -0700, Tim Hanson wrote: > Thanks for your responses to my student question about using OS paths in= =20 > Python. >=20 > For the more general case, I am a Linux user interested in making my scri= pts=20 > platform neutral, which would include Linux, Unix (including Mac), and= =20 > Windows. I have looked at the python.org os segment and didn't get an an= swer. >=20 > Is there a library (bonus would be some tutorial material) for making sur= e my=20 > Linux scripts access files and directories on the other platforms=20 > transparently? I don't need the information immediately, but at some poi= nt... You could go all out and use the PyFilesystem module: http://packages.python.org/fs/ This provides a unified API not only for accessing files on your local disk in a platform-agnostic manner, but also for accessing files in a zip archive, on a remote server, in memory, and from a variety of other sources. Even if you only ever intend to access local files, I find the API provided by PyFilesystem much nicer than using the various modules from the stdlib. Cheers, Ryan --=20 Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit ryan@rfk.id.au | http://www.rfk.id.au/ramblings/gpg/ for details --=-5DxiPQhf9sl5UFFYOfkZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk4DxDEACgkQfI5S64uP50qySACgyrRARfQOMldR9M5V9bpu2SvG 57IAoICdx5FY8trpkiXaM4QRlcRSpmbW =xCAv -----END PGP SIGNATURE----- --=-5DxiPQhf9sl5UFFYOfkZ--