-2

can somebody explain to me please:

1) Can a py file just by its mere "existence" on your hard drive (if not opening it), cause any kind of malicious harm for your computer system? And if your goal is only to see the content (text of code) of the file, how could you open it to be 100% sure it could not harm your system (for example by the standard text editor tool?)? Or can you only get to the content with Python specific programs?

2) If someone asks you to look at her python code, and wants to send you for this reason several py files - could opening such file harm your computer system/perform "malicious" actions (how?)?

Please take into account for your answer, these three different ways of how you would open the files:

a) you open with the program from python.org

b) you open with a IDE

And a third question: 3) What about the official program from python.org itself - does this program somehow open up your system to additional internet attack types, just by having it installed?

Finally, 4) Is it more secure in terms of online security, to interact with python programs on a separate computer and not the one you do everyday business?

Thanks community!

5
  • 2
    Please don't make more work for others by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under a CC BY-SA license, for SE to distribute the content (i.e. regardless of your future choices). By SE policy, the non-vandalized version is distributed. Thus, any vandalism will be reverted. Please see: How does deleting work? …. If permitted to delete, there's a "delete" button below the post, on the left, but it's only in browsers, not the mobile app.
    – Makyen
    Commented Dec 8, 2019 at 22:03
  • @johnsmiththelird: your best option is to just leave it alone. As has been explained, once posted, it no longer belongs to you but rather to the site. Commented Dec 8, 2019 at 22:11
  • You may also want to read "I've thought better of my question; can I delete it?"
    – Makyen
    Commented Dec 8, 2019 at 22:13
  • thanks for explaining. I thought "closed" means it should be deleted because no value. Commented Dec 8, 2019 at 22:13
  • @johnsmiththelird Closed basically means that between 1 and 5 other users felt that it didn't fit the requirements of the site (or is a duplicate). Here, they closed it as "needs more focus", which basically means it's too broad (which it is, given the multiple questions). However, the real issue is that the focus of your question really isn't programming, per-se. Your question really focuses on system security, which isn't the topic of Stack Overflow. Your Q probably wasn't closed specifically for that, because the close-vote dialog makes it less effort to close it as "needs more focus".
    – Makyen
    Commented Dec 8, 2019 at 22:20

1 Answer 1

2

Q1: No, it's just a text file. So you can view it with any text editor Q2. If you mean by "opening", viewing in text edit, see answer to Q1. If by opening, you mean executing the script, then the answer depends on what the script does

web services don't run on your local computer, so they can't harm it.

Q3. The answer is no, because python installed on your computer is dormant.

Q4: There are lots of thing you can do on your computer which can do damage. For instance, you could delete all your files in your file explorer. Surely you already have backups?

Python scripts are human readable which makes them a very ineffective place to put secret code which does nasty things.

I've never heard anyone put python anywhere in a list of security risks, but if you are worried, use virtual box and run it in a virtual machine. I do a lot of my python development in a virtual machine, but not to minimise security risks ... there are other advantages to VMs (such as ease of backup, ease of moving to another computer). The other advantage, if you are using Windows, is that you can use a Linux VM, such as Ubuntu, which is a better experience for modern development. I think because of this, Microsoft has actually made it easy to install Ubuntu directly into Windows, if you have a recent version on Windows 10, so that's another option (e.g. https://tutorials.ubuntu.com/tutorial/tutorial-ubuntu-on-windows#0)

I haven't look at web IDEs for a while. As long as they have interactive python debugging, they could be a good option. I had the impression that cloud 9, now an amazon offer, was the best one, last time I checked them out.

1
  • Virtual Box is free and open source, and runs on Windows (and macs and on linux). I suggest find a recent YouTube tutorial on 'installing ubuntu in Virtual Box'. Pycharm Community Edition is a good IDE, and free. It runs on Windows, Linux, macs, but I still think Ubuntu in a VM is a good idea. I don't recommend web IDEs for beginners; they lack features, they are however completely safe. Commented Dec 6, 2019 at 12:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.