I’m working in Python with a number of libraries at play. I have a group of files on a Linux server that have the last modified timestamp of midnight on January 1, 1980 (unix timestamp 315532800.0). The last changed timestamp however is recent. What could have caused this? In particular, Jan 1 1980 is a suspiciously round number, but not
Tag: python
DNS Resolver does not contain answer
I’m trying to automate some of the tasks with python. I have to chcek if some domains are still in ours DNS servers. So searching through stack i found script with dns.resolver and tryied to suit it to my needs. So, the script looks like this: My domainfile.txt looks like this: And error message i recived is: Traceback (most recent
Running functions on bluetooth pair request
I’ve recently been learning electric circuitry using arduino and am looking to implement some changes to my Raspberry Pi application. I used this outdated tutorial a few years ago to create my pi bluetooth receiver which is working well at the moment (https://www.instructables.com/id/Turn-your-Raspberry-Pi-into-a-Portable-Bluetooth-A/) but one downfall of this out-dated tutorial is that bluetooth connections have to be accepted via the
How to apply ‘Qt.WA_X11NetWmWindowTypeDesktop’ attribute to my QML window by using PyQt5
I am working on a desktop environment and I want my QML window as my main desktop window. I am integrating QML with PyQt5. here is my code main.qml main2.qml I tried adding window.setAttribute(Qt.WA_X11NetWmWindowTypeDesktop, True) in code but it doesn’t work. Also I tried adding Qt.Desktop flag also this doesn’t work. At the first time, it gave me error AttributeError:
Scripting in linux
Why java -version gives empty string when executing in subprocess.Popen. Is there any alternative to get the exact text given by java -version command in Linux? Answer I think you are getting some error so capture the stderr from the process. Then try to print the error.
CTRL+C not handled in python script when using su
I have a Python code like this. While the KeyboardInterrupt is handled fine if I run the python script by myself, it is not handled if I run it as another user using su, like this. How can I solve this problem? Answer The su command creates a new interactive shell and executes the command inside it. When you use
Why is Pip not working after upgrading Python to 3.8?
I was working on a 2D game using python 3.6.8 and pip3. Everything was working fine. Then i downloaded and installed python 3.8. Now, pip won’t work at all. These are the errors I am getting when running “pip3 install arcade”: PLEASE HELP, I would like to continue making my game. Answer The error is pretty clear. You’ve got a
Why does the command and its arguments have to be in a list for subprocess.Popen?
I tried doing Which gives me Following Python subprocess.Popen with var/args I did Which did work. Why is that? Why do I have to split my command and its arguments? What’s the rationale behind this design? Python version: Answer That’s how all process invocations work on UNIX. Under the hood, running a program on UNIX is traditionally done with the
For key and value in file json [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago. Improve this question FILE json I want to make a loop for and get the key and value Answer looool [in python3.7]
How to rewrite this multiprocessing code for Windows?
I’m currently using multiprocessing so I can obtain user input while running other code. This version of code runs on ubuntu 19.04 for me, but for my friend it doesn’t work on windows. How can I make this code work on windows? Also the user input lags behind by one input. If the user presses a button it only prints