I don't usually develop in Python but I have a few IDE's and Code Editors that I often use and switch between. To make it more convenient for myself, I thought I'd make a quick Python program that launches my IDE's/Editor's based on an input. The issue is, every time I run the program, the first if-statment always validates as true and runs that action.
Here is my code:
import os
#NOTE: I have trimmed the root directories here to save space. Just removed the subfolder names, but the programs are the same.
notepadPlusPlusLaunch = "C:\\Notepad++\\notepad++.exe"
bracketsLaunch = "C:Brackets\\Brackets.exe"
aptanaLaunch = "C:Aptana Studio\\AptanaStudio3.exe"
devCppLaunch = "C:Dev-Cpp\\devcpp.exe"
githubLaunch = "C:GitHub, Inc\\GitHub.appref-ms"
androidLaunch = "C:android-studio\\bin\\studio64.exe"
ijLaunch = "C:bin\\idea.exe"
pycharmLaunch = "C:JetBrains\\PyCharm 4.0.5\\bin\\pycharm.exe"
sublimeLaunch = "C:Sublime Text 3\\sublime_text.exe"
def launcherFunction(command):
os.startfile(command)
launchCommand = input("")
if launchCommand == "notepad" or "npp" or "n++" or "n":
launcherFunction(notepadPlusPlusLaunch)
elif launchCommand == "brackets" or "b":
launcherFunction(bracketsLaunch)
elif launchCommand == "aptana" or "as" or "webide":
launcherFunction(aptanaLaunch)
elif launchCommand == "dcpp"or "c++":
launcherFunction(devCppLaunch)
elif launchCommand == "gh" or "github" or "git" or "g":
launcherFunction(githubLaunch)
elif launchCommand == "android" or "a" or "as":
launcherFunction(androidLaunch)
elif launchCommand == "java" or "ij" or "idea" or "j":
launcherFunction(ijLaunch)
elif launchCommand == "python" or "pc" or "p":
launcherFunction(pycharmLaunch)
elif launchCommand == "code" or "sublime" or "html" or " " or "s" or "php" or "css" or "js" or "jquery":
launcherFunction(sublimeLaunch)
elif launchCommand == "help":
print(notepadPlusPlusLaunch, "\n", bracketsLaunch, "\n", aptanaLaunch, "\n", devCppLaunch, "\n",githubLaunch, "\n", androidLaunch, "\n", ijLaunch, "\n", pycharmLaunch, "\n", sublimeLaunch, "\n", musicLaunch,"\n")
else:
print("Invalid Entry")
I'm not getting any errors but everytime I run this, the first if-statment always validates as true. So from this code, it keeps launching Notepad++. Can anyone tell what what I'm doing wrong? Thank you in advance!