online ide Runtime Error(NZEC) - python 3 on - python-3.x

I am trying to solve this problem:
https://www.codechef.com/problems/PSCD
My code works fine on my computer but shows Runtime Error(NZEC) on online IDE. How to fix it?
tt=int(input())
while(tt):
tt-=1
s=list(input())
for i in range(0,len(s)):
if(int(s[i])<5):
s[i]=str(abs(9-int(s[i])))
print(int(''.join(s)))

Related

CPython Script Executor does't work on Pentaho Kettle

Hellow Guys
First of all, i'm using the windows 10, java_1.8.0_333, and Pentaho 9.3
I'm trying to many ways to run my Python code in Pentaho, but isn't work.
I try reinstall my Python using diferent version, try to change my java version, and try oldest version of Pentaho, but no way works.
If a ran my Python script using the PyCharm, it's works, but if i try to run the same script, or create a new Python script in Pentaho, does't works, and i receive this error.
Inside CPython is a basic script that declares the variable name and receives the string "Test"
I think this error is about somenthing in my computer, but i don't no why
Can anyone help me with this ?

No module named 'line_profiler._line_profiler' when calling line_profiler

I intended to test my code with line_profiler in the following way in Pycharm but got an error just like the title said. I tried in both miniconda 3.8 and python 3.7 (Windows) but got the same error and I don't know how to fix that. I visited the github page where the source code lies and also tried to run my python file as a script. In the end, all attempts failed because of this error. It seems like a bug but I found everything is Okay in Colab. Can anyone give me any advice? Feel free to leave comments and I will appreciate that.
lp = LineProfiler()
lp_wrapper = lp(Solution) # Solution is the name of self-defined function
lp_wrapper()
lp.print_stats()

pywhatkit.sendwhatmsg_to_group function is not working

It might sound crazy but yesterday the function pywhatkit.sendwhatmsg_to_group worked fine with me but today I do not seem to make it work. The message was sent using the group id.
pywhatkit.sendwhatmsg_to_group('Groupid','Testing message',11,51)
But it just worked once. Now the window opens and the particular group also gets selected but the message doesn't get typed not sent.
Has this function worked for anyone?
I am using it on windows machine and python3.
I am using:
OS: macOs Big Sur 11.4
Browser:O Google Chrome 91.0.4472.114
IDE: PyCharm CE 2021.1.3
Pywhatkit: 5.0
I changed a line of code of the sendwhatmsg_to_group function to work in my environment.
I replaced the code (line 166):
pg.click(width / 2, height - height / 10)
with this:
pg.click(width / 2, height / 2)
And then it worked.
PS: The previous code was opening an application from my program bar.
Try this. It worked for me on Python 3.9.12 jupyter notebook
pwt.sendwhatmsg_to_group_instantly('Groupid','Testing message')

Why TCS MockVita is showing RunTime error for this python code

Can Anyone help me with this. I'm getting runtime error for this in online editor as well as in uploading the file but works with correct output in VS Code.
This is the Online Editor of TCS MockVita
This is the same code in VSCode
Can't really see the issue but have you the file name with which you've saved your code on the online editor is the same to that on VS code cuz it is bound to throw RE in case they're different.

Python 3.7: Pygsheets get all record stopped working

I have several scripts using pygsheets to get information from google sheets. Today they have stopped working without any errors or exceptions being noted.
Debuging Attempts:
Tried running in different ways
1. Visual Studio Code - just stops working no errors or exceptions. Debugged to line (wks = sh.worksheet('title', tabs))
2. command prompt - pops a window up that states "Python has stopped working: A problem caused the program to stop working correctly. Please close the program"
3. manually in IDLE - locks up at (wks = sh.worksheet('title', tabs))
4. Ran code on a different machine: worked fine.
So, I know it has to do with something on my machine, but not sure where to start looking. Any suggestions are welcome.
import pygsheets
from pygsheets import Worksheet
gsheet = pygsheets.authorize(service_file = 'client_secret2.json')
sh = gsheet.open('Google_file_name')
wks = sh.worksheet('title', 'tab_name')
results = wks.get_all_records()
The last line is where everything stops. Again, no errors or exceptions.
I know this doesn't really solve the issue, nor do I have experience with pygsheets, but from my experience with gspread the issue appears to be connection-related. I have had this exact issue with gspread's get_all_values module and, as you experienced, it suddenly stops working without any changes to the code and without terminating or returning any errors. The issue often disappears when the program is run again minutes or days later.
The only other time I have experienced freezing/hanging (recently in Python) is with TCP connections...

Resources