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 9192315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:53:31+00:00 2026-06-17T20:53:31+00:00

I just started learning python for the online course provided by 10gen education, MongoDB

  • 0

I just started learning python for the online course provided by 10gen education, MongoDB for developers (python), i have installed python 2.7 successfully and set the environment vars(path: C:\python27), i can open the python shell and execute the commands and stuff but when i created a python script file named (test.py) and open the command promt, navigated to the current directory C:\10gen and when i try to run it using python test.py it shows me an error

python: can't open file 'test.py': [Errno 2] No such file or directory

however if i execute the same obove command with .txt extension like python test.py.txt it works fine. my question is how would i make filename.py execute from command line .

PS:, my script file contains simple function which iterates over an list and prints it.

Thanks in advance

  • 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-17T20:53:32+00:00Added an answer on June 17, 2026 at 8:53 pm

    This has happened because you used Notepad and tried to save the file as (.txt) TextFile option in Save menu.

    use double quotes around “file.py” or select All Files from the dropdown(of Save as type) in the Save As Dialog box.

    enter image description here

    I recommend using EMacs for Python development. You can also start off with IDLE 🙂

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

Sidebar

Related Questions

I am new to python and just started learning it today. I have installed
I have just started learning python version 3 and trying to create a file
I just started using/learning Python and have some questions. I have a text file
I just started learning python and django and I have a question. I got
So I just started learning Python and just now set up my Notepad++ to
I have just started learning python and am getting caught up. I come from
I started learning Python just today using Python 2.7 and I have a question
I just started learning Python today. I have a list: [text:u'Oranges', text:u'Apples', empty:'', empty:'']
I have just started learning python and i was wondering how i would get
I've just started learning Python and have started doing some problems just to help

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.