Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-21-2005, 12:30 AM   #1
Registered: Dec 2004
Location: Austin, TX
Distribution: SuSe9.3
Posts: 143

Rep: Reputation: 15
easy python code

Can anybody here give me an example of a simple python program that reads a text file (let's say /home/joeuser/ex.txt) into a string, then prints it to the screen?

I'm nearly certain I know how to do it (I've done it before), but for some reason I'm getting an error. I suspect my python libraries are screwed up.
Old 01-21-2005, 02:40 AM   #2
Mega Man X
LQ Guru
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Tell us how you are doing, so we can debug it . Link:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is wrong with this python code ? indian Programming 5 09-22-2005 03:20 PM
Getting the web page in python :: What's wrong with the code ? indian Programming 1 09-12-2005 04:17 PM
converting vb6 code to python mrobertson Programming 2 06-02-2005 02:27 PM
I need a python code that activate a button Linh Programming 0 08-20-2004 11:47 AM
Trouble Python Code Gerardoj Programming 0 11-30-2003 05:31 PM

All times are GMT -5. The time now is 03:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration