Re: Sandboxing eval() (was: Calculator)

2020-01-19 Thread Grant Edwards
On 2020-01-19, Jon Ribbens via Python-list wrote: > On 2020-01-19, mus...@posteo.org wrote: >> Is it actually possible to build a "sandbox" around eval [...] >> >> [...] >> >> It works, but is it safe? > > No, not even slightly. If you want to do this you need to write your > own interpreter tha

How to hide warning about drop table message to MariaDB

2020-01-19 Thread ^Bart
I ran this code: #!/usr/bin/python import MySQLdb # Open database connection db = MySQLdb.connect("localhost","root","MyPwd","MyDB") # prepare a cursor object using cursor() method cursor = db.cursor() # Drop table if it already exist using execute() method. cursor.execute("DROP TABLE IF EXIST

Re: How to hide warning about drop table message to MariaDB

2020-01-19 Thread DL Neil via Python-list
On 20/01/20 4:35 AM, Python wrote: ^Bart wrote: I ran this code: #!/usr/bin/python import MySQLdb # Open database connection db = MySQLdb.connect("localhost","root","MyPwd","MyDB") # prepare a cursor object using cursor() method cursor = db.cursor() # Drop table if it already exist using exe

Re: Sandboxing eval() (was: Calculator)

2020-01-19 Thread Chris Angelico
On Mon, Jan 20, 2020 at 4:43 AM wrote: > > Is it actually possible to build a "sandbox" around eval, permitting it > only to do some arithmetic and use some math functions, but no > filesystem acces or module imports? > > I have an application that loads calculation recipes (a few lines of > varia

Re: Sandboxing eval() (was: Calculator)

2020-01-19 Thread Jon Ribbens via Python-list
On 2020-01-19, mus...@posteo.org wrote: > Is it actually possible to build a "sandbox" around eval, permitting it > only to do some arithmetic and use some math functions, but no > filesystem acces or module imports? > > I have an application that loads calculation recipes (a few lines of > variab

Re: Sandboxing eval()

2020-01-19 Thread MRAB
On 2020-01-19 17:35, mus...@posteo.org wrote: Is it actually possible to build a "sandbox" around eval, permitting it only to do some arithmetic and use some math functions, but no filesystem acces or module imports? I have an application that loads calculation recipes (a few lines of variable a

Re: Sandboxing eval() (was: Calculator)

2020-01-19 Thread Paul Moore
On Sun, 19 Jan 2020 at 17:45, wrote: > > Is it actually possible to build a "sandbox" around eval, permitting it > only to do some arithmetic and use some math functions, but no > filesystem acces or module imports? No. This has been tried before, and it simply isn't safe in the face of malicious

Sandboxing eval() (was: Calculator)

2020-01-19 Thread musbur
Is it actually possible to build a "sandbox" around eval, permitting it only to do some arithmetic and use some math functions, but no filesystem acces or module imports? I have an application that loads calculation recipes (a few lines of variable assignments and arithmetic) from a database. ex

Re: How to hide warning about drop table message to MariaDB

2020-01-19 Thread Python
^Bart wrote: I ran this code: #!/usr/bin/python import MySQLdb # Open database connection db = MySQLdb.connect("localhost","root","MyPwd","MyDB") # prepare a cursor object using cursor() method cursor = db.cursor() # Drop table if it already exist using execute() method. cursor.execute("DROP

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-01-19 Thread 황병희
^Bart writes: >> pip is probably defaulting to Python 2.7. Try using pip3, or this more >> explicit syntax: > > Now it works! > > Python 3.7.3 (default, Apr 3 2019, 05:39:12) > [GCC 8.3.0] on linux > Type "help", "copyright", "credits" or "license()" for more information. > == RESTA

Re: Python Testimonials With Proofs

2020-01-19 Thread Abdur-Rahmaan Janhangeer
Also started editing https://wiki.python.org/moin/OrganizationsUsingPython Most quotes over there don't have references. Yours, Abdur-Rahmaan Janhangeer pythonmembers.club | github Mauritius On Sun, Jan 19, 2020 at 10:59 AM A