I am facing issues printing things on repl.it - python-3.x

I am new to repl.it and I was trying to print the python version using this code Print Version of the Python Running on the Machine
Here's the code:
import sys
print("Python version")
print (sys.version)
print("Version info.")
print (sys.version_info)
but it prints absolutely nothing. Trying to do the same thing onto Jupyter Notebook and my code works. While I know I can print the version directly from the shell tab out there but I was wondering what's wrong with my code and why it isn't working with repl.it
This seems to be the same for user input as well where I try to do
name = input("Print my name?\n")
but it prints absolutely nothing onto the console. I am sure someone here must know what am I missing here. Sorry if this is a noob question.

"Help! 🙋 My REPL won't run"
Here are six reasons your Python REPL.it environment may not be working. 📃
Checklist to fix common problems
Have you configured your Run ▶️?
Repl.it doesn't automatically run your current working document. Configuring your Run ▶️ button will enable replit to know what to do when you hit the button.
Configuring the "Run" Button
A file named .replit can be added to any repl in order to customize the behavior of the "Run" button. Written in toml, a .replit file looks something like:
run = "<run command here>"
language = "<repl language>" # optional
In the snippet above, run is a string which will be executed in the shell whenever you hit the "Run" button. The language helps the IDE understand how to provide features like packaging and code intelligence. This is normally configured for you when you clone from a Git repository.
The .replit file can also provide other configuration hints. The full specification is provided below:
run: Command that is executed when the run button is clicked
language: Reserved
onBoot: Command that is executed once when the repl first starts up
packager.afterInstall: Command that is executed after a new package is installed
packager.ignoredPaths: List of paths to ignore while attempting to guess packages (More about installing packages)
packager.ignoredPackages: List of modules to never attempt to guess a package for, when installing packages (More about installing packages)
Example .replit File
run="python main.py"
language="python3"
onBoot="echo Booting up!"
[packager]
afterInstall="date >> package_install_log"
ignoredPaths=[".git"]
ignoredPackages=["twitter", "discord"]
Attempt running the *.py script through the interactive shell instead of console. If the script runs in console, you may be needing to diagnose the shell. See choices below.
Check that the Browser Developer Console is not showing any errors If you see errors, you may be having issues with your browser or extensions. Try disabling browser extensions temporarily.
REPL.it relies on Google Cloud Platform services for its backend functionality and sometimes those servers are unresponsive. Check the REPL.it status page or the REPLIT Twitter account to see if they're having a GCP backend service outage. If they haven't updated recently, they may be responding to an unreported outage. Check Google's own GCP status page here. You can also Tweet at the CEO of Repl.it here.
Try refreshing the REPL.it environment locally. Clear the console output and scroll-back by using the ✖️ next to the search icon 🔍. Also, try exiting the Python REPL with exit() to see if it will respond.
If #5 doesn't work, try an empty-cache hard reload. This can help to expunge unresponsive javascript, broken html, misbehaving css, and any unmetabolized toxins from the bowels of your browser.

Related

VS Code JavaScript debug terminal has malware. How to remove it?

I just started experimenting with the .NET framework and I noticed that when I run:
dotnet list packagein the JavaScript Debug Terminal of VS Code I get all my packages as I should but they have strange Links attached to some of them that lead to scam sites.
ex:
> Windows.EntityFrameworkCore.SQlite --> ww1 .entityframework.com which is a shitty site pretending to be .NET hiring developers.
....
enter image description here
I tried running anti virus scans and cleanups. Nothing detected.
I tested on PowerShell, GitBash and Cmd terminals. Nothing, only happens in the JavaScript Debug Terminal
I tried disabling all my VS Code extensions (including the built-in ones) except the JavaScript debugger to see if its coming form another extension. Still there.
I have heard of extension vulnerabilities and VS Code Hacks but this is a built-in plugin.
Has this happened to anyone?
VSCode is configured to attempt to parse strings from any output that could represent a valid URL and present the option to you as a clickable link for convenience.
Since .tools is a valid TLD, it thinks the string Microsoft.EntityFrameworkCore.Tools is referencing the URL http://microsoft.entityframeworkcore.tools/ which it seems has been parked by an unscrupulous individual or organization. You as the developer should understand that this is a namespace reference and not a URL, and thus there is no value in clicking it.
This is not indicative of any sort of malware or any real malfeasance.

