Learning Technology Blog

A blog about the use of educational technology in language learning and teaching

Sunday, August 21, 2016

Read text file in Python

1)  
f = open( "rockyou.txt", "r" ) 
for line in f:
    print line
 
2)
 
with open("rockyou.txt", 'r') as f:
    for line in f:
        print line
Posted by Unknown at 1:19 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: Python

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Labels

  • C# (2)
  • Java (11)
  • Nginx (1)
  • Postgres (1)
  • Python (4)
  • Tor (1)

Blog Archive

  • ►  2018 (1)
    • ►  June (1)
  • ►  2017 (2)
    • ►  May (1)
    • ►  January (1)
  • ▼  2016 (17)
    • ►  December (1)
    • ►  November (1)
    • ►  September (1)
    • ▼  August (14)
      • Read csv file with header
      • The Image Module
      • Read text file in Python
      • Validate email with regex
      • Convert InputStream to JSONObject
      • Send sms via twilio api
      • Calculate age in Java
      • Convert List String to bytes and bytes to List String
      • Getting a name for someone to connect back to your...
      • Token Authentication for Java Applications
      • The 12 Step Program to Realizing Your Java Monitor...
      • It’s easy to document your Play Framework REST API...
      • Manage your API Keys with Java, Jersey, and Stormpath
      • What is the difference between primitive type and ...

About Me

Unknown
View my complete profile
Powered by Blogger.