Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #41233
| References | <a8aaf0a9-de8e-476f-9a34-e75694112802@googlegroups.com> |
|---|---|
| Date | 2013-03-14 12:05 -0400 |
| Subject | Re: Generating Filenames from Feeds |
| From | Joel Goldstick <joel.goldstick@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3313.1363277108.2939.python-list@python.org> (permalink) |
[Multipart message — attachments visible in raw view] - view raw
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
> urlretrieve(url, destination). I would like the destination filename to
> end in a .mp3 extension.
>
> My first attempts were parsing out the <pubdate> 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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Generating Filenames from Feeds Chuck <galois271@gmail.com> - 2013-03-14 08:38 -0700
Re: Generating Filenames from Feeds Joel Goldstick <joel.goldstick@gmail.com> - 2013-03-14 12:05 -0400
Re: Generating Filenames from Feeds Chuck <galois271@gmail.com> - 2013-03-14 11:19 -0700
Re: Generating Filenames from Feeds Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-14 22:58 +0000
Re: Generating Filenames from Feeds Chuck <galois271@gmail.com> - 2013-03-14 11:19 -0700
Re: Generating Filenames from Feeds MRAB <python@mrabarnett.plus.com> - 2013-03-14 16:07 +0000
csiph-web