Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I've searched the Google and on stackoverflow for this, so if it exists anywhere, my sincerest apologies. I'm (obviously) a newbie to Python, and one of my main concern with finding a new module that does whatever new programming project comes my way is this:
What's preventing a module (once imported) from doing nefarious things, such as logging all keystrokes while the script is executing, then emailing that out?
Am I being paranoid?
Is this not possible in Python?
Is there a website where modules have been code reviewed, and people can download / install them without needing to worry?
Do I have to read the code of every module / sub-module every time I download it to ensure this exact thing isn't happening?
I'm currently using Python 3.5.1 64-bit on Windows 8, but I doubt that's too relevant.
Nothing prevents it. That's one of the benefits of open-source software (in the strictest sense of "source code that I can view"): you can, in theory, examine it to see exactly what it does before actually running it.
In practice, you usually just extend some level of trust to the source:
Is the module in wide use, such that others would have discovered or mentioned a problem in the first place?
Did I get the module from a reputable source?
Does the checksum of my copy match the checksum provided by my source?
If the answer to all three is yes, you can assume that the module isn't doing anything shady without explicitly verifying it yourself.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
So today I spent hours trying to understand why the package I installed using pip install in terminal was giving me an "module not found" error. Which I know is a file path problem. After a lot of tinkering around I eventually pip installed the library on powershell. Like magic it works. To avoid these headaches in the future and to gain a deeper understanding of all things programming does anyone have a book or class they could recommend to understand the circus of ide's, text editors, file paths, kernals, interpreters, compilers etc. I have no idea where to begin and it's really hard trying to troubleshoot these issues when I've never been given any formal instruction on how all these things work together. Is this something learning a language like C would help me understand? FYI Or does this just take pain and years of experience to navigate. FYI I've only taken a few basic college level python courses.
No, this has little to do with the programming language. It’s about knowing your way around your operating system. As such it’s not a good SO question; perhaps you should try superuser or one of the OS-specific StackExchange sites.
But what helps is understanding the command line. When you run “pip”, you need to make sure that the program pip - which is just a Python script - is being run by the same Python interpreter that you’ll be using later when you try to import the module.
Basic advice: find all the “python” and “python3” executables on your system. Pick the one you want, or install a new one. Either way, make sure that the directory containing it comes before any of the others in your command search path, and both names (with and without the 3) are there and point to the same binary file. That way you always know what you’re getting when you run “python” at the shell prompt. Make sure you configure your IDE to use the same one, too. And instead of typing “pip”, type “python -mpip” so that you know it’s at least installing into the same environment you get when you type “python”.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to make a OS that could be gaming-friendly (like Windows) yet easy to use. I can already use Python perfectly fine, and I'm looking to see if I could make an OS with it. Is it possible? If not, what are some Python-like coding languages that I could use?
I've looked in to Buildroot but it uses the Makefile language which I am extremely confused about, it's just non-logical (at least to me).
I expect it to be possible because C# is quite the complex language and it works fine.
#Neutrino You in theory can, it's not an easy task you would first have to make the python bytecode interpreter sit directly on bare metal this still involves quite a bit of C. At that point you would have a micro-kernel with the rest of the operating system written in Python. People have prototyped this in years past. I believe project cleese is the closest you will get to something that you're looking for.
Project Cleese
https://github.com/jtauber/cleese
Never use python to build any sort of OS, especially if you want it to be gaming-friendly. Python is a very slow language.
To build an OS, you should use a language from the C family
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
There is a substantial amount of scripts/code used for academic research written in python2.7 only available on a collaborator's github repos. The problem is this should be ported to python3.x someday.
Currently, is the correct standard for users to simply download the python2.7 code, apply python's 2to3, and use this code? (I guess I would e-mail the owner if 2to3 didn't work correctly...) That is, it's up to the user to generate the python3.x code.
Or would it be useful for me to port this code and request the user push it for the entire community to use. In this case, should both versions be available for use? Or should I ask the owner to replace the python2.7 code with the new python python3.x code?
What is the current standard?
If you bump into such a repository and convert it to Python 3, the nice thing would to do it in a fork of the repository and create a pull request. This way the repository owner can decide whether you incorporate your work back into the repository, saving other people the trouble.
You should definitely cite the original code if all you did was port it to Python 3.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am trying to make a program with python that downloads a large .scd file, unpacks it, and then installs it. It is not at all difficult for me to download it or install it, (which is pretty much just using urllib and moving a few files around) but unpacking it seems to be a problem. After a couple hours of Googling I can't seem to find any modules for Python capable of opening .scd archives. One idea is to try to convert is to a .zip file with Python, replace the .scd with that, and the just use zipfile.extractall(). I am fine with this if someone can tell me how to do the conversion. The conversion/extraction MUST be automated.
EDIT: It is OK with me if a use 3rd party software, but I still would like the following things: the process must be totally automated, (the user does not have to hit an extract button or anything along those lines) the 3rd party software must have a license that allows me to use it as part of my Python program, (and distribute it as part of my program's package to the general public) and the software is compatible with Windows.
OK, after numerous hours on google I found out that .scd's are basically .zip's with a 0% compression rate. Try using the built in zipfile module on your file as though it were a .zip.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have an open source project written in python , it has some Forms and I want to modify a few things in the code and in the forms but it is my first time with python and I don't know what IDE to use and how to start ..my basic question is can I deal with forms in python like c#, java ...etc ? and how should I start ?
Because this project uses pyGTK, you can use glade which is a gtk forms designer, but it would probably add an extra layer of complexity that's really not necessary. Since you're already familiar with C#/Java, I'd recommend running through the official Python tutorial. Then I'd take a look at this excellent PyGTK tutorial. If you spend about a day really trying to understand the Python model and the "pythonic" way of doing things, you should then be able to easily modify that program.
While you probably don't need to use and IDE for a project this simple, if you want, you can use Eclipse (which you may be familiar with coming from Java) with PyDev. It allows you to write/debug Python programs inside the what may be the familiar Eclipse IDE.