>
> You could try setting
>
> PYTHONIOENCODING="UTF-8"
>
> in your OS shell and see if that helps, but I suspect
> there's a better way to deal with it...
>
Thank you! That was it!
Exporting thusly made it behave:
$ export PYTHONIOENCODING="UTF-8"
$ python3
Python 3.5.2 (default, Nov 23 2017, 16
Greetings! How to print °F/°C etc in python3?
(This works on a WSL):
~$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.release()
'4.4.0-17134-Microsoft'
>
Greetings!
Please consider this situation :
Each line in "massive_input.txt" need to be churned by the
"time_intensive_stuff" function, so I am trying to background it.
import threading
def time_intensive_stuff(arg):
# some code, some_conditional
return (some_conditional)
with open("massi
>
> getstatusoutput is a "legacy" function. It still exists for code that
> has already been using it, but it is not recommended for new code.
>
> https://docs.python.org/3.5/library/subprocess.html#using-the-subprocess-module
>
> Since you're using Python 3.5, let's try using the brand new `run`
>
>
> But: do you really want to "tail" what's probably not really a plaintext
> file? Just guessing, but the .db as well as the error msgs are a hint.
although the filename ends with a ".db", it is just a text file. not
tailing a SQLite or a binary file, just happened to name it so.
I work around
Greetings!
My search-fu failed me, so thought of finally asking this question here.
How can I work around this issue where subprocess.getstatusoutput gives
up, on Python 3.5.2:
>>> subprocess.getstatusoutput("tail -3 /tmp/pmaster.db",)
Traceback (most recent call last):
File "", line 1, in
Greetings!
I was hoping to learn when to use classmethod and when to use property.
They both seem similar (to me at least..), what's the pythonic way to
choose between them?
$ cat ./try.py
#!/usr/bin/python3
class _someclass:
_tag = "sometag"
def __init__(self,_text):
self._text
Greetings!
I've a case where I need to put lines with both Indic and English Text
to a file ( and optionally to stdout):
# bash;
ml_text="മലയാളം"
en_text="Malayalam"
echo "$ml_text = $en_text" >> /tmp/output.txt
$ cat /tmp/output.txt
മലയാളം = Malayalam
That line above is what's I am trying to
Greetings!
#!/usr/bin/python3
class Employee:
"""Class with FirstName, LastName, Salary"""
def __init__(self, FirstName,LastName, Salary):
self.FirstName = FirstName
self.LastName = LastName
self.Salary = Salary
def __str__(s