Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'sys': 0.04; '__name__': 0.07; 'advance,': 0.07; 'args': 0.07; 'executed': 0.09; 'nameerror:': 0.09; 'skip:" 60': 0.09; 'def': 0.13; "'__main__':": 0.16; 'err:': 0.16; 'invoking': 0.16; 'jython': 0.16; 'subject:Newbie': 0.16; 'sys.exit(2)': 0.16; 'traceback': 0.16; 'importing': 0.19; 'last):': 0.23; 'skip:# 10': 0.25; 'script': 0.26; 'google': 0.27; 'thanks': 0.29; 'problem': 0.29; 'import': 0.32; 'to:addr:python-list': 0.32; 'beginning': 0.33; 'several': 0.33; 'skip:" 10': 0.34; 'file': 0.35; 'print': 0.35; 'try:': 0.35; 'hello,': 0.36; 'getting': 0.36; 'charset:us-ascii': 0.36; 'code:': 0.38; 'help': 0.39; 'to:addr:python.org': 0.39; 'except': 0.39; 'below.': 0.64; 'postings': 0.65; 'execution,': 0.91 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 77160.23998.bm@omp1002.mail.sp2.yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1301919286; bh=8czja8NA/EHRR6FbclVZXiPZQBcyn6vDhEsl3BcDBps=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=uhCRumDiRqIHwU3UVP3vB/MfrTnQQVFZAGp5z4sRri0JQOpuNhGZ1upWX2cwauhI0jN/jB6u3xGvYQIsRKr8I8HwwwnWWyvapyCCcXHbzEfLWGpCW1gNZ5/ztjIbyBPNBXeNK5kGvqjKR4Njig9E6Lly5uKmZ6Gh0Lin3f2yYfk= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=OB+1PmTQVwVIUwSe6xtV05wKo7YsYBn2+2dnUPA1qWS+VBiZADHuNw9dqnbe9S8mPrTQ3Z6kbE9GSw2I76RveuZLPJG8igt1PFUupNMZv86P2JS/AXhTygY4fcMqd3X6V+//U40MxygvakGH5WvzoSnyj1o56Y3n9GQywi4ixnw=; X-YMail-OSG: BjXgSfoVM1lUBHuLgTFFQLcb.DdTb5Kujd4h7weTMda3Pd2 lYjPzqmjDMsxQ97QKGFhWBPQynSjmzrVKBy8NmKfcv4MBh7SBeG8A_Fj4bwG cUfHj2MZEih7LY5YRnPNXsUOX0tjBAjVHK3vKohmE8Fvgrsnszpp7emFkixi whG54pVdoNKGlIwTON1zp5VQldN0.mXyri_A0RjZ31juvGdsEabZslqcB7fJ OOf0CoWJ2QoqGZOIIarQZ2DjkuSf2fD8PggHdHiLIx_HlXFmEBmM8D21pF.u t0zMgqXYsSwugcRi1.44YxV2gBTw8ndUDgc1WPBXBE.ocqZ5Q4IDqZadlAJt WY8CsZJ3Fbh.F7.m6rWTP_rGmK_X8cieDI1_5NYc7UqKmtd7Gx2GEuzcncGE peUy6vzpbp90M X-Mailer: YahooMailRC/559 YahooMailWebService/0.8.109.295617 Date: Mon, 4 Apr 2011 05:14:46 -0700 (PDT) From: Mustafa Cayci Subject: Newbie -> NameError: getopt To: python-list@python.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1301919295 news.xs4all.nl 41110 [::ffff:82.94.164.166]:51578 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2562 Hello, I followed several postings in Google and came up with the beginning of the following code: During the execution, I am getting Problem invoking WLST - Traceback (innermost last): File "/home/oracle/wlsuserconfigfiles/./Health_Check_Servers.py", line 80, in ? File "/home/oracle/wlsuserconfigfiles/./Health_Check_Servers.py", line 22, in main NameError: getopt I thought I was importing the "getopt" as shown below. Thanks for you help in advance, Mustafa #Conditionally import wlstModule only when script is executed with jython if __name__ == '__main__': from wlstModule import *#@UnusedWildImport import sys import os from java.lang import System import getopt serverName = '' portNumber = '' ucf = '' ukf = '' adminURL = '' protocolName = '' portNumber = '' def main(argv): try: opts, args = getopt.getopt(sys.argv[1:], "s:p:t:u:k:") except getopt.GetoptError, err: print str(err) usage() sys.exit(2) ...