pycharm

How to protect python script from editing

How to protect python script from editing Question: I am building a python script for my co-workers to use. what I want for my co-workers is to be able to run and view the script but not to edit the script when they download it from GitHub. I explored a few options like in this …

Total answers: 1

Overload type hint with Literal and Enum not working in PyCharm

Overload type hint with Literal and Enum not working in PyCharm Question: I want to typehint an overload function. For that I use the overload decorator from typing. I want to set multiple possible callees based on a parameter’s value. This parameter is color. I have this code: from typing import Literal, overload from enum …

Total answers: 1

What is shadow built-in name 'sum'?

What is shadow built-in name 'sum'? Question: I am learning at https://github.com/donhuvy/Data-Structures-and-Algorithms-The-Complete-Masterclass/blob/main/1.%20Big%20O%20Notation/2%20-%20bigo-whileloop.py#L11 . My environment: Python 3.9, PyCharm 2022 import time t1 = time.time() num = 100 if num < 0: print("Enter a positive number") else: sum = 0 while num > 0: sum += num num -= 1 print("The sum is", sum) t2 = …

Total answers: 1

Error trying to import python modules using jupyter package on pycharm

Error trying to import python modules using jupyter package on pycharm Question: I’m using Pycharm with the jupyter package and sundently I can’t import any module from pythons library (panda,numpy,…). The error that I get is, > ————————————————————————— ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 1 —-> 1 import numpy as np ModuleNotFoundError: …

Total answers: 1

Why such an error occurs when using pip install to install the package?

Why such an error occurs when using pip install to install the package? Question: WARNING: Ignoring invalid distribution -ip (d:python_3.9.7libsite-packages) is displayed during the installation process why does this appear? Asked By: Mark || Source Answers: This occurs due to files names with the ‘~’ prefix in site-packages. Please remove those files / folders. It …

Total answers: 1

Adding different values ​to the entries created with the loop

Adding different values ​to the entries created with the loop Question: For example, I want to insert the numbers from 1 to 10, respectively, from the beginning to the end, into the 10 entries I created with a loop. from tkinter import * root = Tk() root.title("") root.geometry("500×400") canva = Canvas(root,width=450,height=350,highlightbackground="black") for i in range(40, …

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