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


Groups > comp.lang.python > #100749

Re: Newbie: String to Tuple

From Peter Otten <__peter__@web.de>
Newsgroups comp.lang.python
Subject Re: Newbie: String to Tuple
Date 2015-12-22 22:07 +0100
Organization None
Message-ID <mailman.70.1450818473.2237.python-list@python.org> (permalink)
References <56576725-0f10-4c7b-aead-272f2e3a8456@googlegroups.com>

Show all headers | View raw


KP wrote:

> How do I convert
> 
> '1280,1024'
> 
> to
> 
> (1280,1024) ?


>>> import ast
>>> ast.literal_eval('1280,1024')
(1280, 1024)

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


Thread

Newbie: String to Tuple KP <kai.peters@gmail.com> - 2015-12-22 12:53 -0800
  Re: Newbie: String to Tuple Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-22 20:59 +0000
    Re: Newbie: String to Tuple KP <kai.peters@gmail.com> - 2015-12-22 13:06 -0800
  Re: Newbie: String to Tuple Peter Otten <__peter__@web.de> - 2015-12-22 22:07 +0100

csiph-web