This is my program, and it works very well. Output: But if I want to run this program at startup as root in Linux Mint I have problems. I want to run this py file at startup as root but I don’t know how to do it. The main question is how to do it. This is my attempt to
Tag: python
Locating ODBC Driver 13.0 for SQL Server on Ubuntu Azure VM
I have a python script that requires ODBC Driver 13.1 for SQL Server to connect and write to a SQL Server. I am trying to setup the script on a Linux VM running Ubuntu 16.04 on Azure. I am having trouble locating the location of the driver to use in my script. I have followed the instructions here on installing
How to write a transparent wrapper to terminal application?
Wrapper should handle special control characters and do something but otherwise not interfere with the actual application. (trying to build a tmux like app) So far I have the below modifying example in doc: https://docs.python.org/3/library/pty.html#example The above code works but the vim opened does not cover the entire terminal window. It starts vim with reduced rows and columns If I
Python Makefile Libraries
Although it may sound trivial how should I import libraries in Python makefiles? I am creating a basic Python makefile such as: However I am using specific libraries inside my_file.py, not included/imported in the basic package, for instance: xlswriter. So if someone tries to run the code they must type in terminal something similiar to: So my question is how
Is it possible to threshold the maximum GPU usage per user?
We have Ubuntu 18.04 installed machine with an RTX 2080 Ti GPU with about 3-4 users using it remotely. Is it possible to give a maximum threshold GPU usage per user (say 60%) so any other could use the rest? We are running tensorflow deep learning models if it helps to suggest an alternative. Answer My apologies for taking so
os.walk different folder ordering on Mac and Linux?
Given the following file structure, I’m wondering if it’s possible that python’s os.walk function returns the folders in different orders on Mac and Linux? Both are using python 3.5. Mac: On Linux: In the case of Mac, looks as though the folder v1 is encountered first, while on Linux it’s v2. Any insight as to why this might be the
python filter lines matching keyworks
I have working python script producing following output. Script output Now i want want any line starting with stream in output so i am using following logic but its not working. Answer Your data is a massive string instead of a list of strings as you expected. Also it’s easier to use str.startswith instead of regex (less resource hungry). Simply
How can I execute two commands in terminal using Python’s subprocess module?
How can I use the subprocess module (i.e. call, check_call and Popen) to run more than one command? For instance, lets say I wanted to execute the ls command twice in quick sucession, the following syntax does not work returns: Answer You can use && or ;: The difference is that in case of && the second command will be
Continuous Audio Playback with Sounddevice
I am writing a program to stream audio over a network, so I have a thread to record data and one to send it. When testing the audio has noticeable gaps. I beleive this is due to the sounddevice.play() function, the example below has the same problem. The gaps coincide with the play length, so it appears to be caused
Multiple CLOSE_WAIT when using google cloud speech api with tornado server. Too many open files error
I am getting multiple threads of the same process in CLOSE_WAIT because of which i am getting ‘too many files open’ error. This is happening when multiple calls to google cloud speech api is made. Have gone through various answers on stackoverflow, but i am unable to figure out the solution. The code I have shared is a trimmed version