zoukankan      html  css  js  c++  java
  • Python 安装过程和第一个Demo

    环境 win 8.1 64位系统,Python33版本

    1、配置 eclipse时,下载的jdk 和eclipse的版本位数不一致,花费了一些时间。eclipse 版本和JDK版本一致直接安装完,就可以正常打开eclipse,不需要再进行额外配置。

      在打开时错误提示:java was started but returned exit code=13

      错误截图如下:

      

    2、第一个python demo

      配置和python 后,测试demo。 hello world,总要有这么一下。

      刚开始的代码:    

    def test(n):
        if n == 1:
            return 1
        else:
            return  2*n 
        
    print test(2);
    

      执行了好久都是有问题,突然想起来在之前看python介绍时,python 对缩进要求很严格,于是开始各种尝试,依然出错。最后找到出错是因为print 需要加()

    def test(n):
        if n == 1:
            return 1
        else:
            return  2*n 
        
    print (test(2));
  • 相关阅读:
    Gym 101194L / UVALive 7908
    POJ 2259
    POJ 2559
    Gym 101194E / UVALive 7901
    Gym 101194D / UVALive 7900
    一种整数集上二分的正确写法
    日常训练记录
    Gym 101194C / UVALive 7899
    Gym 101194A / UVALive 7897
    HDU 5542
  • 原文地址:https://www.cnblogs.com/enjoyco/p/4369077.html
Copyright © 2011-2022 走看看