Pywhatkit.playonyt(): This site can’t be reached. (python 3.6.0) - python-3.6

I am trying to make a personal assistent but when I try to use pywhatkit.playonyt() it opens a non available page. This is my code:
if 'play' in command:
song = command.replace('play', '')
talk('playing ' + song)
pywhatkit.playonyt(song)

It was a known bug in PyWhatKit, we fixed it in the newer version, use the following code
if 'play' in command:
song = command.replace('play ', '')
talk('playing ' + song)
pywhatkit.playonyt(song, use_api=True)
This problem usually happens if you are using a vpn, tor, or some other reasons that are country specific.

Related

How do I block comment in Jupyter notebook? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I want to comment out a block of multiple lines in Jupyter Notebook, but can't find out how to do that in this current version.
It used to be in one of the drop down menus but is no longer there.
How do you comment out multi-line blocks of code at once?
This is not a duplicate because the solution given in the following link doesn't seem to work anymore:
How can I block comment code in the IPython notebook?
Ctrl + / does nothing.
Ctrl + / works for me in Chrome browser in MS Windows. On a Mac, use Cmd + / (thanks Anton K).
Please note, if / did not work out of the box, try pressing the / key on the Numpad. Credit: #DreamFlasher in comments to this question.
I have not yet managed to find the best way possible. Since I am using a keyboard with Finnish layout, some of the answers do not work for me (e.g. user5036413's answer).
However, in the meantime, I have come up with a solution that at least helps me not to comment each and every line one by one. I am using Chrome browser in MS Windows and I have not checked other possibilities though.
The solution:
It uses the fact that you can have multiple line cursors in an Ipython Notebook.
Press the Alt button and keep holding it. The cursor should change its shape into a big plus sign. The next step is, using your mouse, to point to the beginning of the first line you want to comment and while holding the Alt button pull down your mouse until the last line you want to comment. Finally, you can release the Alt button and then use the # character to comment. Voila! You have now commented multiple lines.
Try using the / from the numeric keyboard.
Ctrl + / in Chrome wasn't working for me, but when I used the /(division symbol) from the numeric it worked.
Quick Addition to Top Answer: CTRL + / is nice because it toggles back and forth between adding and removing # at beginning of all selected lines. Didn't see that exact nuance mentioned so just wanted to add it here. (This worked in Firefox Developer Edition 54.0b12 on Windows 7).
On a Finnish keyboard use Ctrl + ' to comment on multiple lines and use the same keys to de-comment.
Ubuntu 14.04 Google Chrome
TL;DR:
Using MacBook Pro with Spanish - ISO Keyboard.
Solution: Ctrl + -
Full story
This is an old post but reading it got me thinking about possible shortcuts.
My keyboard is a Latin Apple MacBook Pro, which is called Spanish - ISO. I tried the changing keyboard distribution to U.S. solution... this works but with this solution I have to switch keyboards every time I want to comment which... sucks.
So I tried ctrl + - and it works. The - is where the / is located in an english keyboard but doing Cmd + - only changes the Chrome's zoom so I tried Ctrl which isn't as used as Cmd in macOS.
My takeaway with this would be: if I have more shortcut problems I might try the original shortcut but using the key where the U.S. keyboard would have it.
Select the lines you want to comment out. Then press:
Ctrl + #
I tried this on Mac OSX with Chrome 42.0.2311.90 (64-bit) and this works by using CMD + /
The version of the notebook server is 3.1.0-cbccb68 and is running on:
Python 2.7.9 |Anaconda 2.1.0 (x86_64)| (default, Dec 15 2014, 10:37:34)
[GCC 4.2.1 (Apple Inc. build 5577)]
Could it be a browser related problem? Did you try Firefox or IE?
Use triple single quotes ''' at the beginning and end. It will be ignored as a doc string within the function.
'''
This is how you would
write multiple lines of code
in Jupyter notebooks.
'''
I can't figure out how to print that in multiple lines but you can add a line anywhere in between those quotes and your code will be fine.
Fn + Cmd + / in Safari browser on MacOS
On MacOS 10.11 with Firefox and a German keyboard layout it is Ctrl + ?
Select the lines on windows jupyter notebook and then hit Ctrl+#.
I add the same situation and went in a couple of stackoverfow, github and tutorials showing complex solutions. Nothing simple though! Some with "Hold the alt key and move the mouse while the cursor shows a cross" which is not for laptop users (at least for me), some others with configuration files...
I found it after a good sleep night. My environment is laptop, ubuntu and Jupyter/Ipython 5.1.0 :
Just select/highlight one line, a block or something, and then "Ctrl"+"/" and it's magic :)
After searching for a while I have found a solution to comment on an AZERTY mac. The shortcut is Ctrl +/= key
I am using chrome, Linux Mint; and for commenting and dis-commenting bundle of lines:
Ctrl + /
For a Dutch keyboard layout (on Debian 9 in Chromium 57) it is Ctrl + °
Another thing to add, in the version I'm using, the code has to be initialized in order to be to comment it out using CTRL and / . If you haven't ran the code and the code isn't colorized it wont work.
If you have a Mac and not a English keyboard:
Cmd-/ is still easy to produce.
Follow the below steps:
Just go into the Mac's System Settings, Keyboard, tab "Input Sources" or whatever it might be called in English
Add the one for English (shows up as ABC, strange way to spell English).
Whenever you want a Cmd-/, you have to change to the ABC keyboard (in your menu row at the top of your screen,if you have ticked it to be shown there in the System Settings - Keyboard tab).
Cmd and the key to the left of the right "shift key" gives you Cmd-/.
P.S: Don't forget to switch back to your normal keyboard.

Game Maker Multiple variable error

My code is designed to rename a jpeg and capitalize the attributes in order to trick my Nintendo 3DS into thinking it took the image as a photo this code down here is the converter ran on a pc to convert an image to the right type and name.
Prefix = "HNI_";
Midfex = floor(random(9999));
Suffex = ".JPG";
gt_file=get_open_filename("jpeg image|*.jpg", "");
file_rename(gt_file, Prefix + Midfex + Suffex);
Where "Midfex" is, a random number with four digits is created.
and "Prefix" and "Suffex" are, they just what they are called and supposed to do.
When running the game, I get this error:
FATAL ERROR in
action number 1
of Mouse Event for Left Pressed
for object object0:
DoAdd :: Execution Error
at gml_Object_object0_LeftButtonPressed_1 (line 10) - file_rename(gt_file,Prefix + Midfex + Suffex)
There are probably too many variables in the "Rename_File" function. I have tried this on GameMaker 8.0 and it still does not work. How can I fix this?
I am using the standard version of GameMaker Studio, not the free version. I have attached a screenshot of my code in Gm:s Drive.Google.com/file/0b....
When you use + you are trying to add the number Midfex to Prefix and Suffix. Changing it to Prefix + string(Midfex) + Suffex should solve your issue as it is now in a string format.
Also for your convenience you can use irandom(9999) instead of floor(random(9999)) to achieve the same result for Midfex.
You cant use + between string and real.
Prefix = "HNI_";
Midfex = string(irandom(9999));
Suffex = ".JPG";
or
file_rename(gt_file, Prefix + string(Midfex) + Suffex);

How to debug or log ASP.net pages

First off I am not a programmer or else I should probably know how to do this already. I have a situation where I am receiving an MS Jscript runtime 800a1391 indicating whereClause is undefined. I am fairly certain in previous portion of the ASP page it is attempting to gather values and is most likely failing to return values or is returning something like a null that is later breaking the script on this line.
Here is the line it is failing on:
{
url += "&chartType=" +chartType + "&selClause=" + selClause + "&whereTrendTimeClause=" + whereClause + "&TrendTypeForReport=" + TrendType + "&ReportDisplayType=" + Request("ReportDisplayType") + showModes + "&whereProtocolClause=" + protocolClause + "&groupClause=" + groupClause + "&joinClause=" + joinClause + "&groupIDClause=" + groupIDClause;
}
What I am trying to figure is how to output (either to text) or even printed to screen the returns each time the whereClause does something within this page. Even if I have to manually enter some bit of code for each instance of whereClause that is fine. I am not looking for an easy solution just a method that works and returns what I need which is a very verbose output. The reason a verbose output is needed is I can compare a working environment vs a non-working one. I just need to get the "logging" to work first.
thanks,
To monitor your variable and see what your variable have you can use Google Chrome, and opening by the Console (right click on the page, click Inspect Element, then Select Console) you can see the errors that you have on page.
And you can use the console.log() to write on it from your javascript code.
You can learn more on this tutorial - Debug the web

Automate LGE Tool with AutoIt

I want to load LGE Tool from an AutoIt script, then go to the tab "Remote Services". I am using this code:
$program = "C:\Program Files (x86)\LGE Tool\LGETool.exe"
If ProcessExists($program) = True Then
MsgBox(0,"","works")
ElseIf ProcessExists($program) = False Then
Run($program)
EndIf
WinActivate($program)
WinWaitActive("LGE Tool version 1.99")
Send("{^TAB}")
The software does load but nothing works after.
Your Send syntax is incorrect...it should be:
Send("^{TAB}")
I'm assuming that Control + TAB works in the program; the software you mentioned is proprietary and requires special drivers, nobody can really test the solution without prerequisites so you've got to be the test point.
Hope this works!
Alex

How to completely script the process of importing SSL certificate and binding this certificate to a specific site

I have been looking around for a solution for this problem that works across different versions of Windows Server & IIS, but so far I couldn't find a reasonable solution, what I need is some sort of a script or a command line tool, that takes a certificate file (pfx) for example and then either using the same script or tool find a way to configure one website to use this certificate.
I found a good script on TechNet
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/96ccb49f-b669-4e05-965e-3090984a3594.mspx?mfr=true
CertImport.vbs
Option Explicit
Dim iiscertobj, pfxfile, pfxfilepassword, InstanceName, WebFarmServers, IISServer
Set iiscertobj = WScript.CreateObject("IIS.CertObj")
pfxfile = WScript.Arguments(0)
pfxfilepassword = WScript.Arguments(1)
InstanceName = WScript.Arguments(2)
WebFarmServers = split(WScript.Arguments(3), ",")
iiscertobj.UserName = WScript.Arguments(4)
iiscertobj.UserPassword = WScript.Arguments(5)
For Each IISServer in WebFarmServers
iiscertobj.ServerName = IISServer
iiscertobj.InstanceName = InstanceName
iiscertobj.Import pfxfile, pfxfilepassword, true, true
Next

Resources