0

Is it possible to run python code in Eclipse (PyDev) and use variables computed in previously executed code (similar to using console and interpret code in real time as we enter it)?

Details: I want to use python for experimenting with signal processing and to the signal are applied 2 computationally intensive filters in a row. Each filter take some time and it would be nice to remember the result of the first filter without the need to recompute it at each launch.

2
  • Add them to the environment and use os.environ to get them. Commented May 7, 2013 at 11:54
  • You might want to try setting up an IPython notebook server and having PyDev connect to that. Commented May 7, 2013 at 17:29

2 Answers 2

1

Or just do: Password Protection Python

import pickle 

reading a "cache" / database:

with open('database.db', 'rb') as fh: db = pickle.load(fh) 

adding to it:

db = {} db['new_user'] = 'password' with open('database.db', 'wb') as fh: pickle.dump(db, fh) 
Sign up to request clarification or add additional context in comments.

Comments

0

Decorate your functions with Simple Cache and it will save parameters/result hash to disk. I should point out that it works only when arguments are of an immutable type (no lists, dictionaries...). Otherwise, you could handle cache results with the API exposed by Simple Cache or use pickle to serialize results to disk and load it later (which is what simple_cache does, actually).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.