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
Tag: python-3.x
How to get different values from different tables in Treeview / Tkinter (SQLite)?
I’ve been working with Tkinter and I’m trying to get different columns from different tables in my Treeview, I’m using SQLite as database, in my first table called registers i got different columns idcard, name, surname, cellphone, address, email, etc in my second table named attendance I use to store my entries attendances by ID number I mean I got
Is it the right way to run 2 infiniteloop in python?
i wrote a code in python with 2 infinite loop like this: If i don’t join any thread it’s not working, but when i join 1 thread, another thread is work too but i don’t know why? Can anyone explain for me? Answer Join is used to block the calling method until the thread finishes, throws an exception or time
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
Python embedded. timestamp() return same time over multiple seconds
I have implemented a system of callbacks. I want to display the time in unix epoch when I call the function. For example: In game: Why datetime.now().timestamp() return same time? The same problem with time.time() I use Python 3.8 x32 Answer The type of a timestamp is float, which is a floating point type of the width of the Python
How to create a function which Iterates over multiple lists
So I’m creating a series of column mappings, I can do this manually like so The function produces a mapping of a value and its column. Great, now I want to make this more general. Currently, if I needed to map 2 columns for example I run the following: Works as well but not ideal if I have a lot
iterating over folders executing a fuction at each 2 folders
I have a function called plot_ih_il that receives two data frames in order to generate a plot. I also have a set of folders that each contain a .h5 file with the data I need to give to the function plot_ih_il… I’m trying to feed the function two datasets at a time but unsuccessfully. I’ve been using pathlib to do
String filtering in an if function not working in Python
I am writing a webscraper that scrapes data from a list of links one after the other. The problem is that the website uses the same class names for up to 3 different buttons at once with no other unique identifiers used which to my understanding makes it impossible to point to the exact button if there are more. I