Where is the output area in Atom? - python

Total beginner here. I have just installed Atom for use as an IDE for python along with some python packages. This may seem like a very basic question, but I am unable to find the output window.
For example, I type
print ("Hello World")
and I would expect the output to be
Hello World
which is the case for any other Python compiler i can find online. However, I see "Hello World" nowhere in Atom when I run it. The only thing closest to an output would be the space below that just shows the time it took to complete running. Does python not come with an in-built output window?
I have installed packages that seemed to be what I want such as script_runner and output_panel but all to no avail. Can someone point me to the right direction?

Script_runner does not work for me. I use the Script package. I go to the Packages menu item and click on the Script option in that menu. One of the options is to run the script. When I run a script this way a terminal/Console pane opens at bottom of the editor window with output written there. If you are not getting output your script may not be running.
Be sure your file name ends with .py.

For Atom, one of the easiest ways to run python is atom-python-run
All you need to do is press F5 or F6 in the python file

Related

Black Window in PyInstaller

I'm using PyInstaller to make python-exe's out of my scripts and the exe's work, but every time I execute one of the PyInstaller-exe's a black window pops up. It is pitchblack and looks like a command prompt, but you can't type in it and it disappears as soon as the exe is finished. I want to get rid of it but I don't know how. I've looked on the official website but there is nothing.
Ps: Sorry for eventual spelling- and grammar-mistakes
Yes, that is a console window. Please look again in the documentation at the linked chapter. It is definitely there: https://pyinstaller.readthedocs.io/en/stable/usage.html#windows-and-mac-os-x-specific-options
For some more comments about that, look here: Getting rid of console output when freezing Python programs using Pyinstaller

Can manim be used in pycharm?

I have been programming with python for about half a year, and I would like to try manim ( the animation programme of 3blue1brown from youtube), but I am not sure where to start. I have not installed it, but I have tried to read up on it. And to be honest I do not understand much of the requirements of the program, and how to run it.
Google has left me without much help, so I decided to check here to see if anyone here is able to help.
From what I understand, you run manim directly in python and the animations are based on a textfile with code i assume is LaTex. I have almost no experience with python itself, but I have learned to use it through Thonny, and later Pycharm.
My main questions are: (Good sources to how to do this without being a wizard would be really helpful if they exist☺️)
Is it possible to install manim in pycharm, and how? Do i need some extra stuff installed to pycharm in order to run it? (I run a windows 64-bit computer)
If i manage to do this in pycharm, Will I then be able to code the animations directly in pycharm (in .py or .txt files), or is it harder to use in pycharm?
All help or insights is very appreciated😅 As I said I am not extremely knowledgeable in computers, but I am enjoying learning how to code and applications of coding😊
I recommend you this playlist
I always uses pycharm for manim.
Firstly i setup python interpreter by just open File->Settings->Projet->Project Interpreter then just press on little gear icon to add python interpreter to Existing environment and locate C:\Python3x\python.exe
Then just open a terminal from left-down corner and run some basic commands to run manim as mentioned in tutorials or manim github page.
Something that works nicely for me is to run manimgl.exe from Python in PyCharm using the subprocess module. It also goes well with using the run shortcut while iterating with small edits.
I like to do this from the script in which my main scene is defined, for example, I have main.py which defines MyScene:
from manimlib import *
class MyScene(Scene):
def construct(self):
...
if __name__ == '__main__':
import subprocess
params = 'manimgl main.py MyScene -c WHITE'.split()
subprocess.run(params,
check=True,
capture_output=True,
text=True)
# Possibly look at captured output here
The code inside if __name__ ... does not execute when the same script is loaded by manim. What is nice is that one can easily add automation steps before or after the actual execution if needed and it keeps everything related in a single script.
Edit: I also end the animations in the construct() method of MyScene with exit() to terminate the preview. I honestly don't know if this is good practice, but it works well for my usage pattern.
Note that this does require that manimgl.exe reside somewhere that is in your path, in my case (Windows) I installed this for my global Python interpreter. I followed the instructions on GitHub and it works for me because the following is in my path:
C:\Users\XXX\AppData\Local\Programs\Python\Python38\Scripts\
It may vary depending on where your Python is installed. For a venv, you could do something like:
params = '.\venv\Scripts\manimgl.exe ...'.split()
Yes, you can
1.Write your code in pycharm
2.save it
3.copy that .py file to where you installed manim. In my case, it is
This pc>> C drive >> manim-master >> manim-master
4.select on the path and type "cmd" to open terminal from there
Type this on the terminal
python -m manim -pql projectname.py
This will do.
To play back the animation or image, open the media folder.

Running Python in Visual Studio 2017, output not showing correctly?

I was using a different IDE for running Python scripts, but I would like to switch over to Visual Studio. When I try testing simple scripts that work in the simple IDE, I can't figure out how to get my output to show correctly. I have tried running the debugger, pressing CTRL+F5, and pressing CTRL+F5 then CTRL+d, but all that happens is that a blank console pups up, and the cursor blinks actively.
I have run out of ways to rephrase this issue to get something helpful to show up in both Google search results and in StackOverflow. The main results I get are about antivirus software (thoroughly investigated, not the problem here) and articles about beginning Python in VS. How do I get my Python programs to show output correctly? And also am I using incorrect terminology?
What happens when I hit Ctrl+F5
Have you already gone through the Installation, Quickstarts and Tutorials here:
https://learn.microsoft.com/en-us/visualstudio/python/overview-of-python-tools-for-visual-studio
Make sure the simple hello_world.py file with one line works:
print("Hello World")
If you still have problems, it may be that Visual Studio does not realize you have Python installed (i.e. if python is not in your path variables).

python 3.6.2 not giving me option to create or run files or anything of the sort

I know some basics of Java and C++, and am looking to learn Python
I am trying to develop some random stuffs to get a good feel of how it works, but i can only make 1 line scripts that run every time i press enter to go to the next line.
I've seen tutorial videos where they can just open up files from a menu and type away until they eventually run the program.
I'm using IDLE, and i don't see options to open up new stuffs; I can only make one or two line programs. When i tried to make a calculator program, i didnt know how to run it because it ran every line of code i typed in unless there were ...'s under the >>>'s.
I think it's because i am in interactive mode, whatever that is.
How do i turn it off, if that's the problem?
There are many different options for writing python scripts. The simplest to use is Idle, it come with the Python download. Within Idle, create a new document to write a script. Once finished, save it as a .py file, and you can run it within Idle. For my personal setup, I use the text editor Atom. I can create documents easily, and run them through the terminal on my computer. Hope this helps.
To exit out of the "interactive mode" that you mentioned (the included REPL shell in IDLE) and write a script, you will have to create a new file by either selecting the option from the top navigation bar or pressing Control-N. As for running the file, there's also that option on the navigation bar; alternatively, you can press F5 to run the program.

Output identifiers in python program

I am running a python script using cygwin Terminal in Windows 7. I am able to get the output in terminal window but I am unable to find out which identifiers or data elements of the program are responsible to display output on the terminal window. I have also used checkpoints like print statement in between the programs but haven't got anything useful out of it. Anyone has any idea how I shall understand the control flow of the program? Thnx
Based on the information you gave us, all I can tell you is get a good IDE and learn to use the debugger. I recommmend eclipse with the pydev plugin.

Categories