command-line

Suppressing option processing after a non-option command-line argument

Suppressing option processing after a non-option command-line argument Question: I am writing a wrapper script using argparse which accepts a list of arguments that are going to be passed to another program, and some options that are specific to my wrapper. To avoid confusion regarding which options go where, I want any appearance of a …

Total answers: 1

How do I run a PowerShell script with parameters from Python

How do I run a PowerShell script with parameters from Python Question: I’m trying to run PowerShell scripts that have parameters from Python 3.7.3, but don’t know how to properly call the function in Popen What I’m trying to do with my PowerShell script is login to Cisco routers and run Cisco IOS commands on …

Total answers: 1

How to make a command that runs Python a script in Windows command line?

How to make a command that runs Python a script in Windows command line? Question: Background: I’m using Windows. I know some of programming with python. I don’t know much about batch, which I think I might need to do what I want. I will show a example so it becomes more clear what I’m …

Total answers: 1

How to pass several list of arguments to @click.option

How to pass several list of arguments to @click.option Question: I want to call a python script through the command line with this kind of parameter (list could be any size, eg with 3): python test.py –option1 [“o11”, “o12”, “o13”] –option2 [“o21”, “o22”, “o23”] using click. From the docs, it is not stated anywhere that …

Total answers: 6

Python, installing clarifai –> VS14.0 link.exe failed with exit status 1158

Python, installing clarifai –> VS14.0 link.exe failed with exit status 1158 Question: I’ve got a fresh installation of Python 3.6 + Selenium and now want to install Clarifai 2.0.21. The following command is failing: python -m pip install clarifai==2.0.21 At first it requested VC++ 14.0 but I had 14.1 (with VS2017), so I installed VC++2015 …

Total answers: 3

GIMP on Windows – executing a python-fu script from the command line

GIMP on Windows – executing a python-fu script from the command line Question: In a Windows environment, I would like to make a call to GIMP for executing a python-fu script (through a BAT file) but the command line call I am using does not produce the expected results. For example, consider the following python-fu …

Total answers: 3

How to change Keras backend (where's the json file)?

How to change Keras backend (where's the json file)? Question: I have installed Keras, and wanted to switch the backend to Theano. I checked out this post, but still have no idea where to put the created json file. Also, below is the error I got when running import keras in Python Shell: Using TensorFlow …

Total answers: 12

How to find which version of TensorFlow is installed in my system?

How to find which version of TensorFlow is installed in my system? Question: I need to find which version of TensorFlow I have installed. I’m using Ubuntu 16.04 Long Term Support. Asked By: Hans K || Source Answers: This depends on how you installed TensorFlow. I am going to use the same headings used by …

Total answers: 19

How to plot a chart in the terminal

How to plot a chart in the terminal Question: I’m researching ML/Theano, and recently came across this script: https://gist.github.com/notmatthancock/68d52af2e8cde7fbff1c9225b2790a7f which was cool to play with. And like all ML researchers, I recently upgraded to a server, and while it’s more powerful, it also presented me with a problem. The script is very long, but it …

Total answers: 8

Split large directory into subdirectories

Split large directory into subdirectories Question: I have a directory with about 2.5 million files and is over 70 GB. I want to split this into subdirectories, each with 1000 files in them. Here’s the command I’ve tried using: i=0; for f in *; do d=dir_$(printf %03d $((i/1000+1))); mkdir -p $d; mv “$f” $d; let …

Total answers: 6