python command doesn't nothing

Need help with C, C++, perl, python, etc?

python command doesn't nothing

Postby Hutik » 2020-06-22 16:06

If I use the command: python <file> it does absoluthely nothing. Same with "python3". I'm using a conda environment. I don't know if I'm missing something, on Windows it worked like this and I'm new to Linux.

Edit: the python command alone is working, but it is not able to open a file
Last edited by Hutik on 2020-06-22 19:52, edited 1 time in total.
Hutik
 
Posts: 5
Joined: 2020-06-22 14:57

Re: python command doesn't nothing

Postby Head_on_a_Stick » 2020-06-22 17:49

What is the exact content of the file and what did you expect it to do?

It seems to work for me:
Code: Select all
$ cat hello.py
print ("Hello, World!")
$ python hello.py
Hello, World!
$
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12150
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: python command doesn't nothing

Postby cuckooflew » 2020-06-22 18:17

on Windows it worked like this and I'm new to Linux.

Linux is not Windows, welcome to Linux and the Debian User Forums.
I'm using a conda environment.

Are you even using Debian ? There is not a "conda" environment in the Debian repositories, I don't think this is a Debian package or software,...
Also, I tried the "Hello World", program as shown ,and it worked fine for me as well, but I am using Debian,with no "conda environment", just pure Debian
Please Read.. What we expect you have already Done.
Does any one know about this ?
Users browsing this forum: Google Knows, and
My grand father knows all about everything:
…one flew east, one flew west,
One flew over the cuckoo’s nest.
cuckooflew
 
Posts: 399
Joined: 2018-05-10 19:34
Location: Some where out west

Re: python command doesn't nothing

Postby Hutik » 2020-06-22 19:52

Head_on_a_Stick wrote:What is the exact content of the file and what did you expect it to do?
[/code]

It trains a neural network, and it's full of print statements
Hutik
 
Posts: 5
Joined: 2020-06-22 14:57

Re: python command doesn't nothing

Postby dilberts_left_nut » 2020-06-22 19:56

Hutik wrote:It trains a neural network

Seems not.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 5055
Joined: 2009-10-05 07:54
Location: enzed

Re: python command doesn't nothing

Postby Hutik » 2020-06-22 19:59

cuckooflew wrote:Linux is not Windows, welcome to Linux and the Debian User Forums.

Wow, I didn't know that.
Are you even using Debian ? There is not a "conda" environment in the Debian repositories, I don't think this is a Debian package or software,...
Also, I tried the "Hello World", program as shown ,and it worked fine for me as well, but I am using Debian,with no "conda environment", just pure Debian

I'm using Debian, as you said we're in the Debian User Forum. Conda is not in the official repositories, however it doesn't mean it's not a Debian software.
Last edited by Hutik on 2020-06-22 20:01, edited 2 times in total.
Hutik
 
Posts: 5
Joined: 2020-06-22 14:57

Re: python command doesn't nothing

Postby Hutik » 2020-06-22 20:00

dilberts_left_nut wrote:
Hutik wrote:It trains a neural network

Seems not.

No problem running it in VSCode, it doesn't work only in terminal
Hutik
 
Posts: 5
Joined: 2020-06-22 14:57

Re: python command doesn't nothing

Postby arochester » 2020-06-22 20:02

arochester
 
Posts: 1679
Joined: 2010-12-07 19:55

Re: python command doesn't nothing

Postby Hutik » 2020-06-22 20:06

arochester wrote:Is the file made executable?

https://techendo.com/post/how-to-run-a- ... cript.html


Thank you, it was such a dumb thing. I thought it has to be executable to been run without the python command.
Hutik
 
Posts: 5
Joined: 2020-06-22 14:57

Re: python command doesn't nothing

Postby cuckooflew » 2020-06-22 23:26

Unread postby Hutik » 2020-06-22 19:59

cuckooflew wrote:
Linux is not Windows, welcome to Linux and the Debian User Forums.



Wow, I didn't know that.

That is what I figured, but that's ok, you will start learning the differences.
I'm using Debian, as you said we're in the Debian User Forum.

Yea, but that does not mean you are using Debian, you would be surprised how many new members we get and it turns out they are not using Debian,...
Conda is not in the official repositories, however it doesn't mean it's not a Debian software.

Yes it does, where you got it ?How you installed it, could have a lot to do with why it did not work as expected. I do hope you at least read some of the documentation about installing software that came from random websites, outside of the Debian repositories,... but you seem to be so much smarter then me, I am sure I don't need to tell you about that.
by arochester » 2020-06-22 20:02
Is the file made executable?

I love how the tutorial starts out:
If you cannot run or execute a python script, there is no point in being a programmer. I mean, the ultimate goal of a developer is to write scripts that are executable and actionable
Please Read.. What we expect you have already Done.
Does any one know about this ?
Users browsing this forum: Google Knows, and
My grand father knows all about everything:
…one flew east, one flew west,
One flew over the cuckoo’s nest.
cuckooflew
 
Posts: 399
Joined: 2018-05-10 19:34
Location: Some where out west


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable