Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

file

Directory-tree listing in Python

August 20, 2022 by Magenaut

How do I get a list of all files (and directories) in a given directory in Python?

Categories Python, Q&A Tags directory, directory-tree, file, python, subdirectory Leave a comment

How to open a file using the open with statement

August 20, 2022 by Magenaut

I’m looking at how to do file input and output in Python. I’ve written the following code to read a list of names (one per line) from a file into another file while checking a name against the names in the file and appending text to the occurrences in the file. The code works. Could it be done better?

Categories Python, Q&A Tags file, file-io, io, python, python-3.x Leave a comment

How to check whether a file is empty or not

August 20, 2022 by Magenaut

I have a text file. How can I check whether it’s empty or not?

Categories Python, Q&A Tags file, file-length, python Leave a comment

Importing variables from another file?

August 19, 2022 by Magenaut

How can I import variables from one file to another?

Categories Python, Q&A Tags file, import, python, variables Leave a comment

How to write to a CSV line by line?

August 19, 2022 by Magenaut

I have data which is being accessed via http request and is sent back by the server in a comma separated format, I have the following code :

Categories Python, Q&A Tags csv, file, io, python, string Leave a comment

How to open every file in a folder

August 19, 2022 by Magenaut

I have a python script parse.py, which in the script open a file, say file1, and then do something maybe print out the total number of characters.

Categories Python, Q&A Tags file, pipe, python, stdin, stdout Leave a comment

Python convert csv to xlsx

August 19, 2022 by Magenaut

In this post there is a Python example to convert from csv to xls.

Categories Python, Q&A Tags csv, excel, file, python, xlsx Leave a comment

How to read numbers from file in Python?

August 19, 2022 by Magenaut

I’d like to read numbers from file into two dimensional array.

Categories Python, Q&A Tags file, python, python-3.x Leave a comment

Basic http file downloading and saving to disk in python?

August 19, 2022 by Magenaut

I’m new to Python and I’ve been going through the Q&A on this site, for an answer to my question. However, I’m a beginner and I find it difficult to understand some of the solutions. I need a very basic solution.

Categories Python, Q&A Tags download, file, python, save Leave a comment

How to convert a file into a dictionary?

August 19, 2022 by Magenaut

I have a file comprising two columns, i.e.,

Categories Python, Q&A Tags dictionary, file, python Leave a comment
Older posts
Newer posts
← Previous Page1 … Page5 Page6 Page7 … Page13 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress