Best way to avoid stale *.pyc files?

0 votes
How do I avoid stale *.pyc files? Sometimes, especially when switching branches in version control, some *.pyc files are left there which are later used by Python instead of the source files.

What's the best way to make sure that I don't create or unknowingly use any stale *.pyc files?
May 16 in Python by ana1504.k
• 7,390 points
16 views

1 answer to this question.

0 votes
There is a useful environment variable for that: PYTHONDONTWRITEBYTECODE

export PYTHONDONTWRITEBYTECODE=true
answered May 16 by SDeb
• 12,200 points

Related Questions In Python

0 votes
1 answer

Best way to create a simple python web service

web.py is probably the simplest web framework ...READ MORE

answered Jul 20, 2018 in Python by Priyaj
• 56,160 points
27 views
0 votes
1 answer
+3 votes
5 answers

How to read multiple data files in python

Firstly we will import pandas to read ...READ MORE

answered Apr 6, 2018 in Python by DeepCoder786
• 1,700 points
989 views
0 votes
1 answer

.pyc files in python

.pyc files contain the bytecode which are ...READ MORE

answered Jun 22, 2018 in Python by Hamartia's Mask
• 1,580 points
81 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Best way to open a socket in Python

Opening sockets in python is pretty simple. ...READ MORE

answered Feb 21 in Python by SDeb
• 12,200 points
42 views
0 votes
1 answer

Is arr.__len__() the preferred way to get the length of an array in Python?

my_list = [1,2,3,4,5,6,7] len(my_list) # 7 The same works for ...READ MORE

answered Oct 8, 2018 in Python by SDeb
• 12,200 points
43 views