command-line

"Cannot find the path specified" when setting up patent crawler

"Cannot find the path specified" when setting up patent crawler Question: I am trying to set up the wenyalintw patent scraper. I got everything installed. I then go to execute the command cd src main.py and it tells me the system cannot find the path specified. I tried changing it to cd src "path to …

Total answers: 1

Taking txt files with unknown names as parameters (Python)

Taking txt files with unknown names as parameters (Python) Question: I am trying to write a program in Pycharm that can take the name of 2 txt files as an input and then use that input to execute some set of instructions. I understand I can put the name of a txt file in the …

Total answers: 1

how to pass multiple flags in argparse python

how to pass multiple flags in argparse python Question: I am trying to pass multiple flags, basically two flags. This is what my code looks like parser.add_argument(‘–naruto’, action=’store_true’) parser.add_argument(‘–transformers’, action=’store_true’) parser.add_argument(‘–goku’, action=’store_true’) parser.add_argument(‘–anime’, action=’store_true’) I know action=’store_true’ makes it a flag. basically in the command line I will pass the arguments like => nameOfTheScript.py –goku …

Total answers: 1

running subprocess with combined cd and pwd

running subprocess with combined cd and pwd Question: I run subprocess in jupyter to get the core path. I have to go one folder up and then call pwd Running: import subprocess mypath=subprocess.run("(cd .. && pwd)") leads to a "No such file or directory: ‘(cd .. && pwd)’ error. I guess the cd calls a …

Total answers: 3

Pylint fail under does not fail my Github action job

Pylint fail under does not fail my Github action job Question: I am trying to implement a python linter using pylint. But i am getting the score of each python file and also displaying the suggestion to improve the score but I am also looking to terminate the GitHub action job if my pylint score …

Total answers: 3

Line wrap long `python -c` command to be < 80-chars

Line wrap long `python -c` command to be < 80-chars Question: I have a Python two-liner to set an environment variable, which I run in bash: ENV_VAR=$(python -c "from some_package import some_long_command; print(some_long_command())") In bash, one can use to line wrap long commands. I am looking for an equivalent within python -c. Is there some …

Total answers: 1

Pyinstaller Is Not Recognized

Pyinstaller Is Not Recognized Question: I know this question has been asked before and I have researched and used the following steps to no avail, each one of them: Pyinstaller is not recognized as internal or external command 'pyinstaller' is not recognized as an internal or external command, operable program or batch file Pyinstaller not …

Total answers: 3

FastAPI keeps throwing an error loading (ASGI app)

FastAPI keeps throwing an error loading (ASGI app) Question: the file name is main.py anytime i run uvicorn main:app –reload i get the error under the code. from fastapi import FastAPI app = FastAPI() @app.get("/") async def root(): return {"message": "Hello World"} Error INFO: Will watch for changes in these directories: [‘/Users/Documents/main.py’] INFO: Uvicorn running …

Total answers: 2

How to start a Plex stream using python-PlexAPI?

How to start a Plex stream using python-PlexAPI? Question: I’m making a python script using the module PlexAPI. My goal is to start a stream on the client Chrome. The movie to view has the key /library/metadata/1. Documentation and sources of code: playMedia documentation Example 4 is used but changed to fit my requirements I’m …

Total answers: 1