Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.050 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'anyway.': 0.05; 'string.': 0.05; 'subject:How': 0.10; 'api': 0.11; 'windows': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'proportion': 0.16; 'stuff.': 0.16; 'usenet': 0.16; 'valid.': 0.16; 'subject:python': 0.16; 'thursday,': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'meant': 0.20; '>>>': 0.22; 'directory.': 0.24; 'url:moin': 0.24; 'post': 0.26; 'gets': 0.27; 'header:In-Reply- To:1': 0.27; 'chris': 0.29; 'url:bugs': 0.29; 'subject:) ': 0.29; 'forgot': 0.30; 'returned': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:wiki': 0.31; '>>>>': 0.31; 'font': 0.31; 'there.': 0.32; 'stuff': 0.32; 'another': 0.32; 'url:python': 0.33; 'fri,': 0.33; 'subject:the': 0.34; 'something': 0.35; 'no,': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'add': 0.35; 'there': 0.35; 'really': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'wrong': 0.37; 'christian': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; '12,': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'how': 0.40; 'read': 0.60; 'skip:o 30': 0.61; 'july': 0.63; 'different': 0.65; '8bit%:43': 0.74; 'jul': 0.74; 'subject:get': 0.81; 'proves': 0.84; 'skip:\xef 10': 0.84; 'subject:Platform': 0.84; 'vista,': 0.84; 'was...': 0.84; 'sent,': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=o2T12IUi5KZER232PID8sZ1VEgXug6owRikHLUkZ/Xc=; b=wE+9wlmXoETVBKdguL9ODBxa+nOZIOLAHnPwNShF7GgxwFRRn3Ly63qw6hsBnnmns0 yYEHY1y7kaj1BYXqDX7ERNx8/kz5k7yVQo25TY2sIyGA/9zUMPUd/GFypW5x+tQTnYT2 0M+j73t+o+YA4fi0p4UFp+IFF6tzoV07sLcb9V7U/By36jB+BUQCC0MQaRNOktiWUFO8 r58qVyOSoHm/bCTghLjEEeuBkcPCddcu/XJ9bRr9/dI3ggypNiXNCGvs8LpaJyPvcIRk dw9zFXjYqWvtSLWd/Mrd0sqP3liUepLCFhDCMxf3yxfUjyM7FTwWpLvRBYFqY08gIjAt vzOA== MIME-Version: 1.0 X-Received: by 10.220.128.72 with SMTP id j8mr23485640vcs.3.1373605129543; Thu, 11 Jul 2013 21:58:49 -0700 (PDT) In-Reply-To: <9218c1f3-f107-4942-90d6-26c017f1e4e7@googlegroups.com> References: <3d97de86-f690-40ad-aba8-972120af7ff3@googlegroups.com> <9218c1f3-f107-4942-90d6-26c017f1e4e7@googlegroups.com> Date: Fri, 12 Jul 2013 14:58:49 +1000 Subject: Re: How do I get the OS System Font Directory(Cross-Platform) in python? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 56 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373605132 news.xs4all.nl 15990 [2001:888:2000:d::a6]:43775 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50496 On Fri, Jul 12, 2013 at 2:24 PM, Metallicow wrot= e: > On Thursday, July 11, 2013 8:27:04 PM UTC-5, Christian Heimes wrote: >> Am 11.07.2013 19:19, schrieb Metallicow: >> >> > @ Chris =EF=BF=BDKwpolska=EF=BF=BD Warrick >> >> > Thanks, that is a start anyway. >> >> > a Pure-Python way was what I was wanting, not win32api stuff. >> >> > >> >> > "C:\Windows\Fonts" >> >> > The windows path proves valid. Works on XP, Vista, 7. Not sure about w= in8....? >> >> >> >> That's the wrong way to do it. You have to use the proper Windows API to >> >> get to the font directory. It's SHGetKnownFolderPath() with >> >> FOLDERID_Font or SHGetFolderPath() with CSIDL_FONTS. >> >> >> >> See http://bugs.python.org/issue1763 >> >> >> >> Christian > > typo'd instead of copy/pasted. What I meant was... Chris's code... > >>>> FONTDIRS =3D os.path.join(os.environ['WINDIR'], 'Fonts') > 'C:\\WINDOWS\\Fonts' > > returned valid as returned string. Forgot to add >>> part. > Is there any way to edit posts? Don't see an edit linky anywhere. > Is there something wrong with using os.environ...? > win32api stuff is another dependency. Is it really needed? No, you fundamentally cannot edit posts. This is a Usenet newsgroup and a mailing list; once your post is sent, it gets carried by lots of different servers separately. Just send a followup, same as you did there. Since you seem to be using Google Groups, please read this to learn how to avoid antagonizing a significant proportion of the list's best responders: http://wiki.python.org/moin/GoogleGroupsPython ChrisA