Years ago, I had an old laserjet. I haven't used it in years. Nevertheless, it keeps showing up on my newly installed ubuntu along with my new printer. Any ideas why this might happen?
Micheal Bee's questions
My computer running Pop!_OS 20.04 (basically Ubuntu 20.04 with some additions) doesn't have a portmap file to resolve port numbers to service names. I did a
sudo apt install portmap
which installed a port mapper, but still, there is no corresponding file. Therefore, I cannot get service names when I run netstat.
How can I add, fill, and otherwise edit a portmap file? Or is there some other system in 20.04?
Thank you for your kind assistance,
M
STT works less well when another application has focus. How can I improve STT to work as part of the OS? My virtual assistant program can do things like move windows around, but it seems to work best when it has the systems focus. When another application comes to the front, it works less will. I've written this in python. Can I decrease the nice level of the process from within Python 3, or is there a better way to keep this application active and listening? Here's a link to the application, but I don't expect anyone to look at it. https://github.com/MikeyBeez/Juliet
I'm running Ubuntu 18.04, Python 3 in a conda virtual environment, and I'm running the GNOME DE.
Right now I have a keybinding that uses the xsel program to grab the contents of selected text and pass it to the festival text to speech engine:
#!/bin/bash
xsel |festival --tts --pipe
I want to have the ability to toggle a process that will allow me to have any text I highlight automatically spoken, and I want to kill and restart the process if I highlight something else. Is this even possible? I think such a tool would greatly enhance everyone's workflow.
OS: Ubuntu 18.04.4 LTS x86_64 Kernel: 5.3.0-51-generic Shell: zsh 5.4.2 DE: GNOME
I want to unit test a bunch of code that looks like this:
# First command. This will open reddit in your browser.
# -------------------------------------------------------------
if 'open reddit' in command:
url = 'https://www.reddit.com/'
if not runtest:
webbrowser.open(url)
print('Done!')
talktome.talkToMe('reddit is opening.')
if runtest:
return url
# -------------------------------------------------------------
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I've written this unit test:
import unittest
import subprocess
from GreyMatter import julibrain
from SpeakAndHear import talktome
class TestBrain(unittest.TestCase):
def test_open_reddit(self):
test = True
testurl = julibrain.assistant('open reddit', 1, 2, test)
#subprocess.call(['pip', 'list', '|', 'grep', 'webbrowser'])
self.assertEqual(testurl, 'https://www.reddit.com/')
I invoke it on the command line:
python -m unittest test_julibrain.py
It gives me this output:
❯ more runtests.sh
python -m unittest test_julibrain.py /0.0s
❯ more runtests.sh
python -m unittest test_julibrain.py /0.0s
❯ ./runtests.sh
Package Version
----------------- ----------
autopep8 1.5.2
beautifulsoup4 4.9.0
certifi 2020.4.5.1
chardet 3.0.4
click 7.1.1
future 0.18.2
gTTS 2.1.1
gTTS-token 1.1.3
idna 2.9
isort 4.3.21
lazy-object-proxy 1.4.3
mccabe 0.6.1
mock 4.0.1
MouseInfo 0.1.3
mypy 0.770
mypy-extensions 0.4.3
numpy 1.18.1
Pillow 7.1.1
pip 20.0.2
psutil 5.7.0
PyAudio 0.2.11
PyAutoGUI 0.9.50
pycodestyle 2.5.0
PyGetWindow 0.0.8
pylint 2.4.4
PyMsgBox 1.0.7
pyperclip 1.8.0
PyQt5 5.14.2
PyQt5-sip 12.7.2
PyRect 0.1.4
PyScreeze 0.1.26
python3-xlib 0.15
PyTweening 1.0.3
requests 2.23.0
setuptools 45.2.0
six 1.14.0
soupsieve 2.0
subprocess.run 0.0.8
typed-ast 1.4.1
typing-extensions 3.7.4.1
urllib3 1.25.9
vosk 0.3.3
wheel 0.34.2
wikipedia 1.4.0
wrapt 1.11.2
.
----------------------------------------------------------------------
Ran 1 test in 0.285s
OK
So I can test that the url is being set, but I don't know how to see if the webbrowser module is working. If I run the code, it the webbrowser opens. I don't want to open it. I'd like to get back some sort of status that says the module has been imported, a webbroser object can be instantiated, and there are no problems. After looking at the webbrowser doc, I have no idea how to do this. Any ideas? Thank you. I'm on Ubuntu 18.04, using conda and python 3.6.1. Cheers!