A
A
aposum232021-03-13 21:19:37
Python
aposum23, 2021-03-13 21:19:37

The cmd window does not start in all IDEs, python python, how to fix it?

When starting debugging, the cmd window does not open, regardless of the IDE, it does not give any errors anywhere. Tried in Sublime Text via SublimeREPL and in VSCode. At the same time, the code is working, it works stably through the online compiler. Versions of python and all IDEs are latest as of 03/13/2021. Tried on the code with OpenCV which worked without any problems, also the same problem
Here is the code:

elementsNum = input()
days = input()
daysMas = days.split()

four = []
three = []
i = 0

for elem in daysMas:
    if int(elem) % 2 == 0:
        four.append(elem)
    else:
        three.append(elem)
    i+=1

fourStr = ""
threeStr = ""

for elem in four:
    fourStr = fourStr + elem + " "
for elem in three:
    threeStr = threeStr + elem + " "
print(threeStr)
print(fourStr)
if len(four) > len(three):
    print("YES")
else:
    print("NO")

The code, depending on the number of even and odd numbers, displays YES or NO and lines with these numbers. The first input line is just needed for the task site to accept it as input.

Code with OpenCV:

from cv2 import cv2 as cv
import numpy as np
import pyscreenshot as ImgGrab
import os

img = ImgGrab.grab(bbox=(200,200,1366,768))
img.save("screenshot.png")
while True:
    img = cv.imread("screenshot.png")
    cv.imshow("Frame",img)
    key = cv.waitKey(0) & 0xFF
    if key == 27:
        break
cv.destroyAllWindows()


The task of the code: just take a screenshot of an area of ​​the screen, save it and show it (The code is not complete, but it worked properly and showed everything)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aposum23, 2021-03-13
@aposum23

Problem solved, it's mine. I haven't coded in python for a long time and forgot how it all works. Data entry in vs is carried out through the terminal of the IDE itself, and in Sublime in the window that opens in the IDE. In short, just my cant)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question