Python script in Linux

A forum for general discussion of the Python programming language.

Python script in Linux

Postby floatingshed » Thu Mar 20, 2014 1:31 am

I use a python based editor to write python scripts, it is a multi-tabbed editor that ships with pythoncard.
Its nothing fancy but it has been invaluable for writing scripts in windows. The feature I like most is an option to run the script from the editor. If I'm writing a GUI based script it will run, plus the windows cmd window opens which will display test output and any errors.

I'm currently learning Linux (mint 16) and trying to do some simple tasks is proving difficult...
In mint the terminal window doesn't open. The program runs as expected but if there are errors it doesn't run and as there is no terminal there is no error display!

Any idea how I run a script under Linux in such a way as to make terminal visible and useful?

Thanks
floatingshed
 
Posts: 3
Joined: Mon Apr 15, 2013 7:34 pm

Re: Python script in Linux

Postby metulburr » Thu Mar 20, 2014 2:21 am

You are going to have to be more descriptive. An IDE that ships with pythoncard doesnt mean anything to me. There are way too many out there.

The feature I like most is an option to run the script from the editor.

Every IDE does that.

In mint the terminal window doesn't open.

Be more descriptive. Mints terminal emulator or the embedded temrinal within the IDE?

Any idea how I run a script under Linux in such a way as to make terminal visible and useful?

http://asciinema.org/a/8302
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1470
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Python script in Linux

Postby floatingshed » Thu Mar 20, 2014 7:43 pm

I don't think that the application is important here its the difference in behaviour between XP and Mint.

In XP when I run a script of say a simple GUI, the Gui opens and so does a windows cmd window. This happens whenever I run a python script in XP, it has its own cmd window. This is great for de-bugging as it displays any errors and the result of any print statements etc.

In Mint no terminal window opens when I run the script, which is fine if the script is bug-free, and my GUI runs. However if there are errors I can't see them because there is no terminal window associated with my script.

I'm not sure how I can explain it any clearer. I never expected python work to be more difficult under Linux than M$!
floatingshed
 
Posts: 3
Joined: Mon Apr 15, 2013 7:34 pm

Re: Python script in Linux

Postby Marbelous » Thu Mar 20, 2014 9:24 pm

Really? I always felt that Windows is designed to appease the moronic masses where Linux tends to be more for the geeks that expect to trade convenience for power.
I use Pycharm in Linux (ubuntu) sometimes but normally I just run my python code from the terminal window. That way it always just works. No matter what Linux Distro I use it's always the same interface. That's important to me because I code on Raspberry Pi's and fancy IDE's won't run. You don't need to be limited to the terminal but you should know the command line functions if you're working with any Linux OS. Try it out and you'll see how powerful and fast it is.
Marbelous
 
Posts: 143
Joined: Fri May 31, 2013 8:12 pm

Re: Python script in Linux

Postby dboxall123 » Sat Mar 22, 2014 10:25 pm

Either run the script directly from the terminal, ie

Code: Select all
python script.py


or install a IDE. Try out geany, it's brilliant. It's not just for python neither, it can be used for editing most programming languages. I use it for C too (it also has a built in compiler!)
dboxall123
 
Posts: 108
Joined: Fri Jul 12, 2013 5:28 pm


Return to General Discussions

Who is online

Users browsing this forum: Google [Bot] and 3 guests