Skip to content
murmot

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

  • mail.python.org

    [Tutor] script error question [checking for substrings]

    Next message: [Tutor] question about python in Emacs. Messages sorted by: [ date ] [ thread ] [ subject ] [ author ].Instead of 'in', you'll probably want to use the 'find()' > > method, which tells us exactly the position where the > > smaller string starts to occurs. > >

  • 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

    [Tutor] script error question [checking for substrings]

    Instead of 'in', you'll probably want to use the 'find()' > method, which tells us exactly the position where the > smaller string starts to occurs.Previous message: [Tutor] Better (free) IDEs than IDLE for Linux ? Next message: [Tutor] script error question [checking for substrings].

  • 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

    [BangPypers] python split

    [BangPypers] python split. Sibtey Mehdi sibteym at infotechsw.com Tue Oct 21 12:49:18 CEST 2008.Is there a way to split text like below example.

  • mail.python.org

    [Python-Dev] string.split

    Feb 20, 2004 · However, the difference between split with and without the 'sep' argument should be documented. Andreas Previous message: [Python-Dev] Re: PEP 309 misuses the term "currying" Next message: [Python-Dev] string.split Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] More information about the Python-Dev mailing list

  • mail.python.org

    [Tutor] Split Method

    [Tutor] Split Method. Rafael Knuth rafael.knuth at gmail.com Thu Jan 30 12:11:56 CET 2014.I already know how to split strings that are separated through empty spaces: def SplitMyStrings(): Colors = "red blue green white black".split() return (Colors).

  • mail.python.org

    [Tutor] Importing file data into Python arrays

    May 27, 2002 · This is done using the split function. >>> line.split () ['1', '2', '3'] The split function can also takes other arguments, which is great if you have for example a comma separated input.