Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95885

error

Path csiph.com!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <jorge.conrado@cptec.inpe.br>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'sys': 0.05; 'nameerror:': 0.09; 'received:150': 0.09; 'sys.argv[0]': 0.09; 'python': 0.10; 'python.': 0.11; 'subject:error': 0.11; 'question.': 0.13; 'def': 0.13; 'constants': 0.16; 'numpy': 0.16; 'run.': 0.16; 'scripts.': 0.16; '"",': 0.22; 'defined': 0.23; 'advance.': 0.23; 'thanks,': 0.24; 'import': 0.24; '(most': 0.24; 'downloaded': 0.24; 'header :User-Agent:1': 0.26; 'error': 0.27; 'yesterday': 0.27; 'fedora': 0.29; 'question:': 0.29; "i'm": 0.30; 'print': 0.30; 'code': 0.30; 'run': 0.33; 'point': 0.33; 'traceback': 0.33; 'version:': 0.33; 'file': 0.34; 'skip:d 20': 0.34; 'could': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'two': 0.37; 'release': 0.37; 'charset:us-ascii': 0.37; 'starting': 0.37; 'someone': 0.38; 'hi,': 0.38; 'to:addr:python.org': 0.40; 'software': 0.40; 'from:no real name:2**0': 0.60; 'skip:n 10': 0.62; 'please,': 0.63; 'received:br': 0.66; '100%': 0.72; 'commercial': 0.73; '2.7.8': 0.84
X-Virus-Scanned Debian amavisd-new at tornado
To python-list@python.org
Subject error
X-PHP-Originating-Script 33:rcube.php
MIME-Version 1.0
Content-Type text/plain; charset=US-ASCII; format=flowed
Content-Transfer-Encoding 7bit
Date Wed, 02 Sep 2015 15:18:43 -0300
From jorge.conrado@cptec.inpe.br
X-Sender jorge.conrado@cptec.inpe.br
User-Agent Roundcube Webmail/1.0.3
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.27.1441217929.8327.python-list@python.org> (permalink)
Lines 93
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1441217929 news.xs4all.nl 23791 [2001:888:2000:d::a6]:56320
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:95885

Show key headers only | View raw


Hi,


I have a Python version: Python 2.7.8

I'm runing it on: Fedora release 21


Yesterday I a sent a question:


I'm starting in the Python scripts. I run this script:


import numpy as np

import netCDF4

f = netCDF4.Dataset('uwnd.mon.ltm.nc','r')


f.variables


and I had the message:


netcdf4.py
Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
NameError: name 'netcdf4' is not defined


I had two answers to my question. But I could not understand them. I 
don't have expericence with Python. So I downloaded from the Web a code 
to calcluate the dew point temperature:


import sys
import numpy as np

# approximation valid for
# 0 degC < T < 60 degC
# 1% < RH < 100%
# 0 degC < Td < 50 degC

# constants
a = 17.271
b = 237.7 # degC

# sys.argv[0] is program name
T=float(sys.argv[1])
RH=float(sys.argv[2])


def dewpoint_approximation(T,RH):

     Td = (b * gamma(T,RH)) / (a - gamma(T,RH))

     return Td


def gamma(T,RH):

     g = (a * T / (b + T)) + np.log(RH/100.0)

     return g


Td = dewpoint_approximation(T,RH)
print 'T, RH',T,RH
print 'Td=',Td


Then I run it and I had the message:

             p2.py


Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
NameError: name 'p2' is not defined


Like the same error that I had for my first run.

Please, someone can help me. I have a commercial software and I would 
like to use Python.

In advance. Thanks,

Conrado

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

error jorge.conrado@cptec.inpe.br - 2015-09-02 15:18 -0300

csiph-web