Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'syntax': 0.03; 'filename': 0.07; 'parsing': 0.07; 'extension.': 0.09; 'parsed': 0.09; 'cc:addr:python-list': 0.10; 'podcast': 0.16; 'reason.': 0.16; 'stripped': 0.16; 'whitespace.': 0.16; '\xc2\xa0i': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'email addr:gmail.com>': 0.20; 'all,': 0.21; 'trying': 0.21; 'error.': 0.21; 'cc:2**0': 0.23; 'example': 0.23; "haven't": 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'wondering': 0.26; 'am,': 0.27; 'errors.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'post': 0.28; 'way?': 0.29; 'whitespace': 0.29; 'url:mailman': 0.29; 'skip:& 10': 0.29; 'minimal': 0.30; 'function': 0.30; 'error': 0.30; 'code': 0.31; 'asking': 0.32; 'url:python': 0.32; 'url:listinfo': 0.32; 'getting': 0.33; 'traceback': 0.33; 'problem': 0.33; 'received:google.com': 0.34; 'doing': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'url:org': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'shows': 0.38; 'where': 0.40; 'end': 0.40; 'url:mail': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'first': 0.61; 'tricks': 0.65; '2013': 0.84; 'pleasure.': 0.84; 'strangers': 0.84; 'joel': 0.91; 'seriously,': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=0ndaVO6g2NKisXBZPaLyeUt2OFVeLj3rLWB25X2qOXs=; b=q1sXE7B4uD2EHOco6FnpyP+D5tlSnB4LSE+OyNkA2zNS8MSULXfYM+iCiaWvpx1wBU jAT2t0/p/UPt3qT7RAYrtroWWfQw7tFa1TRMz0cmYgEhSc3EJySnwV5ipcJV1cdLg+aH eNS4mgvZ8D4ie0wUEDcGUCEne2yfq9jcycIc0p5aiRXT2w7Q9suLCN4sYcxVq5dgHNYx agD8PXJrmt4G6kcjFpmanPTnl6NzF5IS0KvWTdGFiGnbTtqa/xhaZ37CTu8R09z5o7LH I1nB+gUXEZRy2wm4F1GEkrM/GVBHVqgzsSh/TeDeOIh5pbQP7KVfRuMrNklX6HO34Vs4 UVwA== MIME-Version: 1.0 X-Received: by 10.58.12.69 with SMTP id w5mr2466348veb.16.1363277105456; Thu, 14 Mar 2013 09:05:05 -0700 (PDT) In-Reply-To: References: Date: Thu, 14 Mar 2013 12:05:05 -0400 Subject: Re: Generating Filenames from Feeds From: Joel Goldstick To: Chuck Content-Type: multipart/alternative; boundary=047d7b2e4ab49a1ae804d7e4af7f Cc: "python-list@python.org" 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: 100 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363277108 news.xs4all.nl 6888 [2001:888:2000:d::a6]:47159 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41233 --047d7b2e4ab49a1ae804d7e4af7f Content-Type: text/plain; charset=UTF-8 On Thu, Mar 14, 2013 at 11:38 AM, Chuck wrote: > HI all, > > I am trying to write a podcast catcher for fun, and I am trying to come up > with a way to generate a destination filename to use in the function > urlretrieve(url, destination). I would like the destination filename to > end in a .mp3 extension. > > My first attempts were parsing out the and stripping the > whitespace characters, and joining with os.path.join. I haven't been able > to make that work for some reason. The reason is apparently a syntax error. Whenever I put the .mp3 in the os.path.join I get syntax errors. I am > wondering if there is a better way? > Yes, don't write code with syntax errors! > > I was doing something like > os.path.join('C:\\Users\\Me\\Music\\Podcasts\\', pubdate.mp3), where > pubdate has been parsed and stripped of whitespace. I keep getting an > error around the .mp3. > > Any ideas? > Seriously, if you don't post a minimal code example that shows the problem and with a full traceback you are asking strangers to do magic tricks for your pleasure. > > Thanks!! > Chuck > -- > http://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com --047d7b2e4ab49a1ae804d7e4af7f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Thu, Mar 14, 2013 at 11:38 AM, Chuck <galois271@gmail.com= > wrote:
HI all,

I am trying to write a podcast catcher for fun, and I am trying to come up = with a way to generate a destination filename to use in the function urlret= rieve(url, destination). =C2=A0I =C2=A0would like the destination filename = to end in a .mp3 extension.

My first attempts were parsing out the <pubdate> and stripping the wh= itespace characters, and joining with os.path.join. =C2=A0I haven't bee= n able to make that work for some reason.

The reason is apparently a=C2=A0 syntax error.=C2=A0

Whenever I put the .mp3 in the os.path.join I get sy= ntax errors. =C2=A0I am wondering if there is a better way?

Yes, don't write code with syntax erro= rs!

I was doing something like os.path.join('C:\\Users\\Me\\Music\\Podcasts= \\', pubdate.mp3), where pubdate has been parsed and stripped of whites= pace. =C2=A0I keep getting an error around the .mp3.

Any ideas?

Seriously, if you don't = post a minimal code example that shows the problem and with a full tracebac= k you are asking strangers to do magic tricks for your pleasure.

Thanks!!
Chuck
--
http://mail.python.org/mailman/listinfo/python-list



--
--047d7b2e4ab49a1ae804d7e4af7f--