| Reply | « Previous Thread | Next Thread » |
|
Hi again,
I want to know how to read the contents of a txt file.. My txt file contains three values seperated by commas.. I wanted to fetch them one at a time and display them in a form of three text boxes.. How to get this done? |
|
Quote:
Most of the questions you ask are answered here. In this case, here. |
|
A bit of file handling and a bit of String handling (Search for split() in python) would do the job.
IDEAS is all they need but still they think only Genius can give them that. |
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
|
Hi,
if you want to split your string separated by comma than try this code Code:
y='hi,how,r,u' print string.split(y,',') Jajal Mehul |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
|
Quote:
Code:
y='hi,how,r,u'
print y.split(',')
|
|
Quote:
Its much easy than what i had suggested. Jajal Mehul |
|
You may find 'pickle' module useful here.
It helps you store and retrieve different structures in a text file. No need for any manual conversion or string analysis. simple use - SAVE: Code:
import pickle f = open(file, 'w') pickle.dump(variable, f) f.close() Code:
f = open(file, 'r') variable = zpickle.load(f) f.close() |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Read contents of SMS file | carlyle | General Messaging | 4 | 2008-08-15 19:14 |
| [announce] PyUIQ. Python for UIQ 2.1 and 3.x | OscarBernabeu | Python | 35 | 2008-01-17 10:12 |
| Read and Write the encrypted data form file | ankushbabrekar | General Symbian C++ | 6 | 2007-04-18 11:53 |
| please please help me show contents of file txt | finalcomp | General Symbian C++ | 1 | 2006-07-17 13:36 |
| socket read hangs until socket is closed | camroe | Mobile Java Networking & Messaging & Security | 1 | 2005-07-21 10:44 |