Kape1
Kape1

Reputation: 11

Running a python script that is stored in a database with pycharm? How to?

I have MariaDB/HeidiSQL instance and in it I have a table which contains the values (1, print('Hello World!'). The first number is just an Id.

So my question is can I access this Python script with my pycharm and run it?

Is it possible to store python scripts into a DB and the run them in pycharm, with some sort of query?

Upvotes: 0

Views: 4523

Answers (1)

Aman Sharma
Aman Sharma

Reputation: 11

Just write a python script which connects to your database using a client and fetch the target script as string.
How to execute a string in python as code is explained in the question How do I execute a string containing Python code in Python?

Upvotes: 1

Related Questions