Skip to content

Magenaut

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

path

PyCharm current working directory

August 17, 2022 by Magenaut

Recently, I’m unable to use relative paths in my code while using PyCharm. For instance, a simple open('test.txt', 'r') will not work – whereupon I am sure the file exists in the same level as the running py file. PyCharm will return this error.

Categories Python, Q&A Tags path, pycharm, python Leave a comment

How can I find where Python is installed on Windows?

August 17, 2022 by Magenaut

I want to find out my Python installation path on Windows. For example:

Categories Python, Q&A Tags path, python, windows Leave a comment

Set up Python on Windows to not type “python” in cmd

August 17, 2022 by Magenaut

How do I have to configure so that I don’t have to type python script.py but simply script.py in CMD on Windows?

Categories Python, Q&A Tags cmd, path, python, windows Leave a comment

Why doesn’t os.path.join() work in this case?

August 17, 2022 by Magenaut

The below code will not join, when debugged the command does not store the whole path but just the last entry.

Categories Python, Q&A Tags path, python Leave a comment

Python: Platform independent way to modify PATH environment variable

August 17, 2022 by Magenaut

Is there a way to modify the PATH environment variable in a platform independent way using python?

Categories Python, Q&A Tags cross-platform, environment-variables, path, python Leave a comment

Python list directory, subdirectory, and files

August 17, 2022 by Magenaut

I’m trying to make a script to list all directory, subdirectory, and files in a given directory.
I tried this:

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

How to configure Atom to run Python3 scripts?

August 16, 2022 by Magenaut

In my terminal, I type $ which python3, outputting

Categories Python, Q&A Tags atom-editor, path, python, python-3.x Leave a comment

mixed slashes with os.path.join on windows

August 15, 2022 by Magenaut

I tend to use only forward slashes for paths (‘/’) and python is happy with it also on windows.
In the description of os.path.join it says that is the correct way if you want to go cross-platform. But when I use it I get mixed slashes:

Categories Python, Q&A Tags path, python, windows Leave a comment

Unexpected python paths in conda environment

August 15, 2022 by Magenaut

In a conda environment (base here) I’m surprised by the order of directories in the python path:

Categories Python, Q&A Tags conda, path, python Leave a comment

Why use sys.path.append(path) instead of sys.path.insert(1, path)?

August 15, 2022 by Magenaut

Edit: based on a Ulf Rompe’s comment, it is important you use “1” instead of “0”, otherwise you will break sys.path.

Categories Python, Q&A Tags path, python, python-import, pythonpath Leave a comment
Older posts
Newer posts
← Previous Page1 … Page3 Page4 Page5 … Page7 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