Skip to content
Advertisement

Tag: python-3.x

pyinstaller ImportError error – how to solve it?

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

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

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

Advertisement