execfile Questions

1

I wrote an async function that needs to call a program in the server and that program generate a file which needs to load in UI for displaying. I am not sure how to show the result in my UI since e...
Prochoras asked 9/12, 2018 at 16:56

2

The code is: import sys execfile('test.py') In test.py I have: import zipfile with zipfile.ZipFile('test.jar', 'r') as z: z.extractall("C:\testfolder") This code produces: AttributeError (...
Gastrectomy asked 1/10, 2015 at 9:39

4

Solved

Python 2 had the builtin function execfile, which was removed in Python 3.0. This question discusses alternatives for Python 3.0, but some considerable changes have been made since Python 3.0...
Georg asked 15/6, 2011 at 12:2

2

I have got myself very confused. I have a set of python functions, all of which I've bunged together in a file called (let's say) useful.py. I can then read the module into my ipython with import...
Externalization asked 10/1, 2015 at 11:51

1

Solved

I have a file utils.py containing a function called f1(). From another Python script I can import utils or execfile('utils.py') and have access to f1(). What are the differences between the two me...
Simferopol asked 17/12, 2014 at 1:35

2

Solved

Below is a big section of my code and basically if you scroll down to the execute_subscripts() function you can see I've got two scripts running via execfile which work beautifully, they show print...
Cuvette asked 29/10, 2013 at 4:41

3

Solved

In some of my Django apps I'm using a settings_local.py file to override settings that are different on various environments (e.g. development, test and production). I have originally used the foll...
Maletta asked 28/7, 2012 at 17:46

1

Solved

I have some code that loads a default configuration file and then allows users to supply their own Python files as additional supplemental configuration or overrides of the defaults: # foo.py def...
Conciliatory asked 28/11, 2009 at 18:22

3

Solved

Is it possible to break the execution of a Python script called with the execfile function without using an if/else statement? I've tried exit(), but it doesn't allow main.py to finish. # main.py...
Fecund asked 22/6, 2009 at 17:58
1

© 2022 - 2024 — McMap. All rights reserved.