Task Scheduler for running python script done in PyCharm - Anaconda environment

I have created several scripts in PyCharm, inside an Anaconda3 environment. The thing is that I would like to run them with the task scheduler during the night, so hopefully by the time I get up they have done their stuff.
I have read a million post in Microsoft support and in here, and I haven't found an answer for this issue.
This is a print of the set-up for the Task Scheduler:
For the program, I use the path to python.exe inside anaconda ( I take this path from cmd / where python).
Start in: the route to the script: C:\Users\oper\PycharmProjects\MyProject
It doesn't run, and it brings the error: 0x1. Opens a CommandPrompt windows and immediately closes it. I see the error in: Last Run Result.
I have been able to run a much simpler code that prints a .txt in a specified folder - but not this one.
Additional info:
this script runs a Selenium WebDriver and navigates some websites, connects with Google's OCR, etc. All these steps are written in several other modules for ease of coding.
All the libraries used were installed using pip inside PyCharm's terminal. Might be related to not having the libraries in sync? Don't know how to check that.
I would also like to set up a wake-up from sleep for the computer. Probably a different problem for another question.
Thanks in advance.

nltk.download() wont open a GUI to chose the list of downloads. It dont download data and the cursor blinks forever

I am trying to install nltk and download the nltk data. I am trying this on python 3.7.3 and my pip is up to date. my PC is windows 10 and given by the company.
My Installation of nltk is succesfull but it wont downlaod the data. It dont give me GUI to chose downloads nor finishes the download. The cursor keeps blinking forever.
I have tried this running it as a an admin, ran it through Jupyter Notebook. Never saw the GUI at all/
Who knows what's going on? Maybe the download window is hidden behind other windows; I've seen that a lot. Or maybe it really doesn't come up. Either way, if you can't find the window you can largely work around the problem by using the non-GUI form of the downloader:
nltk.download("book") will download all the resources you'll need while reading the book. I recommend you just run this one and move on to exploring the nltk.
nltk.download("all") will download everything in the download store. Probably overkill.
nltk.downlead(<name>) will download resource <name> (e.g., 'average_perceptron_tagger' for the tagger data, etc.) If you try to use a module and it's missing a resource, it will usually tell you what you need to download.
There are some other collective names including all-corpora, popular, and third-party, but the most useful ones are the above, I believe.
This has been resolved. I had to bypass web connection proxy server at my work. Instead, they added permissions for the http://files.pythonhosted.org and this worked fine.

NodeJS is not recognizing commands on windows 10

I've installed Node.js on Windows 10 using this tutorial. I set the system variable for it as shown below [also explained in this SO post. But when I run the following command in the command prompt, I get the following error:
Error
Nodejs environment variable:
UPDATE
I'm just starting with learning Node.js. Below you can find (pics) is the way I'm trying to access Node.js on my windows 10 machine. It's not working. What should I do instead?
If you've correctly installed NodeJS on your machine you should be able to do the following:
Go to start and search for Node.js [ a 'desktop app' should appear with a green icon having the exact same name you entered -Can't miss it :) ]
I suggest opening it as an administrator -[not really necessary, but to avoid (possible) further problems ]
Open that, and try typing the same command e.g. console.log('What about now? :)')
Since you like pictures, here you go :)

Same program behaves differently in different consoles

I wrote a text mode batch C++ program that since today is giving me some troubles.
The executable worked correctly and it did not change.
The environment did not change; not even a reboot.
When I launch the program from a certain console, everything is fine.
When I launch the program from a new console, everything still works, but I get just the first two lines on the log file, even if the execution completes.
The parameters passed to the executable are the same.
The executable does not interact with the console in any way.
The two consoles' environment variables are the same.
When run from a remote computer as root, everything is fine, the log file is complete.
When logged in again with my user, from another session, everything is fine again.
When logging out and in again, everything is fine again.
So, could it be the from a certain instant on, the new consoles had some issues that caused this problem?
Could this be a problem of my Linux installation?
Or, more realistically, could the problem depend on my program?
Thank you!
Environment:
- Linux OpenSuse 11.4
- gcc 4.5.1
Here is another tool to throw into your debugging toolbox.
Try the command 'reset' -- read the man page for details.
In short, it resets the console to a known state. It is ... possible that your log files may contain control characters that try to interact with tty causing hard-to-trace problems.
You might also want to look at the command 'script' which captures all console activity to at et file for examination.

Resources