Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39234
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <thomas.calmant@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'error:': 0.05; 'escape': 0.07; 'skip:o 50': 0.07; 'subject:help': 0.07; '"w")': 0.09; 'ioerror:': 0.09; 'rows': 0.09; 'skip:r 50': 0.09; 'cc:addr :python-list': 0.10; 'stored': 0.10; 'advance': 0.10; 'csv': 0.16; 'skip:g 50': 0.16; 'writer': 0.16; 'skip:g 40': 0.17; 'subject:need': 0.17; 'email addr:gmail.com>': 0.20; 'skip:" 40': 0.20; 'import': 0.21; "skip:' 40": 0.22; 'cc:2**0': 0.23; 'seems': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; '(most': 0.27; 'forgot': 0.27; 'merge': 0.27; 'message- id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'url:mailman': 0.29; 'character': 0.29; 'skip:& 10': 0.29; 'folder': 0.30; 'mode': 0.30; 'subject: : ': 0.30; 'url:python': 0.32; 'file': 0.32; 'url:listinfo': 0.32; 'traceback': 0.33; 'skip:& 20': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'received:209.85': 0.35; 'url:org': 0.36; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'skip:" 10': 0.40; 'url:mail': 0.40; 'skip:\xc2 10': 0.62; 'thomas': 0.62; 'here': 0.65; 'programme': 0.69; '8bit%:100': 0.70; 'subject:urgent': 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=oV2TNH1y9EhwT2fy9WkKr6nR9yv/E7iiXgImkOoyyz4=; b=n4NRHkPzmFrrVjbJ1JCE1/7rKVoGDE4Cn/fGouHL4oPBiPEMPoneUytG0f5DNwElwe 5C4Rlrp935OOVPhElmpQnnulpS5ntdo4sYIaBDQycWMjSsyovS/6b5RsRadeiEPdvOP6 dzLaIus9mUoQBRbPo/hJns8YC7IelFTkPzaqnHCAo6JJ29Zvk1lwordl6C/E8q+EZqvJ pBtYTLS+lG8ornb6k0WRHrVT0Ct2qpgQiKxoBZYmw6UXwChhLIpGvOfVkSNOAt5D7IrI RHETa65H+Bip0coJ8kjKkvtNjPE8Rh3UveqBNT8eL56ewX8Lo1GQEpYR7b421araRpSN klmA== |
| MIME-Version | 1.0 |
| X-Received | by 10.180.98.198 with SMTP id ek6mr5175566wib.7.1361288450730; Tue, 19 Feb 2013 07:40:50 -0800 (PST) |
| In-Reply-To | <CAFqGZREMOm4YSntzwie8o=RmusdV8KzrggY0wK8w4vCXWuwmBw@mail.gmail.com> |
| References | <CAFqGZREMOm4YSntzwie8o=RmusdV8KzrggY0wK8w4vCXWuwmBw@mail.gmail.com> |
| Date | Tue, 19 Feb 2013 16:40:50 +0100 |
| Subject | Re: IOerror : need urgent help |
| From | Thomas Calmant <thomas.calmant@gmail.com> |
| To | inshu chauhan <insideshoes@gmail.com> |
| Content-Type | multipart/alternative; boundary=f46d044286ca8aec1604d615aa03 |
| Cc | "python-list@python.org" <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 <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.2033.1361288468.2939.python-list@python.org> (permalink) |
| Lines | 87 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1361288468 news.xs4all.nl 6959 [2001:888:2000:d::a6]:33584 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:39234 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
hi
It seems you forgot to escape the escape character in the file names ('\'):
"C:\Users\inshu.chauhan\Desktop\test.arff"
=> r"C:\Users\inshu.chauhan\Desktop\test.arff"
or
=> "C:\\Users\\inshu.chauhan\\Desktop\\test.arff"
++
Thomas
2013/2/19 inshu chauhan <insideshoes@gmail.com>
> Here is my attempt to merge 10 files stored in a folder into a single file
> :
>
> import csv
>
> with open("C:\Users\inshu.chauhan\Desktop\test.arff", "w") as w:
> writer = csv.writer(w)
> for f in glob.glob("C:\Users\inshu.chauhan\Desktop\For
> Model_600\*.arff"):
> rows = open(f, "r").readlines()
> writer.writerows(rows)
>
>
> Error:
>
> Traceback (most recent call last):
> File "C:\Users\inshu.chauhan\Desktop\Mergefiles.py", line 3, in <module>
> with open("C:\Users\inshu.chauhan\Desktop\test.arff", "w") as w:
> IOError: [Errno 22] invalid mode ('w') or filename:
> 'C:\\Users\\inshu.chauhan\\Desktop\test.arff'
>
> Why my programme is not working ?? :(
>
> Thanks in Advance !!
>
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: IOerror : need urgent help Thomas Calmant <thomas.calmant@gmail.com> - 2013-02-19 16:40 +0100
csiph-web