我刚开始使用Python而且我似乎无法运行最基本的动作?谷歌不会帮助我,因为这是一个太普通的问题,请帮助我。 [英] I just started Python and I can't seem to run the most basic toturial? Google won't help me because it's a way too generic question please help me.

查看:75
本文介绍了我刚开始使用Python而且我似乎无法运行最基本的动作?谷歌不会帮助我,因为这是一个太普通的问题,请帮助我。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

def hello():

打印Hello World并返回None

print(Hello World)



所以这是来自Python的代码,它应该显示在[1]中:runfile('/ Users / fangohr / Desktop / hello.py',wdir = r'/ Users / fangohr / Desktop')

Hello World但是只获得Hello World消息,只有这个runfile('C:/Users/Himen/.spyder-py3/hello.py',wdir ='C :/Users/Himen/.spyder-py3')。



我尝试过:



谷歌,reddit,ocw和edx ...没有帮助我的问题我猜是太基本了

def hello():
"""Print "Hello World" and return None"""
print("Hello World")

So this is the code from Python toturial and it should show me In [1]: runfile('/Users/fangohr/Desktop/hello.py', wdir=r'/Users/fangohr/Desktop')
Hello World but instead in get no Hello World message only this runfile('C:/Users/Himen/.spyder-py3/hello.py', wdir='C:/Users/Himen/.spyder-py3').

What I have tried:

Google, reddit, ocw and edx...no help my question I guess is too basic

推荐答案

查看你的文件夹来确切地检查你在哪里存储python程序文件,并从那里运行它。您可以使用命令行:

Look in your folders to check exactly where you are storing the python program file, and run it from there. You can use the command line:
python C:/Users/Himen/.spyder-py3/hello.py



或将文件加载到python IDE(IDLE)。


or load the file into the python IDE (IDLE).


这篇关于我刚开始使用Python而且我似乎无法运行最基本的动作?谷歌不会帮助我,因为这是一个太普通的问题,请帮助我。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