#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    57
    Rep Power
    11

    Array??????????/


    Code:
    import os
    os.chdir('/')
    os.chdir('c:/')
    path='serverfile.txt'
    trim= '|\n'
    for line in file(path):
        line=line.strip(trim)
        line=line.split(trim)
        print line
    the display is something ['abcdefgh'] but i want it to dispaly as abcdefgh without [' ']
    Can someone help

    Thanks in advance
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    London, England
    Posts
    1,585
    Rep Power
    1373
    you want something like

    Code:
    print ', '.join(line)
    Dave - The Developers' Coach
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    57
    Rep Power
    11
    Thanks Dave
    You have saved my time.

IMN logo majestic logo threadwatch logo seochat tools logo