Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i run a python doctest in windows?

Tags:

python

windows

I learned how to do this on Unix lab computers, and none of the commands are working ? I found other stack overflow questions about modifying the path directory and when i type python in Cmd, the python program starts to work. However, I don't know how to open a file i want to test ? is the command still -m doctest file_to_be_tested ?

Also, do I have to go to that point in my directory before I can open python ?

Somethings that i have tried are: 1) opening python first, and then going to where my file is, and then trying the -m doctest command 2) going to the directory place first, and then opening python, then the -m doctest command

I am pretty confused. If it makes a difference, I am using sublime as a text editor

like image 623
user1476390 Avatar asked Aug 20 '26 09:08

user1476390


1 Answers

Somethings that i have tried are: 1) opening python first, and then going to where my file is, and then trying the -m doctest command 2) going to the directory place first, and then opening python, then the -m doctest command

-m is a command-line switch, it has no meaning inside the interpreter.

You need to go to the directory that contains the file you want to test and run:

> python -m doctest file-to-test
like image 157
Matthew Trevor Avatar answered Aug 22 '26 23:08

Matthew Trevor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!