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,870 points
33 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
• 13,180 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,900 points
39 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,720 points
2,518 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
105 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
203 views
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
• 13,180 points
53 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
• 13,180 points
72 views