Skip to content
murmot

Results for “python split example site:mail.python.org code”

  • mail.python.org

    [Python-Dev] Half-baked proposal: * (and **?) in assignments

    I think Gareth's split example is better. localtime returns a fixed-length tuple. Things are much more interesting when you don't know how many elements you're getting. Which do you like better for, say, parsing required and optional parameters to a command

  • mail.python.org

    [BangPypers] python split

    [BangPypers] python split. Shekhar pythonic at gmail.com Tue Oct 21 13:43:34 CEST 2008.Hi , > Is there a way to split text like below example > >.

  • mail.python.org

    [Tutor] Parsing text file with Python

    Mar 24, 2007 · A couple of points: > in_filename = raw_input ('What is the COMPLETE name of the file you > would like to process? ') > in_file = open (in_filename, 'rU') You might want to put your file opening code inside a try/except in case the file isn't there or is locked. > text = in_file.readlines () > count = len (text) > print "There are ", count ...

  • mail.python.org

    [BangPypers] python split

    From: Sibtey Mehdi <sibteym at infotechsw.com> To: Bangalore Python Users Group - India <bangpypers at python.org> Sent: Tuesday, 21 October, 2008 4:19:18 PM Subject: Re: [BangPypers] python split. Try this.Hi , Is there a way to split text like below example.

  • mail.python.org

    [Tutor] Parsing text file - Python

    For each rule, write a Python function that tries to recognize what the rule describes. To do its job, each function might call other functions that implement other grammar rules and might call a tokenizer function (see below) when it needs another token from the input stream.

  • mail.python.org

    [Tutor] Processing Gutenburg texts

    For example, splitting the table of contents section off in another function will probably make things better. It doesn't matter that it just gets called once --- the idea is to help you see lots of small steps reduced to one large step.

  • mail.python.org

    [Python-Dev] string.split

    Feb 20, 2004 · However, I must agree that the documentation for the string method is somewhat lacking. The documentation of the split function in the string module is much clearer. Method: split ( [sep [,maxsplit]]) Return a list of the words in the string, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done.

  • mail.python.org

    [Tutor] Iterating through tokens from a split command - Python

    This saves all the indexing, means you don't need to check for index errors or end of file limits. It lets Python take the strain and makes your job easier. HTH, Alan G. Previous message: [Tutor] Iterating through tokens from a split command