-
Notifications
You must be signed in to change notification settings - Fork 25
Configure Python IDE Environment
-
- To know more about Docker - 12 mins video to understand Docker:YouTube Bilibili
- If you have installation problems on Windows. Please refer to windows-docker-problem-solutions
-
And you can choose one IDE below
-
- For further using and learning VSCode - Learn to code with VSCode
-
- For further using and learning Pycharm - Learn to code with Pycharm
-
-
Download Docker image according to your environment
docker pull svftools/software-security-analysis:latest
which can support X86(win, linux, macOS x86) and Arm64 (Mac M1 - M4)
If you encounter some problem, please check this document Trouble-Shooting-for-IDE.
*To install the extension, open the Extensions view (MAC: ⇧⌘X, Windows: Ctrl+Shift+X, Linux: Ctrl+Shift+X)
- Extension(1): Docker extension
- Search for
docker
to filter results and select Docker extension authored by Microsoft.
- Search for
- Extension(2): Remote Containers extension
- Search for
dev container
to filter results and select extension authored by Microsoft.
- Search for
Right click the container item and select 'Attach Visual Studio Code'
If you can't see the working directory, please select file -> open (folder)...
then enter the /home/SVF-tools/Software-Security-Analysis
- To install the extension, open the Extensions view (MAC: ⇧⌘X, Windows: Ctrl+Shift+X, Linux: Ctrl+Shift+X)
-
VSCode's built-in debugger helps your editing, compilation and debugging.
-
Check that python interpreter should be
/usr/bin/python3
. ClickSearch
-Show and Run Commands
-Python: Select Interperter
, and choose/usr/bin/python3
, which should be Python 3.10.
- Software-Security-Analysis has prepared configurations in
launch.json
in.vscode
folder to debug test.py in${workspaceFolder}/python/Assignment-1/Python
folder.
When working on different labs/assignments, change the "program"
and "args"
fields in launch.json
Lab/Assignment | "program" | "args" |
---|---|---|
Assignment-1 | "${workspaceFolder}/python/Assignment-1/Python/Main.py" | "-icfg", "Assignment-1/Tests/testcases/icfg/test1.ll" |
Assignment-2 | "${workspaceFolder}/python/Assignment-2/Python/Main.py" | "Assignment-2/Tests/testcases/sse/test1.ll" |
Assignment-3 | "${workspaceFolder}/python/Assignment-3/Python/Main.py" | "Assignment-3/Tests/ae/test1.ll" |
PyCharm is a powerful Python IDE. This section explains how to set up your project and work with pysvf
using PyCharm on Linux/macOS and Windows (via Docker).
- Download and install the Community or Professional edition from the official website:
👉 https://www.jetbrains.com/pycharm/download
If you're using Linux or macOS, you can install pysvf
directly in PyCharm terminal:
python3 -m pip install pysvf -i https://test.pypi.org/simple/
For Windows users, follow these steps to configure PyCharm with Docker:
-
Navigate to File > Settings > Project > Python Interpreter
-
Click Add Interpreter and select On Docker
-
Select Pull or use existing, enter svf-tools/software-security-analysis in the Image tag field, then click Next
-
If no errors appear in the output field, click Next
-
Click Create to finish the setup
-
Return to the Python Interpreter settings. If you see Remote Python 3.10.17 Docker(svf-tools/software-security-analysis), the configuration was successful