68 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
56
views
Pyinstaller: problem with imports and reading/writting files
I am creating a discord bot for a, private, small server, with friends. I would like the bot to be runable by any of my friends, none of whom know much about programming.
My idea was to bundle it up ...
0
votes
0
answers
192
views
QReader - detect_and_decode opens a copy of the .exe
i have a python project where i use QReader to detect and decode a qr code from images i sent to the app. The problem is, the first time the project runs "qreader.detect_and_decode" it opens ...
0
votes
1
answer
33
views
Need to change Windows NTFS File ID
fsutil file queryfileid hkh
File ID is 0x0000000000000000001e000000001249
can anybody help me , how i can change File ID in Windows system ?
example : 0x0000000000000000001e000000001249 =...
0
votes
1
answer
38
views
Executing modules specified by strings
I am developing a Django backend for an online course platform. The backend runs the code submitted by the student. Here is a working example for running a student code consisting of three modules:
...
-2
votes
1
answer
44
views
Python and VS code
I am trying to run code in VSCode but every time getting an error that I could not resolve.
Here is the error:
python : The term 'python' is not recognized as the name of a cmdlet, function, script ...
-1
votes
2
answers
1k
views
importlib.metadata.PackageNotFoundError: No package metadata was found for djoser pyinstaller
Context
I made a Django react app. Now I want to make it a desktop application so that the user does not have type python manage.py runserver and also activate the environment every time. I used ...
0
votes
1
answer
286
views
using exec how to save variable equal to a string
I am using exec to save a variable equal to a string. I am getting a SyntaxError. I'm assuming exec is getting confused with the value as string. Is this assumption accurate? Would appreciate the ...
0
votes
3
answers
445
views
black console using py-to-exe
i tried to make an executable file from my main_app.py using pyinstaller.
All works but when im duble click the .exe files generated its popping out just a black console, not the app..
This is the ...
0
votes
1
answer
216
views
Isolate state change of chdir within python exec scope
Running a script with exec, how does one "backup" python process global state in its entirety and restores it afterwards?
code example:
import os
print(os.getcwd())
a = 8
print(a)
exec_scope ...
-1
votes
2
answers
565
views
Python script ends instead of restarting (os.execv)
Whenever I run the following file (and main encounters the WebDriverException exception) my program ends instead of restarting. Would anyone know why that's happening? Any help would be greatly ...
0
votes
1
answer
610
views
How to get function value from txt file with exec Python [duplicate]
I want to execute python code from txt file and store it.
In txt file I have this code:
def func(a):
return a
In python:
def random_file_input(file_name):
ran_number = random.randint(0, 100)
...
0
votes
1
answer
35
views
Exec Function, saving Methods/Classes/Variables -> Method
I'm writing a library for creating smaller python modules. I am not sure if I should be using compile() instead of exec(), it currently execute the files(any basic code in the global scope is executed)...
0
votes
1
answer
122
views
How to extend scope to an exec'd function?
I have a module object containing several function definitions. Here is a simplified example.
The source code (makes up the module "my_module")
def functionA():
print("hello")
...
1
vote
1
answer
650
views
Azure Cognitive Services and Python Executable
I am working on creating a program that uses the Speech aspect of Azure's Cognitive Services. When I deploy the executable(.exe) with just console printing, it works as hoped. The program works ...
1
vote
1
answer
1k
views
Command exec in a function, name error - python3
I'm begginer in Python and I'm in front of a problem that I can't understand. I tried to just define a variable with a exec() and then just print it. And it's working well. BUT when I do the same code ...