I have installed pyinstaller in my Linux in order to create an executable to my Python script, which runs normaly with the command: However when I execute bellow command: I get the following error: What is wrong? I tried to install dis3: But I still get the same error. I uninstalled it … Installed again as recommended. I have set
Tag: python-3.x
Can’t read stdout output of external commands after deamonizing Python script
I wrote a RPC server foo in Python that I deamonized with Everything works fine except that every use of subprocess.check_call(some_cmd) or os.popen(some_cmd).read(1048576) in my daemon returns an empty string compared to the case when I start foo in the foreground. The external program some_cmd is still executed sucessfully (as I can see in the logs), yet I don’t have
How do I create a file I can stream data to in Python?
I’d like to create a file similar to those under /dev that I can stream lines of text to without actually writing anything to the disk. I want to still be able to read this stream like a regular text file. Answer Call the os.mkfifo function, then open the file it creates as normal. Anything that gets written by one
Why does this code work on Linux but not on Windows?
I asked a previous question here, regarding flagging Daylight Saving Time hours. @MattMessersmith kindly and expertly answered my question, and his solution worked perfectly in Linux (Ubuntu), but not on either of my Windows machines (work and home). My Windows machines are both running Anaconda with Python 3.6 and pytz 2018.4, if that helps. When I run the code on
why does my ffmpeg process wait forever without stdin parameter to subprocess.run?
I am using the python subprocess module to call ffmpeg like this: This works fine. An example call: What I want to know is why it doesn’t work when I omit the stdin parameter. In this case the ffmpeg process waits forever iff I start my program as a background process in the shell. Running in the foreground works. I
Python does not find custom installed modules when running from a cronjob
I’m trying to set a python script to run every two minutes using a cronjob, the crontab line is below. The python script is called by a shell script, script.sh, posted below. This python script starts a selenium webdriver, gather some data and saves it to a csv file. A snippet is also bellow. crontab The export DISPLAY=:0 is needed
Startup with Django runserver error
I am starting up with Python-Django in Ubuntu 18.04. I have python3 installed. python3 –version says Python 3.5.2 After installing Python, I installed Django as below: I also have Django installed. django-admin –version says 2.0.5 In my project, startproject worked successfully, but when I am trying to run the following command inside my project: It gives following errors: Following command
SyntaxError on input() supposedly in Python 3
I have a script for sending emails using SMTP_SSL. The code is working fine in PyCharm but in the terminal I get an error. This is the code: When I run this in my terminal its giving this after i enter the email: When I am trying to put the email between quotes, e.g. “mahmoud.wizzo@gmail.com” its working fine. How can
Reading a text file with unicode characters – Python3
I am trying to read a text file which has unicode characters (u) and other tags (n, u) in the text, here is an example: (u’B9781437714227000962′, u’Definitionu2014Human papillomavirus (HPV)u2013related proliferation of the vaginal mucosa that leads to extensive, full-thickness loss of maturation of the vaginal epithelium.n’) How can remove these unicode tags using python3 in Linux operating system? Answer To
reboot raspberry if python script stop with error
I use a Python script on a raspberry that communicates with the Internet and USB with an Arduino and it happens that one of the 2 communications blow because of some error, and I would like in case this file python stops because of an error that the Raspberry restarts ! can some one hepl me ? Answer This is