scripting

How do I see if the contents of a csv file exists as a file in another directory?

How do I see if the contents of a csv file exists as a file in another directory? Question: EDIT: To better explain my dilemma, I have a csv file that lists a number of applications numbered XXXXXX. Each of these applications have a corresponding xml file that exists in another directory. I’m essentially attempting …

Total answers: 2

Script to read parameters from file and mkdir and cp accordingly?

Script to read parameters from file and mkdir and cp accordingly? Question: I have a bunch of files in directories with a file that includes important data like author and title. /data/unorganised_texts/a-long-story Many files in the directories, but most importantly each directory includes Data.yaml with contents like this: Category: Name: Space Author: Jôëlle Frankschiff References: …

Total answers: 3

OBS crashes when set_current_scene function called within a timer callback (Python scripting)

OBS crashes when set_current_scene function called within a timer callback (Python scripting) Question: scenes = obs.obs_frontend_get_scenes() def script_load(settings): obs.obs_frontend_add_event_callback(onevent) def script_update(settings): global trigger, s_minutes, s_seconds, ending, e_minutes, e_seconds trigger = obs.obs_data_get_string(settings, "e_trigger scene") s_minutes = obs.obs_data_get_int(settings, "s_minutes") s_seconds = obs.obs_data_get_int(settings, "s_seconds") e_minutes = obs.obs_data_get_int(settings, "e_minutes") e_seconds = obs.obs_data_get_int(settings, "e_seconds") ending = obs.obs_data_get_string(settings, "s_ending scene") def …

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

What does the star * have to do with the glob in python?

How does the star * behave in Python's regex vs. glob pattern search? Question: I am trying to understand how glob works, also how is the star * related to glob and how it works vs. how it works in regex? For example, I know glob.glob("C:UsersMeMyFolder*.txt") would match and return any files with the extension …

Total answers: 1

How to overcome IO Error 13 in Python when running script using qBittorrent

How to overcome IO Error 13 in Python when running script using qBittorrent Question: I download a lot of linux ISOs torrents from the internet. I have made my own little python script that will send a notification to my iPhone about the details of the torrent that has finished downloading. Sends me the name, …

Total answers: 1

Why can't I print to terminal with my python script?

Why can't I print to terminal with my python script? Question: I can’t figure out why I can’t print to the terminal using the following code. #!/usr/bin/env python3 import sys def main(): sys.stdout.write(“Hello”) I’m running the program from the terminal by moving into the directory in which the python file is found, making the file …

Total answers: 1

Append duplicate items at the end of list whithout changing the order

Append duplicate items at the end of list whithout changing the order Question: I am new to python and was trying to Append duplicate items at the end of list whithout changing the order testlist = [1, 2, 32, 8, 1, 17, 5, 2, 42, 13, 56] def duplicate(alist): p = len(alist) duplicate = False …

Total answers: 5

Interactive CLI packages – checkboxes & selection

Interactive CLI packages – checkboxes & selection Question: I am trying to learn more about making some cool CLI interfaces to provide the options for some local scripts. By digging into the source of the yeoman-generator I was able to come across inquirer for Node, which is how I learned that it was possible. (Example …

Total answers: 2