Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53442

Re: How to split with "\" character, and licence copyleft mirror of ©

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <cameron@cskk.homeip.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'string': 0.09; 'character,': 0.09; 'literal': 0.09; 'os.path': 0.09; 'subject:How': 0.10; 'windows': 0.15; "'\\\\'": 0.16; '(just': 0.16; 'copyleft': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'simpson': 0.16; 'subject:mirror': 0.16; 'syntaxerror:': 0.16; 'wrote:': 0.18; 'app': 0.19; 'file,': 0.19; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'module,': 0.24; 'paul': 0.24; 'cheers,': 0.24; 'distribute': 0.26; 'developing': 0.27; 'header:In-Reply-To:1': 0.27; 'character': 0.29; 'unix': 0.29; "doesn't": 0.30; "i'm": 0.30; 'url:wiki': 0.31; 'app.': 0.31; 'mirror': 0.31; 'url:wikipedia': 0.31; 'url:python': 0.33; "i'd": 0.34; 'subject:with': 0.35; 'but': 0.35; 'really': 0.36; 'received:com.au': 0.36; "i'll": 0.36; 'url:org': 0.36; 'should': 0.36; 'received:211': 0.38; 'url:library': 0.38; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'read': 0.60; 'url:3': 0.61; 'content-disposition:inline': 0.62; 'email addr:gmail.com': 0.63; 'show': 0.63; 'name': 0.63; 'of:': 0.68; 'subjectcharset:utf-8': 0.72; 'url:path': 0.84
Date Mon, 2 Sep 2013 10:23:41 +1000
From Cameron Simpson <cs@zip.com.au>
To python-list@python.org
Subject Re: How to split with "\" character, and licence copyleft mirror of ©
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
Content-Transfer-Encoding 8bit
In-Reply-To <c795fae4-2b38-4d81-a552-a69febdac0c0@googlegroups.com>
User-Agent Mutt/1.5.21 (2010-09-15)
References <c795fae4-2b38-4d81-a552-a69febdac0c0@googlegroups.com>
X-Optus-CM-Score 0
X-Optus-CM-Analysis v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=YuQlxtEQCowy2cfE5kc7TA==:117 a=YuQlxtEQCowy2cfE5kc7TA==:17 a=ZtCCktOnAAAA:8 a=PO7r1zJSAAAA:8 a=LcaDllckn3IA:10 a=bebit7ZU2Z8A:10 a=jPJDawAOAc8A:10 a=IkcTkHD0fZMA:10 a=vrnE16BAAAAA:8 a=8AHkEIZyAAAA:8 a=M4p5BYLoSWIA:10 a=HDWgMBI4gAMA:10 a=pGLkceISAAAA:8 a=8pif782wAAAA:8 a=zzi8u-qWA3AM3LEfq0QA:9 a=QEXdDO2ut3YA:10 a=nVR0RFA0gN8A:10 a=rLQdu8sF7bkA:10 a=MSl-tDqOz04A:10
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.465.1378081436.19984.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1378081436 news.xs4all.nl 15913 [2001:888:2000:d::a6]:41476
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:53442

Show key headers only | View raw


On 01Sep2013 17:03, materile11@gmail.com <materile11@gmail.com> wrote:
| <code>
| >>> a = 'E:\Dropbox\jjfsdjjsdklfj\sdfjksdfkjslkj\flute.wav'
| >>> a.split('\')
| SyntaxError: EOL while scanning string literal
| </code>
| 
| I think that the character '\' is the problem, but unfortunately I'm developing a small app for windows and I need to show only the name of the .wav file, in this case 'flute.wav'.

Firstly, you want to say '\\' for a slosh (just as you would say '\n' for a linefeed).

However, you really should use the os.path module, in particular os.path.split().

Have a read of:
  http://docs.python.org/3/library/os.path.html#module-os.path
  http://docs.python.org/2/library/os.path.html#module-os.path

| I also want to know how to mirror a character, in my case this
| one ©, because I'll use the Copyleft http://en.wikipedia.org/wiki/Copyleft
| to distribute my app.

Isn't that a copyright symbol? I'd have a look at the "uncidoedata" module,
myself.

Cheers,
-- 
Cameron Simpson <cs@zip.com.au>

Just because Unix is a multiuser system doesn't mean I want to share it with
anybody!        - Paul Tomblin, in rec.aviation.military

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to split with "\" character, and licence copyleft mirror of © materile11@gmail.com - 2013-09-01 17:03 -0700
  Re: How to split with "\" character, and licence copyleft mirror of © Cameron Simpson <cs@zip.com.au> - 2013-09-02 10:23 +1000
  Re: How to split with "\" character, and licence copyleft mirror of © Tim Chase <python.list@tim.thechases.com> - 2013-09-01 19:34 -0500
    Re: How to split with "\" character, and licence copyleft mirror of © materile11@gmail.com - 2013-09-01 21:20 -0700
  Re: How to split with "\" character, and licence copyleft mirror of © Tim Chase <python.list@tim.thechases.com> - 2013-09-01 19:40 -0500
  Re: How to split with "\" character, and licence copyleft mirror of © Tim Roberts <timr@probo.com> - 2013-09-01 19:40 -0700
    Re: How to split with "\" character, and licence copyleft mirror of © Ethan Furman <ethan@stoneleaf.us> - 2013-09-02 13:22 -0700
      Re: How to split with "\" character, and licence copyleft mirror of © Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-03 02:06 +0000
        Re: How to split with "\" character, and licence copyleft mirror of © Tim Chase <python.list@tim.thechases.com> - 2013-09-03 05:31 -0500
        Re: How to split with "\" character, and licence copyleft mirror of © random832@fastmail.us - 2013-09-03 14:31 -0400
          Re: How to split with "\" character, and licence copyleft mirror of © Tim Roberts <timr@probo.com> - 2013-09-05 20:33 -0700
            Re: How to split with "\" character, and licence copyleft mirror of � Terry Reedy <tjreedy@udel.edu> - 2013-09-06 02:15 -0400
            Re: How to split with "\" character, and licence copyleft mirror of © random832@fastmail.us - 2013-09-06 09:29 -0400
            Re: How to split with "\" character, and licence copyleft mirror of � Fábio Santos <fabiosantosart@gmail.com> - 2013-09-11 11:16 +0100

csiph-web