debugging

Create a small control panel on screen for pyautogui monitoring and control purposes

Create a small control panel on screen for pyautogui monitoring and control purposes Question: How do I display a small control panel screen that can control and monitoring pyautogui process? I expect there is a pinned window that for monitoring purpose such as displaying current log.txt that has been generated by logging and controlling purpose …

Total answers: 1

Can I use IDLE to debug a program that reads from standard input?

Can I use IDLE to debug a program that reads from standard input? Question: I’m debugging a long source code file that takes many inputs from the keyboard. I want to step through the program to see variable values, but I can’t get the Python IDLE debugger to take standard input. I’m aware I can …

Total answers: 1

Selenium Can't Find element by Xpath?

Selenium Can't Find element by Xpath? Question: I’m trying to click a button to automatically export a csv file from this site. I’ve tried finding the element by button name and by Xpath, but the "NoSuchElement" Exception is raised. I’ve tried variations of WebdriverWait and time.sleep to ensure the button loads, and used the xPath …

Total answers: 1

How to get full traceback in Python Notebook by using "%tb"?

How to get full traceback in Python Notebook by using "%tb"? Question: I ran some python code block on a Jupyter Notebook and got An exception has occurred, use %tb to see the full traceback. error/warning followed by a single line of traceback. I want to see the full traceback as suggested. But I didn’t …

Total answers: 1

python def create_file_if_not_exist(file_name: str): SyntaxError: invalid syntax near colon

python def create_file_if_not_exist(file_name: str): SyntaxError: invalid syntax near colon Question: File "report.py", line 17 12:05:47 def create_file_if_not_exist(file_name: str): 12:05:47 ^ 12:05:47 SyntaxError: invalid syntax I’m getting this error when I run python report.py Can someone help me find out what m i doing wrong I tried removing : str from "def create_file_if_not_exist(file_name: str)"but the error …

Total answers: 1

How to read first line of CSV file

How to read first line of CSV file Question: I’m trying to write a simple python code for taking in a csv file, and using tabulate module to print out nicely-formatted contents in the terminal. Here is snippet of my code: table = [] try: with open(filename) as csvfile: reader = csv.DictReader(csvfile) i = 0 …

Total answers: 2

Use file input(stdin) in VS Code debug argument

Use file input(stdin) in VS Code debug argument Question: I have a script that accepts multiple arguments and takes a file input(stdin) as one of the last argument. Tried debugging the script in VS Code debugger. But the file input arg is not working. The script doesn’t understand the fourth argument in the launch.json. here’s …

Total answers: 1

Debugger only shows Python bytecode when debugging SOMPY library functions

Debugger only shows Python bytecode when debugging SOMPY library functions Question: I am trying to set up a self-organizing map (SOM) with the python library SOMPY right now. I made some changes to the original code since I would like to implement an alternative method for the computation of the best-matching unit (BMU). However I …

Total answers: 1

I want to use python option -m when i use pycharm debugger

I want to use python option -m when i use pycharm debugger Question: Hi I got the project on the github, I want to analyze this code using debugging. The project uses python 3.6 and requires next command when running python -m pixloc.run_Aachen pixloc is package (directory) name and run_Aachen is python file name. When …

Total answers: 1

Using map to convert pandas dataframe to list

Using map to convert pandas dataframe to list Question: I am using map to convert some columns in a dataframe to list of dicts. Here is a MWE illustrating my question. import pandas as pd df = pd.DataFrame() df[‘Col1’] = [197, 1600, 1200] df[‘Col2’] = [297, 2600, 2200] df[‘Col1_a’] = [198, 1599, 1199] df[‘Col2_a’] = …

Total answers: 1