Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Fillmore Newsgroups: comp.lang.python Subject: Perl to Python again Date: Fri, 11 Mar 2016 18:42:24 -0500 Organization: Aioe.org NNTP Server Lines: 21 Message-ID: NNTP-Posting-Host: SxA1UDOcaYBihz5zYbn9yQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 X-Notice: Filtered by postfilter v. 0.8.2 X-Mozilla-News-Host: news://nntp.aioe.org:119 Xref: csiph.com comp.lang.python:104658 So, now I need to split a string in a way that the first element goes into a string and the others in a list: while($line = ) { my ($s,@values) = split /\t/,$line; I am trying with: for line in sys.stdin: s,values = line.strip().split("\t") print(s) but no luck: ValueError: too many values to unpack (expected 2) What's the elegant python way to achieve this? Thanks