|
by: peter leonard |
last post by:
Hi,
I having a problem with reading each line from a text file. For example, the
file is a text file named 'test.txt' with the following content :
line 1
line 2
line 3
line 4
line 5
|
by: Edvard Majakari |
last post by:
Suppose you have a program containing commands and file name parameters.
A simple class providing completion could first read all the commands
to list, and extend that list later using all file names in given
directory. This way a user could tab-complete (using
readline.parse_and_bind('tab: complete')) any command and any file. Eg. if
a...
|
by: Laurent |
last post by:
Hello,
is it possible to read a file in python line by line
by redefining a new end-of-line delimiter ?
I would like for example to have the string "END" being the new delimiter
for each line.
Thanks
|
by: Newgene |
last post by:
Hi, group,
I have python2.3 installed on win2k. I noticed that when I open a
dos format text file (eol is '\r\n'), readline() always returns a line
ending with '\n' only, not '\r\n'. While I read the same file on unix,
it returns a line ending with '\r\n' correctly.
This makes me difficult to determine the format of a text file, dos or
unix....
|
by: Macisu |
last post by:
Hi
I am using the object Stream Reader to read Files. The method ReadLine()
does not read the character ñ o Ñ.
What Can i do?
Helpme please
thanks
|
|
by: CD |
last post by:
Hi,
I am getting a problem using the following piece of code:
Dim strfile As Object
Set strfile = FSO.OpenTextFile(stFilePath, 1)
Do While Not strfile.AtEndOfStream
strtext = strfile.ReadLine
Loop
|
by: Howard Kaikow |
last post by:
How does one determine the number of lines before using ReadLine.
This would enable the ReDim to be out of the loop.
sReader = New StringReader(xxx.GetObjectText_)
If Not (sReader Is Nothing) Then
i = -1
Do Until sReader.Peek = -1
i = i + 1
ReDim Preserve yyy(i) ' yyy is typed as String
yyy(i) = sReader.ReadLine
|
by: Phoe6 |
last post by:
Hi all,
I just read the manual and got to know I can use a for loop to iterate
through the lines in the file.
But so far, I was strugling with the following:
import os
file = open('File1.txt','r')
line = file.readline()
while line !=' ':
|
by: kj |
last post by:
I'm trying to subclass file, overriding the readline method. The
new method definition begins with
def readline(self, size=None):
line = self.file.readline(size)
# etc., etc.
....where the self.file attribute is a regular file object.
This works fine if I invoke the new method with an integer argument,
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
|