Linked Questions

11 votes
2 answers
18k views

I understand from How do I run a Python program? that in command prompt i can use C:\python>python first.py , to run first.py. But, is it possible, that after i entered the interactive python ...
athos's user avatar
  • 6,517
-1 votes
1 answer
1k views

I have file tbl.lua with lua table: SpeedFM={} SpeedFM[20000101]=0.77566 SpeedFM[20000102]=0.77569 SpeedFM[20000103]=0.7757 SpeedFM[20000104]=0.77569 Using lua I just make dofile('tbl.lua') and get ...
DeepSpace's user avatar
  • 153
0 votes
0 answers
18 views

I have my Python code to run a simulation stored in a file called script. This script takes a lot of input parameters that will be used to run the simulation. Now, I want to separate the definitions ...
nougako's user avatar
  • 248
461 votes
12 answers
416k views

It seems like in Python 3 they've removed all of the easy ways to quickly load a script, by removing execfile(). What alternative is there to include a Python file in another one, and execute it?
R S's user avatar
  • 11.9k
80 votes
13 answers
215k views

I would like to run a command in Python Shell to execute a file with an argument. For example: execfile("abc.py") but how to add 2 arguments?
olidev's user avatar
  • 20.8k
14 votes
2 answers
41k views

im spawning a script that runs for a long time from a web app like this: os.spawnle(os.P_NOWAIT, "../bin/producenotify.py", "producenotify.py", "xx",os.environ) the script is spawned successfully and ...
mark's user avatar
  • 1,217
5 votes
1 answer
16k views

Im trying to figure out how to include a .pyc file in a python script. For example my script is called: myscript.py and the script I would like to include is called: included_script.pyc So, do I ...
Ke.'s user avatar
  • 2,586
4 votes
3 answers
68k views

How do I define the function in the importer so that it is visible inside imported? I tried this importer.py is def build(): print "building" build() import imported Whereby, imported.py is ...
Val's user avatar
  • 11.2k
-1 votes
2 answers
6k views

Whenever I try to run the VS code python terminal, I get the following error: File "<stdin>", line 1 & C:/Users/tawsi/AppData/Local/Microsoft/WindowsApps/python.exe c:/Users/...
Tawsif's user avatar
  • 15
1 vote
3 answers
7k views

I'm new to Python and I really need help on this, I've been looking everywhere but i can't find an answer. I created a script that compares data from 2 Excels files and write a report in a new file. ...
Pierre Dudek's user avatar
3 votes
3 answers
5k views

I'm making a couple of functions via exec, that could possibly error. However when Python errors out it doesn't display the line that the error occurred on. For example using: fn_str = '''\ def fn():...
Peilonrayz's user avatar
  • 4,053
-1 votes
6 answers
1k views

I am starting fresh with python and trying to execute a code from the python command window. I wrote a file on Desktop\practice\new.py and lunched the python command window. when I type C:\users\...
Syntax_Error's user avatar
  • 6,260
3 votes
4 answers
475 views

I'm trying to load a ".py" file in Python like I did with a ".rb" file in interactive Ruby. This file runs a code which asks for a user's name, and then prints "Hello (user's name), welcome!". I have ...
zacty's user avatar
  • 109
5 votes
1 answer
3k views

I have been looking for a feature where PyCharm notifies me that a script has finished running in the console after each run. At present, I have to add print('done') after each code. I got smarter so ...
Jeff's user avatar
  • 591
1 vote
2 answers
2k views

I'm trying to run the Python script that I wrote for scraping a particular website, and then I need to get notified with an email when the price reaches a specific number, for that matter I used ...
CodeManiac's user avatar

15 30 50 per page