473,404 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

home variable?

The internet is terrible for searching for these kinds of things... How do I get the home variable in python again? Like, if the program is run on an unix system, it'll return /home/user, and on windows it'll return c:\Documents and Settings\User or something like that?
Sep 9 '09 #1
2 2235
bvdet
2,851 Expert Mod 2GB
Builtin os.environ returns a dictionary of environment variables. On my system (XP), the dictionary key is 'USERPROFILE' or 'HOMEDRIVE' + 'HOMEPATH'.
Sep 9 '09 #2
Thanks! That's going to be a great help in the future!
Sep 9 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Johan Louwers | last post by:
I have a qustion. I have to set a JAVA_HOME variable on a Solaris9 system... what kind of a variable? A system-defined.../....a user defined.../.....???? and how do I set this so java can...
1
by: Sperry Russ | last post by:
Hello, I am a beginner in programming and to python. I am using it to learnprogramming. I am using Windows 2000 Pro. I installed Python 2.3.1 withthe installer which installed it to: C:\Python23....
4
by: Luca T. | last post by:
Hello, i need a way to find the home folder of the current user no matter if i am in Linux or Windows for instance: * Linux: /home/username * Windows: C:\Documents and Settings\username Is...
11
by: jim.eggleston | last post by:
Windows doesn't have a HOME environment variable, but it does have HOMEDRIVE and HOMEPATH. Could Windows versions of Python automatically populate os.environ with HOME, where HOME =...
3
by: Nath | last post by:
I have installed .NET SDK on Windows XP Home. I also have installed ASP.NET Web Matrix and I am able to run ASP.NET programs in C# using Cassini. I can not figure out where is C# compiler. I...
1
by: Brian | last post by:
Hello I am trying to implement 'Search' (Basic Keyword search) functonality on a site. Home page has a search text box and a 'GO' button. When users will type in a keyword and presses 'GO', URL...
1
by: steggun | last post by:
How can I always redirect any user to the "home" page? Basically, a user could enter a full URL in the address bar or bookmark a specific page so that they can go directly to that page. However,...
0
by: phil469 | last post by:
I'm having an issue when trying to read a file in a user's homedir from a cgi script. I have a virtual host section in my httpd.conf file which I'll include. The cgi script is a very basic script...
1
by: Josh | last post by:
I have a question about subdomains. I would like my website to have subdomains that essentially show my regular main website, except that the subdomain passes as a variable on all pages so that I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.