Skip to content
murmot

Results for “python split method example program site:mail.python.org error”

  • mail.python.org

    [Python-Dev] split('') revisited

    [Python-Dev] split('') revisited. Andrew Koenig [email protected] Wed, 31 Jul 2002 18:35:21 -0400 (EDT).abcde']. This result differs from the result of using the string split method. In other words, the documentation doesn't match the actual behavior, so the status quo is broken.

  • mail.python.org

    [Python-Dev] string.split

    Feb 20, 2004 · 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.

  • mail.python.org

    [Tutor] Split Method

    [Tutor] Split Method. Steven D'Aprano steve at pearwood.info Thu Jan 30 12:22:21 CET 2014.print(SplitMyStrings()) ... '. red', 'blue', 'green', 'white', 'black'] ... .. however I couldn't figure out how to split each character into a list item. list(some_string). For example

  • mail.python.org

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

    Hi Vicki, A couple of things here. First you only ever read a single line from the file. You then iterate over the tokens in that line but never stop - hence the index error! You probably want to restructure it soomething like: for line in inputfile.readlines (): #readlines, plural! tokens = line.split ['|'] for token in tokens: # iterates over the tokens if token == '0x11': new = '0x02 ...

  • mail.python.org

    [BangPypers] python split

    Next message: [BangPypers] python split. Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]. Hi , Is there a way to split text like below example.

  • mail.python.org

    [Tutor] input and raw input

    A string has a method split(); that may help you. >If not, you can check for > the occurrence of one or the other separator and run split() with the > correct separator. If both can occur in the same line, you may want to use > the regex module instead: re.split() >.

  • mail.python.org

    [Tutor] Importing file data into Python arrays

    May 27, 2002 · In any case, you still have a number of strings. That's where the map function comes in handy. >>> map (int, line.split ()) [1, 2, 3] This applies the int () function on every element in your list, resulting in a new list containing the converted values.