os.environ['HOME']+'/.xsend' what it means

Recommended Answers

All 3 Replies

It means a string representing the file system path to the file or directory .xsend in your home directory. A better way to obtain it is

os.path.join(os.path.expanduser('~'), '.xsend')

This code is better because it is cross-platform.

while typing this command getting path like "/home/weber/.xsend"
but my file located at /home/weber/jbwrk/xsend.py
why ??

Because your home directory is /home/weber. If you want the other path, use

os.path.join(os.path.expanduser('~'), 'jbwrk', 'xsend.py')

However, I think /home/weber/.xsend was probably meant. It may be a configuration file or directory. Try

ls -a ~

to see if there is a .xsend in your home directory.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.