Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8002191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:17:10+00:00 2026-06-04T16:17:10+00:00

This seems, to be, as far as I can tell, completely random. I don’t

  • 0

This seems, to be, as far as I can tell, completely random. I don’t know what’s going on with it. I’m on Windows.

>>> python ex.py
  File "<stdin>", line 1
    python ex.py
            ^
SyntaxError: invalid syntax

Can anyone tell me what’s causing it? It’s weird as hell… python 2.7, by the way. Comes up the same whether I go through Powershell or CMD.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:17:11+00:00Added an answer on June 4, 2026 at 4:17 pm

    You are inside an interactive session of the python interpreter itself, and you can not make calls to python in that way.

    Run the command directly from the command line instead.

    If you want to execute a file from within python in this way, you must use:

    >>> execfile("ex.py")
    

    By the way, don’t get in the habit of using execfile – while handy, unless you really know what you’re doing and why, it’s not considered the best idea.

    To elaborate on that, per @Levon’s request, execfile, along with exec and eval, cause your script to run absolutely arbitrary code. If you control all of your code and are the sole user, then this isn’t really a problem. However, because this power is so great, it could easily be abused by others. So, if you distribute your code, and there is absolutely any other way to design it other than to use execfile, do so.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like the simplest Git question, but I can't find ANYTHING on it.
This seems like something that could be quite useful and yet and I can't
All my research so far suggests this can't be done, but I'm hoping someone
Ok, this seems simple but I can't find a solution to save my life.
As far as I can tell, there's no way to print out a struct
As far as I can tell, there is no reliable way to loop a
This is what I've come up with so far, but it doesn't seem very
This seems a 'stupid' question, but let me explain. I'm working for a company
This seems like a repeated question but i'm not able to get my answer.
This seems to be primary Question. but i search it and i couldn't find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.