txt tag

14 questions


1 answers
388 views
0
What does .readlines()[:5] mean when File I/O and what does sourcefile/targetfile mean

First, the code is as followsSourceFile = open(example_dir/lipsum/lipsum.txt, r)TargetFile = open(copied.txt, w)for line in SourceFile.readlines()[:5]: TargetFile.write(line)TargetFile.close()SourceF...

1 years ago

1 answers
129 views
0
Where on earth should I put robots.txt?

I uploaded the created site to the server -> Naver search registration was requested -> Webmaster Diagnostics When I turned around, I found that there were no robots.txt.Write a question because...

2 years ago

1 answers
80 views
0
When creating an exe file with pyinstaller, how to include text files together

import shutilimport osimport timedef do(): filename = 'GameUserSettings.ini' username = os.getenv('USERNAME') #dir = 'C:\\Users\\' + username + '\\AppData\\Local\\' dir = 'C:\\Users\\' + username + '\...

2 years ago

2 answers
86 views
0
How do I extract only the required columns from a txt or csv file and save them as a txt file?

with open('file name.csv') as file: csv_data = [] for line in file.readlines(): csv_data.append(line.split(','))I know how to divide rows and columns.Invoke only the columns you needI don't know how ...

2 years ago

1 answers
118 views
0
Python numpy gen from txt question

You are currently performing an operation to read the txt file to Python numpy. Other data are neatly gathered (second image), while only certain data (first image) are like this, so I'm having troubl...


3 answers
124 views
0
To output a text file

I worked with Python to print the ALE.txt file in the picture like output.txt, but it's blocked to some extent. Can you help me?I made it roughly, but I don't know what to do from here.I don't know if...

2 years ago

1 answers
109 views
0
I read a text file in Python, and I wonder how to read it from a specific line

For example, like thisReports Contents Number Name Gender 1 Hong Gil-dong Nam 2 Kim Chul-soo Nam 3 Lee Young-hee female When text is written like this, if you're trying to get only gender content, how...

2 years ago

1 answers
121 views
0
Find the average, maximum, of the three groups separated by a specific delimiter in the txt file

Notepad file txt file ======1.234234453==============2323343=======In this way, we have to divide into three groups according to ====== and find the average or maximum value of those values, but I'm n...

2 years ago

1 answers
104 views
0
Modifying and saving Python text files

If you use the open() function in Python, you can read, write, and add text filesWhat I want is to modify the existing file and save it right away.First of all, I'll give you a quick example of what I...


1 answers
72 views
0
[C language] If I enter 5 strings in a text file, is the text file 1 string? Is it five?

Current code.The appearance stored in the text file.When you try to save a string in a text file to a string array How should I give the size of the string out of 1 or 5?

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.