Linked Questions

1 vote
3 answers
1k views

I have a large number of name value pair that I need to use in a program. What should be the best way to store the name value pair in a file so that I can easily parse them in my python program. For ...
Abhishek's user avatar
  • 1,867
0 votes
2 answers
1k views

I need to execute a file inside a python shell. I can exec(open('Test.py').read()) But I need to call it from inside a function. "Test.py" will set variable C=10 So, #x.py def load(file): ...
Chinmoy Kulkarni's user avatar
0 votes
1 answer
950 views

I have written a module which re-defines the print function. Is it possible to preimport it in order to redefine print() (with from [module] import print) to demonstrate or test it with a program, ...
Camion's user avatar
  • 1,394
-1 votes
2 answers
476 views

I am attempting to execute Python files from a deconstructed file. import utils import os print(utils.fileReader('holderFile.py')) test = utils.fileReader('holderFile.py') for i in test: if(i == '...
Marc Frame's user avatar
  • 1,011
2 votes
1 answer
811 views

I have a string print("hello"). I want to directly store this as a .pyc file and execute it later. How can I do this?
codingsplash's user avatar
  • 5,085
0 votes
2 answers
582 views

I have two python modules: buildContent.py which contains code that results in output i want. buildRun.py which i run in order to redirect the output to a file. I'm trying to save the output from ...
dyb's user avatar
  • 59
0 votes
1 answer
509 views

Given the below java code, how can I pass the following python statements as argument to the java code python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s....
Sandeep Kanabar's user avatar
0 votes
1 answer
311 views

How to execute Python3 code located remotely - e.g. github? script_url = "https://gist.githubusercontent.com/geotheory/c874b88e712006802114a50d08c15c46/raw/1f218c0f4aa26b0596d9ef3b67005f7d4a9c8e99/...
geotheory's user avatar
  • 24.1k
1 vote
0 answers
393 views

When I run the script it closes the terminal. I want to print and display a message and also to see that it has completed. Maybe a status bar? import ftplib from ftplib import FTP ftp_add = input('...
johnashu's user avatar
  • 2,211
0 votes
1 answer
322 views

My question about implementing a script into a view in a django web app. I have a .py script that I want to run inside this django web app using the user-supplied data, the configfile, the modelfile ...
Ilias 's user avatar
0 votes
2 answers
289 views

Trying to run simple python file in python prompt but giving an error: content of test.py print("Trying to print this using .py file on anaconda prompt") Running file from python prompt (...
user3626342's user avatar
0 votes
2 answers
206 views

I just want to have some ideas to know how to do that... I have a python script that parses log files, the log name I give it as an argument so that when i want to run the script it's like that.. ( ...
Kirk ERW's user avatar
  • 167
-1 votes
1 answer
155 views

I was recently using the subprocess module and it's run method to execute os commands through python only and get the output, since I was trying to make a custom command prompt in tkinter. The way ...
typedecker's user avatar
  • 1,398
0 votes
2 answers
119 views

I have a Django web-service where I have to take python code from users and run it in the backend and use that code for some purpose. Presently I have taken code by user and I store it in a file. When ...
user3742120's user avatar
0 votes
2 answers
62 views

I have a python file containing multiple functions. And in another file, I have an array which contains functions name . *How can I implement array value in the format of functions * For example : 1 ...
ragav hats's user avatar

15 30 50 per page