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?
6 days ago in Python by ana1504.k
• 5,990 points
8 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
There is a useful environment variable for that: PYTHONDONTWRITEBYTECODE

export PYTHONDONTWRITEBYTECODE=true
answered 6 days ago by SDeb
• 9,540 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,120 points
18 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
503 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
67 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
• 9,540 points
37 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
• 9,540 points
22 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.