473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Running a Python Script via PuTTY

I wrote a python script and I have copied my file (verification.py) into my http directory. However, when I try to run the script I get many errors...

Expand|Select|Wrap|Line Numbers
  1. ..
  2. : No such file or directoryline 1: #!/usr/bin/python
  3. : command not foundect.py: line 3:
  4. ./Verification_Project.py: line 4: from: command not found
  5. : command not foundect.py: line 5:
  6. ./Verification_Project.py: line 6: from: command not found
  7. import: unable to open X server `'.
  8. import: unable to open X server `'.
  9. import: unable to open X server `'.
  10. import: unable to open X server `'.
  11. import: unable to open X server `'.
  12. import: unable to open X server `'.
  13. import: unable to open X server `'.
  14. import: unable to open X server `'.
  15. ./Verification_Project.py: line 15: from: command not found
  16. import: unable to open X server `'.
  17. : command not foundect.py: line 19:
  18. ./Verification_Project.py: line 20: syntax error near unexpected token `('
  19. '/Verification_Project.py: line 20: `today = datetime.date.today()
  20. ..
I am not sure why I am getting these errors because when I run the script in Python it works fine.

Thanks!
Jul 15 '09 #1
6 31003
bvdet
2,851 Expert Mod 2GB
At the command line, did you type in:
python path/verification.py
??
Jul 15 '09 #2
Initially, no I did not, I typed ./Verification.py
However, I just tried that from my http directory which is where the file is located and it said

python: can't open file 'path/Verification_Project.py': [Errno 2] No such file or directory
Jul 15 '09 #3
bvdet
2,851 Expert Mod 2GB
From your HTTP directory, try typing in python Verification.py. When I posted python path/Verification.py, I did not mean path literally, but the actual path to your file on your system. You may also need the path to the python interpreter.
Jul 15 '09 #4
I wrote my python script in windows, however I need to convert it so that it will run on a linux computer. Do you know how I would convert from windows to linux?
Jul 17 '09 #5
bvdet
2,851 Expert Mod 2GB
Most Python code is not platform dependent. PuTTY is available for Windows and Unix platforms.

-BV
Jul 17 '09 #6
There are two ways to doing it.
Method 1
First make the script executable
chmod u+x <script>.py
./<script>.py

Method 2
Python -v <script>.py
Oct 24 '14 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: xunil | last post by:
hi, could any one please help show me how to run a python script in linux ? when i try "python script.py" it just does nothing this is the script iam trying to run #!/usr/bin/env python...
8
by: Harlin Seritt | last post by:
I have a remote linux server where I can only access it via ssh. I have a script that I need to have run all the time. I run like so: python script.py & It runs fine. When I log off ssh I...
2
by: Benjamin Rutt | last post by:
I often execute a long-running python script which is a "driver" for my application; it may run for several hours on a large input. Under CPython, is it safe for me to modify the Python script...
11
by: volcano | last post by:
Hello, folks! A trivial question - I have a working Python script that I have to invoke from C++ code. No fancy stuff - just run the whole script with its parameters. No callbacks, no signalling -...
13
by: Alligatorr | last post by:
First, I'm completely new to using python, but willing to learn. I have very little programming skills, but again, I'm willing to learn. Second, I have a script (given to me) that receives data...
1
by: Aspersieman | last post by:
Hi All I have a windows service (attached file). I basically just calls another script every 60 seconds. I can install, start and stop this service as expected with: ParseMailboxService.py...
3
by: Gros Bedo | last post by:
Hello :-) I have a question about Python and Linux shell. I have a python program which is permanently resident in the end-user system. I'm currently producing a RPM package, and it works nicely....
1
by: Gros Bedo | last post by:
Yes I've seen that each python script calls its own instance of Python. Buthow to know which is the good one in bash ? Is there a command that gets the parameters of process, so I could use grep to...
0
by: norseman | last post by:
Gros Bedo wrote: ============================== Yes. man ps explains try ps -AFL | grep then kill -9 found (check it more than twice) 1) If your script is known to hang use what...
3
by: shalong | last post by:
Hi all, I want to run a python script to create a large number of Exchange mailboxes. I am using the os.system("New-Mailbox.......) method. However if i try to execute the python script in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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 project—planning, coding, testing,...
0
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...

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.