编写程序的最后一个基本步骤就是从文件读取数据和把数据写入文件。
The last basic step involved in writing programs is to read data from and write data to a file.
这篇文章讨论了在Python程序中如何从文件读取数据和写入数据到文件中。
This article discussed how to read and write data to a file from a Python program.
通过使用复合过程,客户机可以将LOOKUP、OPEN和READ操作组合到一个RPC请求中,这样客户机只需一次请求就可以从文件中读取数据。
By using compound procedures, clients can read data from a file in one request by combining LOOKUP, OPEN, and read operations in a single RPC request.
例如,如果从文件系统读取数据,您可以使用清单8中的代码。
For example, if you read data from the file system, you can use the code in Listing 8.
使用这个函数,构建根据给定参数从文件或用户输入读取数据的程序就不难了。
Using this, it wouldn't be difficult to build a program that read from files or user input depending on the arguments given.
我们可以在YY _ INPUT宏中添加一个对GetNextChar函数的调用,后者从文件中读取数据,并保留了下一个要读取的字符的位置信息。
You can add a call in YY_INPUT to the function GetNextChar , which reads the data from a file and keeps information about the position of the next character to read.
Web服务测试应用程序通过模拟的服务从XML文件中读取配置数据。
The Web services test application reads the configuration data from the xml file via the simulated services.
通过组合使用head和tail,可以从文件的中间部分读取给定长度的一块数据!
By combining head and tail, you can read a chunk of data of the given length from the middle of the file!
建立一个while循环从stdin中读取数据,这样可以将dots文件中的各项内容提取出来。
With a while loop set up to read from stdin, the various components of the dots file are extracted.
同时,虽然LogParser默认从标准输入中读取数据,但是你也可以指定一个来自运行时服务器的日志文件,用LogParser实时输出。
Also, since by default the LogParser reads from standard input, you can pipe a log file from a running server to the LogParser to get output generated in real time.
要从队列中读取消息(在本例中最终涉及到从文件系统中读取数据,因为我们使用文件系统的JNDI标识符),使用清单11中的代码。
To read the message from the queue (which in this case ultimately involves reading from the file system since we use the JNDI identifier for the file system), use the code in Listing 11.
从文件中读取内容的操作是非常直截了当的:我们打开一个文件流对象,创建一个数组来放置数据,最后把所有数据都读到这个数组中。
The operation of reading from a file is very straight forward, we open a file stream, create an array to hold the data, and finally read all the data into the array.
这段代码从清单9所示的XML文件中读取数据,然后将它变为表格格式。
This code reads data from the XML file shown in Listing 9 and formats it into a table.
在这种模式中,次要服务器从暂存文件中读取数据,并从主要服务器直接接收新数据。
In this mode, the secondary reads data from the staging file and receives new data from the primary directly.
在将文件从磁盘读取到内存时对文件解密,因此文件数据能够以明文格式保存在内存中。
The files are decrypted when they are read from the disk into memory so that the file data kept in memory is in clear format.
从外部表选择可从一个或多个数据文件读取数据,并以行和列的形式提供该数据,就好像从常规基表读取数据一样。
Selecting from an external table reads the data from the data file(s) and provides it in the form of rows and columns as if it was read from the normal base table.
在监视器文件的文件描述符仍然打开的情况下,监视应用程序可以从删除的监视器文件读取事件数据,但是不再继续等待事件发生。
Monitoring applications may read event data from deleted monitor files while the file descriptor for the monitor file is still open but may not block for further event occurrences.
从HDAPS传感器读取数据非常简单,由于其不可查找特性,每次读取数据时都需要打开和关闭文件。
Reading data from the HDAPS sensor is a straightforward process requiring an open and close of the file at each read due to its nonseekable nature.
缓冲区缓存——为存储从物理数据文件读取的数据块而分配的内存。
Buffer Cache - Memory allocated for storing data blocks read from physical data files.
对快照的读取将需要执行查找,以确定是从快照还是从原始文件系统读取所需的数据块。
A read of the snapshot will require a lookup to determine whether the block needed should be read from the snapshot or from the original file system.
分步讲解了如何从平面文件读取业务数据,将此数据转换成XML并用转换后的数据填充数据仓库。
It provides step-by-step instructions for reading business data from a flat file, transforming this data into XML, and populating a data warehouse with the transformed data.
您将使用RFHUTIL实用程序从文本文件中读取文件,并将数据作为消息发送给由队列管理器QMGR900管理的EXPORTQ本地队列。
You will use the RFHUTIL utility program to read a file from a text file and send the data as a message to the EXPORTQ local queue managed by the queue manager QMGR900.
它们是从系统资源(例如文件系统或系统内核)读取需要处理的数据,然后将结果写入到stdout。
Instead, they read the data they should process from system resources, such as the file system or the system kernel, and write results to stdout.
但是如果您将- i命令配置替换为- t(执行),框架工具会从XML文件中读取数据源配置,并应用它以运行服务器。
But if you replace the -i command with -t (execute), the framework tool reads the data source configuration from the XML file and applies it to the running server.
可以从数据库或者XML文档或者属性文件中读取people数据,然后把这些数据转换成Person对象,再把这些对象传递给处理组件。
You might read in people from a database, from an XML document, and from properties files, convert the data into Person objects, and then pass those objects into your processing component.
Perl驱动程序可以直接从文件中读取数据,并将数据传递给数据库服务器。
The Perl driver will read directly from the file and transfer the data to the database server.
例如,筛选器可以读取文件,从视频捕获设备获取视频,解码各种流格式,以及将数据传递到图形卡或声卡。
For example filters can read files get video from a video capture device decode various stream formats and pass data to the graphics or sound card.
否则,这个bean从与bean一起被导入的本地资源文件中读取现成的数据。
Otherwise, the bean reads canned data from the local resource files imported with the beans.
RFHUtil允许您从/对文件或者队列读取/写入数据,并采用各种不同的格式来显示数据。
RFHUtil lets you read and write data from and to files or queues, and display data in a variety of formats.
RecordFileFacade负责从文件中读取数据,并成批将它们送入记录中。
The RecordFileFacade is responsible for reading the data from the file and chunking it into records.
应用推荐