Task is create two record with different sizes within one file entry. I’m using python 3.4.5 for testing: Is there an ioctl opt code that will initiate a new record on the tape with variable record length. Or any other way to work around this bug? Answer Issue was with tcopy, it uses block size on device instead of detecting
Tag: python
SFTP via Paramiko to ipv6 linux machine
I am relatively new to python and am trying sftp for the first time via python script. I want my python script to get a file from a Dual Stack Machine (Both IPv4 and IPv6 present). Below is the code snippet I am using for Paramiko: When I use the code with IPv4 it works fine. But when I replace
python writing list to text file result in different lengths
i have 2 lists of strings with the same length but when i write them to a file where each item appear on separate lines in the file, they length of the list and file do not match: However when i write each item in the list to a text file: the number of lines in the text file do
How to cross-platform compile on windows for linux using gcc?
My aim is to create cross-platform C++ python modules. I’m usingCyther (cross-platform The Cross-Platform Cython/Python Compiler). Cyther uses GCC to compile modules and gives the user the ability to add GCC command-line args. So, I need run compiler on Windows, but compile for Linux. What args I must pass to GCC to compile a module for Linux (or other platform)?
Binding callbacks to minimize and maximize events in Toplevel windows
I’ve read through related answers and it seems that the accepted way to do this is by binding callbacks to <Map> and <Unmap> events in the Toplevel widget. I’ve tried the following but to no effect: I’m running python 2.7 on Linux. Could this be related to window manager code in different operating systems? Calling tk.iconify() before tk.mainloop() has no
Get name of users(persons, not applications) in linux system using psutil library
I am trying to use psutil library to get users logged in to linux system. For that i used function psutil.users() I want to extract the username from this list, what shall i do? Also what is suser here? Answer I don’t know why they choose the name suser, but it’s actually a namedtuple. That shouldn’t matter, you get the
Exposing python jupyter on LAN
I’ve installed jupyter on local network LAN but im unable to access http://<IP>:8888 from another macine on LAN. I’ve opened ports 8888 and port range 49152 to 65535 with iptables (this range is specified at http://jupyter-notebook.readthedocs.io/en/latest/public_server.html) This guide http://jupyter-notebook.readthedocs.io/en/latest/public_server.html describes exposing a notebook publicly but I’m just attempting to share over LAN. Have I missed a step ? Answer Try
Saving a Video in OpenCV (Linux, Python)
There is an example that works on Windows (original): In Linux program provides: AttributeError: ‘module’ object has no attribute ‘VideoWriter_fourcc’ Help make it work in Linux. Answer I didn’t try but this should work :
Capture output from external command and write it to a file
I am trying to create a script that calls on a linux command from my Ubuntu server and prints the output of aforementioned command to txt files. This is literally the first script I’ve ever written, I just started learning python recently. I want 3 files in 3 separate folders with filenames unique to date. It is failing at the
Quick remote logging system?
I want to be about to quickly insert some logging into some testing using either (Linux) command line or Python. I don’t want to do anything system wide (e.g. re-configuring syslogd). I’ve done something like this before by doing: wget URL/logme?im=module_name&msg=hello_world And then just parsing the server log file. It’s a bit hackish and you have to URL encode all