Codeigo

Just programming

Skip to content
  • Python
  • PowerShell
  • About Me

How to Check if a File Exists in Python [Ultimate Guide]

When you write Python scripts, you may want to perform certain actions, such as reading or writing to a file, only if the file exists.

Continue reading →
This entry was posted in Python on September 28, 2021 by Tomasz Decker.

Save a NumPy Array to a Text File in Python

You can save the NumPy array to a text file using the savetxt() function.

Continue reading →
This entry was posted in Python on September 2, 2021 by Tomasz Decker.

Add to a Dictionary in Python

If you work with data structures, such as dictionaries, you may wonder whether you can add or append an item the same way as you can do it with a list? Read the rest of the article to find out.

Continue reading →
This entry was posted in Python on August 18, 2021 by Tomasz Decker.

Remove Character from String in Python

The replace() function searches for a specified pattern in a string and replaces it with another specified string.

Continue reading →
This entry was posted in Python on August 13, 2021 by Tomasz Decker.

Convert String to Hex in Python

The hex() function can be used to convert a string to a hexadecimal value. Before using the function the value has to be converted to bytes.

Continue reading →
This entry was posted in Python on August 11, 2021 by Tomasz Decker.

Convert Hex to String in Python

This is a tutorial on how to convert hexadecimal numbers to strings in Python. When working with hex numbers, it can be difficult to read or compare them, so converting them to strings will make the process easier.

Continue reading →
This entry was posted in Python on August 11, 2021 by Tomasz Decker.

Append Text to a File in Python

Python offers several file access modes. One of them is “append”. This mode allows you to place the cursor at the end of the text file to insert the new lines there.

Continue reading →
This entry was posted in Python on July 21, 2021 by Tomasz Decker.

Remove a String From a List in Python

Elements from the list (including strings) can be deleted using the remove() function.

Continue reading →
This entry was posted in Python on July 13, 2021 by Tomasz Decker.

Convert String to JSON in Python

Function json.loads() accepts JSON string and converts it to Python dictionary (deserialization). The last letter in load(s) stands for “string”.

Continue reading →
This entry was posted in Python on July 13, 2021 by Tomasz Decker.

How to Write to Text File in Python

To write to a text file in Python, you have to use the open() and write() functions. The open() function takes two parameters: file name and file access mode. The returned value of open() is the file object.

Continue reading →
This entry was posted in Python on July 12, 2021 by Tomasz Decker.

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Python Class Object Is Not Callable
  • Replace Single Quotes With Double Quotes in Python
  • Convert HEX to RGB and HSV in Python
  • Replace Forward Slash With Backslash in Python
  • Make Python Wait For a Pressed Key
Proudly powered by WordPress