0

I'm sorry if it's a trivial question, but couldn't find an answer for.

I'm really new to python and decided to use pycharm because I used to work with intellij in my previous job (Java).

Well, I wanna debug the code in pycharm, and in order to debug a project without providing any parameter it was just straight forward, just double click on the python file and choose debug...

The thing is, in order to run the project that I'm working on I have to run the following code on terminal

clear; clientid=d57f00e-8a58-c9e647144947 clientsecret="gGO1XjHly/NQZZvTTWET=" keyvaultidentifier=ty-keyvault tenant=9091f191-4969-4532-82ba-f9a96db6f8a6 environment=dev python3 -m testing_server

My question would be: How can I make this command a running command where I can debug the code on pycharm?

I found an option Run > Edit configuration > Python, but somehow didn't really understood what to place where

enter image description here

Any tips? Sorry for the trivial question, it just it's taking too long to do something so simple.

Cheers.

3 Answers 3

1

It seems you don't have any run configs, below is a screen shot of an example:enter image description here

Also, to use command line arguments, you can use the click module:

https://click.palletsprojects.com/en/7.x/

Sign up to request clarification or add additional context in comments.

1 Comment

Can't thank you enough mate! It does work like a charm! Thank you! I would just add that in order to work, I also had to import os, then used os.system("my command here") and boom! Worked!
0

This Post is also answerd here: Pycharm Run Parameters

In the field Script Parameters put your Parameters inside, for exampale: "gGO1XjHly/NQZZvTTWET=" but dont forget the double quotes.

in the Field Interpreter options you are putting the flag to call, for example: -clientsecret

Comments

0

you should create a new file like dev.py inside your settings folder like.

[projectname]/
├── [projectname]/
│   ├── __init__.py
│   ├── [projectname]/
│   │   ├──settings.py
│   │   └──dev.py
│   ├── urls.py
│   └── wsgi.py
└── manage.py

load it when the project is in debug mode. and that file would contain all these values.

clientid=d57f00e-8a58-c9e647144947
clientsecret="gGO1XjHly/NQZZvTTWET=" 
keyvaultidentifier=ty-keyvault 
tenant=9091f191-4969-4532-82ba-f9a96db6f8a6 

and for debug. create a run config

like below

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.