Skip to content

Setting Up Project in Visual Studio 2017

thompcd edited this page Nov 24, 2017 · 2 revisions

Follow these steps if wanting to use VS17 as your IDE - the following options will:

  • Place your project in same location as your local GIT clone
  • Properly display python project tree in VS Solution Explorer
  • Allow execution of the project using built-in VS functions (hitting "Start" button runs "Python main.py")
  • Show how to alter script arguments through VS (will run "Python main.py north" through these settings)
  1. Clone Repo to local [directory = "ExistingPythonCodeDirectory"]

  2. (Within VS) File -> New Project [FromExistingPythonCode = True] [Name = "MyProjectName"] [Location = "ExistingPythonCodeDirectory"] [CreateNewSolution = True] [SolutionName = "MySolutionName"] [CreateDirectory = False] [CreateGITRepo = False] -> Next (Wizard Pops Up)

  3. (Within Project from Existing Python Code Wizard) [directory = "ExistingPythonCodeDirectory"] [filter = default] [SearchPaths = "ExistingPythonCodeDirectory\chinesepostman, ExistingPythonCodeDirectory\data, ExistingPythonCodeDirectory\tests] -> Next

  4. [PythonInterpreter = Default] [FileToRunWhenF5 = "main.py"] -> Next

  5. [SaveProjectLocation = "MyDesiredProjectLocation"] [DetectVirtualEnvironments = True] [CustomizeProjectType = False] ->Finish

  6. (Within VS) File -> Open -> Project/Solution -> [project= "ExistingPythonCodeDirectory""MyProjectName" + ".pyproj"]

  7. (Within VS Solution Explorer) RightClick Project "MyProjectName" -> Properties [ScriptArguments = "north"] -> Save

  8. (Within VS Solution Explorer) LeftClick Project "MyProjectName" -> F5 (OR StartButton from top toolbar)

-- You should have successfully ran the project for the first time.. Congrats!

Clone this wiki locally