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


Groups > comp.lang.python > #98903

Re: write data in Excel using python

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: write data in Excel using python
Date Mon, 16 Nov 2015 17:22:39 -0700
Lines 24
Message-ID <mailman.373.1447720302.16136.python-list@python.org> (permalink)
References <3267f6a3-a047-4abf-80bf-8fdba3659223@googlegroups.com> <9559B3D4-FF2F-4CCA-8C52-BF0D1988755E@xs4all.nl>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de a0PTluFDJpU/sXmRjaU0gQSGURTISK061D7PvzesqSKw==
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; '16,': 0.03; 'escape': 0.07; 'subject:using': 0.09; 'subject:python': 0.14; 'backslashes': 0.16; 'happily': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'windows': 0.20; '2015': 0.20; 'file.': 0.22; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; "doesn't": 0.26; 'error': 0.27; 'raw': 0.27; 'message-id:@mail.gmail.com': 0.27; 'this.': 0.28; 'skip:( 20': 0.28; 'accepts': 0.29; 'strings,': 0.29; 'received:google.com': 0.35; 'nov': 0.35; 'skip:e 40': 0.35; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'hi,': 0.38; 'skip:e 20': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'forget': 0.60; 'save': 0.60; 'email addr:gmail.com': 0.62; 'forward': 0.66; 'subject:write': 0.84; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=aZhMhN9bNn85qH6zs5Mtp+lThIWg1FbKiZdXezg6zpI=; b=V1Nr/yzjCzBcuDPGSGSLGRbz3GFMvK3790345svV7vG5D6dnPaqBcE+Jv9bLWxrrEg l7iotbI8ypaQmdbBCLlkXwKVV0uzhoDpD3Iy+fHeNdBLGHNonqZ/3G+GQkb1hBxoUcYJ y8W277x3Zp2Tta3D6pzQp/MlCEGaIHsJJJ4qMkA72BsRptIqtOgk3N1+SkW8Ml+fttxr niLA1XlD5tBWGgfBGw4qdhfo/R6fviTbGqou3VEREFbD5slqupz/kRo1lZ/PGZShkpp4 i4hfG+Nwix72op/pzwY1ZdtgU8fpcs13uKxT5WGJy1qQfYwGp8iynll0KwXCdXBZNPNe kBww==
X-Received by 10.50.136.132 with SMTP id qa4mr18433954igb.68.1447719798479; Mon, 16 Nov 2015 16:23:18 -0800 (PST)
In-Reply-To <9559B3D4-FF2F-4CCA-8C52-BF0D1988755E@xs4all.nl>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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>
Xref csiph.com comp.lang.python:98903

Show key headers only | View raw


On Mon, Nov 16, 2015 at 11:20 AM, Michiel Overtoom <motoom@xs4all.nl> wrote:
>
> Hi,
>
>> On 16 Nov 2015, at 18:14, syedmwaliullah@gmail.com wrote:
>> For some reason it doesn't save the file.
>
> Did you get an error message?
>
>> excel.activeWorkbook.SaveAs ("c:\TurnData.xlsx")
>
> When you use backslashes in strings, don't forget to escape them:
>
>> excel.activeWorkbook.SaveAs("c:\\TurnData.xlsx")
>
> or use raw strings:
>
>> excel.activeWorkbook.SaveAs(r"c:\TurnData.xlsx")

You can also just use a forward slash:

excel.activeWorkbook.SaveAs("c:/TurnData.xlsx")

Windows happily accepts this.

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


Thread

write data in Excel using python syedmwaliullah@gmail.com - 2015-11-16 09:14 -0800
  Re: write data in Excel using python Michiel Overtoom <motoom@xs4all.nl> - 2015-11-16 19:20 +0100
  Re: write data in Excel using python Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-16 17:22 -0700
  Re: write data in Excel using python tdsperth@gmail.com - 2015-11-16 17:43 -0800

csiph-web