From the course: Learning Assembly Language
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Reading data files - Python Tutorial
From the course: Learning Assembly Language
Reading data files
- [Instructor] We've used the console as a form of input and output, but let's take a look at how we work with data files. I've prepared a file called ode.txt. From the first verse of Thomas Gray's, "Ode on a Favorite Cat Drowned in a Bowl of Goldfish". Let's see how we read this. I've created a program to read it and display it in both ASCII and Hex. So let's take a look through it. We start with a constant section, which creates attribute names for the file management attributes we're using. And see, these are normally included in the .H files, which we could set up and use in the project. However, as there's just a few of them, we'll include them here. Lines nine to 14, have the various console and file handles and byte returned fields we'll need. Line 16 to 21 have the various string and output line buffers we'll be using. After our standard entry code, we have a small callable routine called hexed, which will…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Calling subprograms9m 20s
-
Working with floating point6m 23s
-
Managing arrays4m 43s
-
Adding plugs to the Enigmatic encryptor2m 54s
-
The Windows API5m 4s
-
More on the Windows API4m 20s
-
Calling the printf external function1m 33s
-
Executing system commands1m 54s
-
Jump tables3m 29s
-
Reading data files6m 33s
-
-
-
-
-