This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I make an EXE file from a Python program?
I have found several links talking about what to do, but I am unsure of how to use them. They often say to just use the code, but they don't say if I should put it in the terminal or use it to make a program to run. Many recommend the use of py2exe but when I try to use it it will not run because it says I do not have python 2.6 in my registery. I am rather new to the more complicated side of programming and any help would be appreciated. I am running windows vista.
This is certainly a duplicate question, but I'd recommend using py2exe. We probably need more information on how or why you are failing.
Related
This question already has answers here:
How do you run a python script from within notepad++? [duplicate]
(6 answers)
Closed 6 years ago.
I'm attempting a small coding project; a simple encryption program. I was wondering if I would be able to directly run my Python code from Notepad++, or if there is a different program that could do this task (preferably free). Not that I have to have said feature, it would just make things easier for me.
Sorry if this was an off-topic question. If so, I sincerely apologize.
Thanks in advance!
Wing IDE and PyCharm (My favourite personally) are really powerful IDE's that can run and debug your application all inside the same environment. Alongside features like auto-completion, support for documentation, version control support right out of the box, and multiple build configurations (there's way more features to list here!), they make writing and testing code more efficient.
Otherwise, you can always run your code via a shell, though the back and forth makes workflow less efficient.
The community edition is free, and very powerful still:
https://www.jetbrains.com/pycharm/download/
If you want a text editor that will run the code directly, then try PyCharm.
Otherwise open up a command prompt, save the file (e.g. simplencrypt.py) and then run python.exe simplencrypt.py in the command prompt when you want to run it.
I don't think you will be able to run your code directly from Notepad++.
This question already has answers here:
How do I get the path of the Python script I am running in? [duplicate]
(5 answers)
Closed 7 years ago.
I'm very new to programming, and to Python. I'm on Mac OSX, trying to work with PyCharm. I've looked at this, this, this, and several more.
But I can't seem to get the path of the current running file. If I use os.getcwd(), I get
'/Users/AlanH/Python'
When really, the full file path is:
'/Users/AlanH/Python/Exercises/PythonBasics/starthere.py'
So I don't understand why that doesn't work.
If I try using sys.path[0], it prings up a path that takes me to my Library, then dives in to Enthought (don't know why, even though I'm using Anaconda distribution).
I could go on and on about all the possible solutions I've tried, but nothing works. All I want is to get the exact path up to current running file. So either
'/Users/AlanH/Python/Exercises/PythonBasics/starthere.py'
or this
'/Users/AlanH/Python/Exercises/PythonBasics'
will do.
Could someone please help?
import os
print(os.path.abspath(__file__))
Locally tested with the following result:
eb#cube ~/Share $ python stackoverflow/path.py
/home/eb/Share/stackoverflow/path.py
This question already has answers here:
Process to convert simple Python script into Windows executable [duplicate]
(8 answers)
Closed 9 years ago.
I have been working a lot on python recently, mostly using IDE. Now I have a need to make a .exe program out of my code. Have tried cx_freeze but i couldn't understand what to do. So, if anyone could either give me a link to a good guide for begginers, or another easier .py to .exe program, I would be grateful.
PS
I am using Python 3.3.
Try py2exe..
Install py2exe in your system, then generate a setup file as shown here
Thats it. Your .exe file will be created.
This question already has an answer here:
What IDE to use for Python? [closed]
(1 answer)
Closed 9 years ago.
I would love to find out what the best way to go about writing Python scripts on a Mac would be. I've gone through two ways (mind you, I'm trying to avoid using vim because I want an IDE rather bland text editor). I went through using PyDev in Eclipse (the more I went through their recommendations and steps, the more of a hassle everything seemed to be.. although I do have everything set up and it can compile.. I want to know if there's a better way. I'm not too fond of Eclipse as is) and I tried to set up Xcode through the following steps: Xcode4 to run Python scripts. The problem with the Xcode version, is I would have to consistently setup the project like this every time. That, and every time I compiled something that needed to create a file it didn't (say using the command conn = sqlite3.connect('list.sqlite3'). Is there a simple way to do this? I've been trying to follow various iOS tutorials that want me to use python scripts (which I'm not familiar with at all) such as raywenderlich.com and Oreilly tutorials. Can anyone provide some guidelines on the best way to go about this?
Personally, I prefer the one that is found on the official Python website, IDLE, which can be downloaded here. It is very easy to deal with, and with the Shell it offers an area to test things out on, it has more than Eclipse can offer- in my opinion. I'm sure that people would feel the complete opposite that I do, but with my experience, IDLE is the way to go.
I think PyDev in Eclipse is pretty good. For scientific programming I wrote the following installation guide:
http://hywelowen.org/installing-python-for-scientific-computing-on-osx/
Spyder appears to be a decent alternative, but I haven't used it myself.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Can EXE generated by cx_freeze be completely decompiled back to readable Python code?
I've used cx-freeze to convert a python script to an executable. Is it possible to reverse that? Can I get my python script from the binary cx-freeze has generated?
EDIT. This is a practical question. I really need to recover one cx-freezed executable to a more-less readable form. Does anyone have a recipie of doing it?
Any 'frozen' PY application can be disassembled but not really decompiled. With enough time and patience someone would be able to reverse-engineer nearly any program (including yours).
Edit
Correction as per comments below.