Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #107380
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Matthew Barnett <mrabarnett@mrabarnett.plus.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: Python path and append |
| Date | Wed, 20 Apr 2016 00:36:52 +0100 |
| Lines | 40 |
| Message-ID | <mailman.5.1461110859.12923.python-list@python.org> (permalink) |
| References | <smbdhb5kjje2oandna4vj5udku9gh1h9oa@4ax.com> <CAPTjJmrCne5sz_gVPY1Q4fAOFgm0rr0rJL4kEMgjnPyg6SW3MA@mail.gmail.com> <5716C114.6000703@mrabarnett.plus.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de zr62ADHWi9d8k8mb4ukG9wkKPz8uxiQQWJ76HmoG6p5Q== |
| Return-Path | <mrabarnett@mrabarnett.plus.com> |
| 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; 'subject:Python': 0.05; 'append': 0.07; 'skip:\\ 10': 0.07; 'ioerror:': 0.09; 'literal': 0.09; 'wed,': 0.15; '2016': 0.16; 'backslashes': 0.16; 'expect,': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'handle:': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'string': 0.17; '>>>': 0.20; 'prevent': 0.20; 'am,': 0.23; 'this:': 0.23; '(most': 0.24; 'plain': 0.24; 'header:In-Reply- To:1': 0.24; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'chris': 0.26; 'skip:" 20': 0.26; 'error': 0.27; 'raw': 0.27; 'character': 0.29; 'print': 0.30; 'possibly': 0.32; 'traceback': 0.33; "skip:' 20": 0.34; 'file': 0.34; 'handle': 0.34; 'text': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'skip:p 20': 0.38; 'skip:o 20': 0.38; 'end': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'space': 0.40; 'some': 0.40; 'your': 0.60; 'you.': 0.64; '20,': 0.66; 'directory:': 0.84; 'drive.': 0.84; 'seymore4head': 0.84 |
| X-CM-Score | 0.00 |
| X-CNFS-Analysis | v=2.1 cv=K//fZHiI c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=MZBWxn6V2mTkSrvCIzMA:9 a=QEXdDO2ut3YA:10 |
| X-AUTH | mrabarnett@:2500 |
| User-Agent | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 |
| In-Reply-To | <CAPTjJmrCne5sz_gVPY1Q4fAOFgm0rr0rJL4kEMgjnPyg6SW3MA@mail.gmail.com> |
| X-Mailman-Approved-At | Tue, 19 Apr 2016 20:07:39 -0400 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.22 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <5716C114.6000703@mrabarnett.plus.com> |
| X-Mailman-Original-References | <smbdhb5kjje2oandna4vj5udku9gh1h9oa@4ax.com> <CAPTjJmrCne5sz_gVPY1Q4fAOFgm0rr0rJL4kEMgjnPyg6SW3MA@mail.gmail.com> |
| Xref | csiph.com comp.lang.python:107380 |
Show key headers only | View raw
On 2016-04-19 23:38, Chris Angelico wrote:
> On Wed, Apr 20, 2016 at 8:29 AM, Seymore4Head
> <Seymore4Head@hotmail.invalid> wrote:
>>
>> handle = open("\\Winmx\New$\q.txt")
>> for line in handle:
>> line=line.strip()
>> print line
>>
>>
>> Traceback (most recent call last):
>> File "\\Winmx\New$\add viewed.py", line 2, in <module>
>> handle = open("\\Winmx\New$\q.txt")
>> IOError: [Errno 2] No such file or directory: '\\Winmx\\New$\\q.txt'
>>
>> What I would like to do is read a plain text file from a hidden
>> network drive and append a space and the * character to the end of
>> each line.
>
> Start with this:
>
> print("\\Winmx\New$\q.txt")
>
> If that doesn't do what you expect, it's possibly because you want to
> use a raw string literal to prevent the backslashes from being parsed.
>
> handle = open(r"\\Winmx\New$\q.txt")
>
> That might help you.
>
> (One clue that this is happening is that some of your backslashes got
> doubled in the error message.)
>
when printed out:
>>> print "\\Winmx\New$\q.txt"
\Winmx\New$\q.txt
That's a file 2 directories down on the current drive.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python path and append Seymore4Head <Seymore4Head@Hotmail.invalid> - 2016-04-19 18:29 -0400
Re: Python path and append Chris Angelico <rosuav@gmail.com> - 2016-04-20 08:38 +1000
Re: Python path and append Matthew Barnett <mrabarnett@mrabarnett.plus.com> - 2016-04-20 00:36 +0100
Re: Python path and append Seymore4Head <Seymore4Head@Hotmail.invalid> - 2016-04-25 14:10 -0400
Re: Python path and append Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-04-25 18:24 +0000
Re: Python path and append Seymore4Head <Seymore4Head@Hotmail.invalid> - 2016-04-25 15:00 -0400
RE: Python path and append Joaquin Alzola <Joaquin.Alzola@lebara.com> - 2016-04-25 19:08 +0000
Re: Python path and append Seymore4Head <Seymore4Head@Hotmail.invalid> - 2016-04-25 16:15 -0400
Re: Python path and append Random832 <random832@fastmail.com> - 2016-04-25 16:28 -0400
Re: Python path and append Peter Otten <__peter__@web.de> - 2016-04-25 23:38 +0200
Re: Python path and append Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-25 19:57 -0400
Re: Python path and append Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-04-25 19:31 +0000
Re: Python path and append MRAB <python@mrabarnett.plus.com> - 2016-04-25 20:44 +0100
Re: Python path and append Seymore4Head <Seymore4Head@Hotmail.invalid> - 2016-04-25 16:43 -0400
Re: Python path and append Steven D'Aprano <steve@pearwood.info> - 2016-04-26 11:51 +1000
Re: Python path and append Dan Sommers <dan@tombstonezero.net> - 2016-04-26 01:59 +0000
Re: Python path and append Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-04-26 18:23 +1200
Re: Python path and append boB Stepp <robertvstepp@gmail.com> - 2016-04-29 15:26 -0500
Re: Python path and append Steven D'Aprano <steve@pearwood.info> - 2016-04-30 11:44 +1000
Re: Python path and append John Gordon <gordon@panix.com> - 2016-04-25 21:26 +0000
Re: Python path and append Seymore4Head <Seymore4Head@Hotmail.invalid> - 2016-04-25 18:04 -0400
Re: Python path and append Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-25 20:03 -0400
Re: Python path and append Steven D'Aprano <steve@pearwood.info> - 2016-04-26 11:53 +1000
Re: Python path and append Seymore4Head <Seymore4Head@Hotmail.invalid> - 2016-04-26 22:56 -0400
Re: Python path and append Chris Angelico <rosuav@gmail.com> - 2016-04-27 13:06 +1000
Re: Python path and append Stephen Hansen <me+python@ixokai.io> - 2016-04-27 17:24 -0700
Re: Python path and append Chris Angelico <rosuav@gmail.com> - 2016-04-26 10:25 +1000
csiph-web