Wikipedia:Reference desk/Archives/Computing/2018 June 2
Computing desk | ||
---|---|---|
< June 1 | << May | June | Jul >> | June 3 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
June 2
Two programs having the same name in Windows
I've got two versions of the Python interpreter (2.4 and 3.6). Both are called "python" but are in different directories. To execute a script (just a text file) with Python 3.6 I go: right-click the script, "Open with...", "Choose default program", "Browse", get to Python 3.6 and click "Open". But the script gets executed with Python 2.4. Now if I rename the Python 3.6 executable to "python36" then the script gets executed with Python 3.6 as I want. Why? Does anyone understand what's going on? Thanks. Basemetal 13:33, 1 June 2018 (UTC)
- You should search the internet for how to run two versions of Python simultaneously. Ruslik_Zero 19:43, 2 June 2018 (UTC)
- Install the version you'll really use as the last one. It seems to be a problem in your PATH. You probably have PATH=c:\python\2.4;c:\python\3.6. Windows picks the first python it finds. --Doroletho (talk) 00:00, 3 June 2018 (UTC)
- What you say is no doubt true but is still no explanation of what's going on in this case, because, rememeber, I said I use "browse" and then explicitly open the version I want and Windows still manages to pick the other one. Your advice to just ditch one Python version is good except I can't for the moment as one version is used by GNUSolfège and the other is the one I use. Once I can get rid of GNUSolfège, which I only have in order to find out how to access my sound module from Python, then "uninstalling" GNUSolfège will automatically get rid of that version of Python. I do for the moment get by with the workaround of renaming one of the two Python executables, but I do find the question itself ("theoretically") interesting so I was curious. Basemetal 15:47, 3 June 2018 (UTC)
- I have no serious idea what causes the described behaviour. I can speculate that when you do "open
foo
with/some/dir/stuff.exe
", what really happens behind the scenes iscd /some/dir; stuff foo
and then thestuff
is taken from the path rather than from the current directory, but that would mean (1) that the path comes before the current dir in the priority order and (2) that "open with..." does not use the natural implementation/some/dir/stuff foo
, both of which seem improbable.
- However, instead of manually browsing to the Python version you want... The "good" solution is a shebang line at the start of the script to tell the OS which of the Python versions to use. That is not available on Windows, but there are ways to make it work (assuming you have admin rights, at least). TigraanClick here to contact me 07:45, 5 June 2018 (UTC)
- You probably launch not a python executable by a python launcher ('py'). It can launch any version of python if configured appropriately. See this. Ruslik_Zero 09:19, 6 June 2018 (UTC)
- Not clear who you're replying here but your link is useful, so thanks. Are you an experienced Python programmer? Basemetal 16:33, 6 June 2018 (UTC)
- And by the way, thanks also to the other respondents namely Doroletho and especially Tigraan. Basemetal 16:35, 6 June 2018 (UTC)
Workspaces, virtual desktops in Windows (or the lack thereof)
Why hasn't Microsoft integrated workspaces earlier on in their OS? After all, it's a pretty cool feature, and MS has a long track record of copying cool stuff from other OS. It just appear as 'Task View' in Windows 10. There was also Windows XP PowerToy, but this was not really a central aspect of the OS.--Doroletho (talk) 23:58, 2 June 2018 (UTC)
Windows Error (Major)
My PC ran into an error along the lines of "Windows ran into a problem, we will collect error info then you can restart" after I restarted there is literally nothing on the hard drive anymore (not even the OS or partitions. I would be very grateful if anyone can tell me if they have experienced this before or how to help. Thank you in advance! — Preceding unsigned comment added by 185.222.216.187 (talk) 23:59, 2 June 2018 (UTC)
- This sounds like a serious problem with your hard drive. I suppose it could be malware, but I'd try booting from a CD or thumb drive, then examining the hard drive. Perhaps someone here can recommend the best recovery software to use, but don't write anything to your hard drive in case it overwrites important files. Normally, windows will run checking and repair software, but if it cannot load the system, then it is not able to do this. I hope you have a backup of your data. Dbfirs 06:54, 3 June 2018 (UTC)