Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Number Series
#11
Your original post has you calling bash Question8.py. Wouldn't that then be a bash syntax error? Shouldn't you be running python Question8.py?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#12
(Jan-17-2019, 02:06 PM)hbknjr Wrote:
(Jan-17-2019, 01:55 PM)MrGoat Wrote: Still doesnt work whether I use shebang or not

(Jan-17-2019, 05:53 AM)MrGoat Wrote:
Error:
CaiGengYangs-MacBook-Pro-2:Lesson 1 caigengyang$ bash Question8.py Question8.py: line 5: syntax error near unexpected token `(' Question8.py: line 5: `for i in range(6):'

Without python shebang your command bash Question8.py will run it as a bash script.
Try python Question8.py or use proper python2 shebang.


Thanks! It works now. LOL , i should have typed "python3 Qn8.py" instead of "bash Qn8.py" haha
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  find the sum of a series of values that equal a number ancorte 1 504 Oct-30-2023, 05:41 AM
Last Post: Gribouillis
  Convert quarterly time series to monthly time series donnertrud 1 5,187 May-22-2020, 10:16 AM
Last Post: pyzyx3qwerty

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020