473,623 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to run Python file?

I have installed ActivePython
http://www.activestate.com/Products/ActivePython/
How I can run Python file, test.py?

Sep 2 '06 #1
10 2346
mistral wrote:
I have installed ActivePython
http://www.activestate.com/Products/ActivePython/
How I can run Python file, test.py?
$ python test.py

or

$ ./test.py (if test.py is executable)
Sep 2 '06 #2
Pontus Ekberg wrote:
mistral wrote:
>I have installed ActivePython
http://www.activestate.com/Products/ActivePython/
How I can run Python file, test.py?

$ python test.py

or

$ ./test.py (if test.py is executable)

Thats if you use un*x. If you word under windows, the first would work,
but rather use some IDE like IDLE or SPE than mess with the windows
command line. Then you just load the file and run it from the menu.

zefciu
Sep 2 '06 #3
Ant

zefciu wrote:
Pontus Ekberg wrote:
....
$ python test.py

or

$ ./test.py (if test.py is executable)
Thats if you use un*x. If you word under windows, the first would work,
As would:
test.py
Assuming python grabbed the .py extensions correctly (which it shouold
have done with any recent version).

Sep 2 '06 #4
"Ant" <an****@gmail.c omwrote in news:1157218244 .750434.36220
@h48g2000cwc.go oglegroups.com:
>
zefciu wrote:
>Pontus Ekberg wrote:
...
$ python test.py

or

$ ./test.py (if test.py is executable)

Thats if you use un*x. If you word under windows, the first would
work,
>
As would:
>test.py

Assuming python grabbed the .py extensions correctly (which it shouold
have done with any recent version).

As would:
test
.... assuming you're on windows (Win2K or WinXP at least) and you've
added ".py" to your PATHEXT environment variable.

--
rzed
Sep 2 '06 #5

Rick Zantow писал(а):
"Ant" <an****@gmail.c omwrote in news:1157218244 .750434.36220
@h48g2000cwc.go oglegroups.com:
zefciu wrote:
Pontus Ekberg wrote:
...
$ python test.py

or

$ ./test.py (if test.py is executable)
Thats if you use un*x. If you word under windows, the first would
work,
>
As would:
>test.py

Assuming python grabbed the .py extensions correctly (which it
shouold
have done with any recent version).

As would:
test
... assuming you're on windows (Win2K or WinXP at least) and you've
added ".py" to your PATHEXT environment variable.
--
rzed
-------------

Assuming I have Windows XP, and I installed ActiveState Python. No any
other additional manipulations were done, no any PATHEXTes environment
variables, etc, etc, nothing. How many preparatory work required to run
one small python file?

Sep 2 '06 #6
"mistral" <po*******@soft home.netwrote in news:1157239512 .139823.15650
@74g2000cwt.goo glegroups.com:

[...]
Assuming I have Windows XP, and I installed ActiveState Python. No any
other additional manipulations were done, no any PATHEXTes environment
variables, etc, etc, nothing. How many preparatory work required to
run
one small python file?
I hope I'm understanding your question correctly.

I can't really answer with regard to ActiveState's version. I've only
used the Python.org binary installation for a long time, and it does set
up the path on installation. I don't think it adds the PATHEXT, but I
really don't remember; I've had some version on my computer since Python
1.5.2. Without that, though, all you'd need would be to type
python test.py
.... given the other assumptions you've indicated. Oh, if you are running
the python program (located in a directory not in your path) from some
other directory, you'd need to specify the full pathname, I suppose,
like
python c:\dir\test.py
I'd assume that ActiveState also sets the path up, but again, I can't
say for sure that it does. If it doesn't, then you'd add the Python root
directory to your path or else you'd have to specify *that* each time as
well.

--
rzed

Sep 3 '06 #7
mistral wrote:
I have installed ActivePython
http://www.activestate.com/Products/ActivePython/
How I can run Python file, test.py?
You can open up the folder containing the "test.py" file, then
double-click on the file to run it. A command-line window should pop
up, and your program will run in it. Once the Python program is done
running, the command window will probably close immediately.

--Jason

Sep 3 '06 #8
mistral wrote:
I have installed ActivePython
http://www.activestate.com/Products/ActivePython/
How I can run Python file, test.py?
Sheesh, you must have had ten replies and nobody bothered to point you
to the frequently-asked questions ... kids today!

http://www.python.org/doc/faq/windows.html

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Sep 3 '06 #9

Steve Holden писал(а):
mistral wrote:
I have installed ActivePython
http://www.activestate.com/Products/ActivePython/
How I can run Python file, test.py?
Sheesh, you must have had ten replies and nobody bothered to point you
to the frequently-asked questions ... kids today!
http://www.python.org/doc/faq/windows.html
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden
-----------

Really, looks its clear and straightforward Python FAQ.

thanks.

Sep 3 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
3681
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. Andrew dalke@dalkescientific.com
25
7741
by: Xah Lee | last post by:
Python Doc Problem Example: gzip Xah Lee, 20050831 Today i need to use Python to compress/decompress gzip files. Since i've read the official Python tutorial 8 months ago, have spent 30 minutes with Python 3 times a week since, have 14 years of computing experience, 8 years in mathematical computing and 4 years in unix admin and perl, i have quickly found the official doc: http://python.org/doc/2.4.1/lib/module-gzip.html
0
1601
by: Martijn de Munnik | last post by:
Hi, I'm trying to build/install pysqlite on a Solaris 10 platform. I've got Sun Studio 11 on a AMD 64 platform and got this error. I'm a python newbie and just want to install trac. I've got ActiveState python: ActivePython 2.4.3 Build 11 (ActiveState Software Inc.) based on Python 2.4.3 (#1, Apr 3 2006, 18:07:58) on sunos5 Type "help", "copyright", "credits" or "license" for more information.
0
4552
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 349 open ( +7) / 3737 closed (+25) / 4086 total (+32) Bugs : 939 open (-12) / 6648 closed (+60) / 7587 total (+48) RFE : 249 open ( -8) / 278 closed (+12) / 527 total ( +4) New / Reopened Patches ______________________
0
8217
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8661
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6104
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2590
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1467
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.