Top "File" questions

A block of arbitrary information, or resource for storing information, accessible by the string-based name or path.

How to open a file using the open with statement

I'm looking at how to do file input and output in Python. I've written the following code to read a …

python file python-3.x file-io io
How can I use a batch file to write to a text file?

I need to make a script that can write one line of text to a text file in the same …

file batch-file text
How do you read a file into a list in Python?

I want to prompt a user for a number of random numbers to be generated and saved to a file. …

python file
Reading specific lines only

I'm using a for loop to read a file, but I only want to read specific lines, say line #26 and #30. …

python file line
FileNotFoundError: [Errno 2] No such file or directory

I am trying to open a CSV file but for some reason python cannot locate it. Here is my code (…

python file find
Easiest way to read from and write to files

There are a lot of different ways to read and write files (text files, not binary) in C#. I just …

c# .net string file file-io
Convert DOS line endings to Linux line endings in Vim

If I open files I created in Windows, the lines all end with ^M. How do I delete these characters …

linux vim file editor dos2unix
How to delete the contents of a folder?

How can I delete the contents of a local folder in Python? The current project is for Windows, but I …

python file
Is there a way to check if a file is in use?

I'm writing a program in C# that needs to repeatedly access 1 image file. Most of the time it works, but …

c# .net file file-io file-locking