Skip to content
Advertisement

Tag: python-3.x

Automation of tasks with argparse Python3

Hi is anyone able to help. I am learning to use argparse and i want to use the command to call the school.py as school start for example. I have this so far but struggling to handle the arguments. Am i doing this right or what am i doing totally wrong? My error is autoSchoolDay.py: error: the following arguments are

How do I run another file in python?

So I know how to write in a file or read a file but how do I RUN another file? for example in a file I have this: a = 1 print(a) How do I run this using another file? Answer using subprocess standard lib or using os standard lib or extract python code from the file and run it

Finding first index after symbol

I need to extract emails from random text strings. For example: I found out how can i find end of email: But how can i find it’s start index? Maybe we could reverse string and find first ‘ ‘ after @ but how can we do it? Answer This is a very non-trivial approach without using regular expression: you can

Import “cv2” could not be resolved

I’ve installed python and opencv by using the correct commands in the cmd, but when I type in ‘import cv2’ in a python then I get the error in visual studio code and I can’t find any solution online how to fix this More of the error in the terminal Answer I noticed that Visual Studio does not support the

Advertisement