473,471 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help:What does this mean?

kr
Hello,
I am new to PytonWin. I have a simple script, just one line-- print "hello".
It runs OK when I use File/Run
But in command line
Script1.py

I got the error msg:
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
NameError: name 'Script1' is not defined

What's wrong with it? How can I fix it?
THKS
kr
Jul 18 '05 #1
2 2000
On Wed, 26 May 2004 05:18:18 +0800, kr wrote:
Hello,
I am new to PytonWin. I have a simple script, just one line-- print "hello".
It runs OK when I use File/Run
But in command line
Script1.py

I got the error msg:
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
NameError: name 'Script1' is not defined

What's wrong with it? How can I fix it?
THKS
kr


import Script1

--segphault

Jul 18 '05 #2
On 2004-05-25, kr <kr****@sinamail.com> wrote:
Hello,
I am new to PytonWin. I have a simple script, just one line-- print "hello".
It runs OK when I use File/Run
But in command line
Script1.py I got the error msg:
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
NameError: name 'Script1' is not defined

What's wrong with it? How can I fix it?
THKS
kr

That is not a "command line" per se. It is the "interactive interpreter"

By typing

Script1.py

You are asking the interpreter to find an object called "Script1" and
then find the "py" attribute of that object... kind of like this:
class PyScript: .... def __init__(self, pyosity):
.... self.py = pyosity
.... Script1 = PyScript('mega')

Script1.py

'mega'
On the other hand, if you have saved a python script in a file
called Script1.py and you want to run that script from the
interactive interpreter you can (as someone else pointed out)

import Script1
Most likely, you will want to create functions in your module
instead of just having a script, so that you could do something
more along the lines of

import Script1
Script1.main()
Jul 18 '05 #3

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

Similar topics

3
by: Bert | last post by:
I am sertainly no SQL expert so I am looking for a bit of help (actually quite desperate). The extra CPU and 1GB of RAM to be added to a server (Compaq DL380 G2: 1.4 GHz PIII with a Gig of RAM)...
5
by: yoelgold | last post by:
hi can someone please tell me what "document.MM_sr" is. I tried searching for a explanation on the web but cant find anything. What does MM_sr represent? and where can i get documentation on it. ...
2
by: FrodoBaggins | last post by:
Dear Team, I am using Visual Studio.NET version 7.1.3088. I went through the four main installation steps and chose to install the help files, in Step 3, as I remember. When an error occurs...
0
by: Pola | last post by:
Please Help I am using VC++ in win 2000 In my appl (Win32 project) I want to control the close operation of the apl (for example if somebody will try to close appl from the "Windows Task Manager")...
9
by: Nicole | last post by:
Okay, so I was working primarily in dreamweaver and the site looks very good in both IE (our customers primarily use this) and Firefox (my new 'thing'), but I ran it through the validator and...
2
by: Brent Taylor via AccessMonster.com | last post by:
HELP----DOES ANYONE HAVE A SIMPLE .mdb for MLM structure? Does anyone have an example database for multi-level marketing for a 3 Tier setup? Thank you, brenttaylor@actionimports.net
13
by: param | last post by:
The following C program segfaults on 64 bit Arch., but works fine on 32 bit. int main() { int* p; p = (int*)malloc(sizeof(int)); *p = 10; return 0; }
3
by: stuart_white_ | last post by:
I've just upgraded from Python 2.3.3 to Python 2.4.2, and, although the new version of Python seems to be running correctly, I can't seem access the help from the interpreter. On Python 2.3.3...
1
gauravgmbhr
by: gauravgmbhr | last post by:
ERROR: returned record type does not match expected record type HI friends what does this error means M not able to figure out
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
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,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.