|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
you want something like
Code:
print ', '.join(line) Dave - The Developers' Coach |
|
#3
|
|||
|
|||
|
Thanks Dave
You have saved my time. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Array??????????/ |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|