鱼C论坛

 找回密码
 立即注册
查看: 3596|回复: 5

Easygui文档学习求助

[复制链接]
发表于 2015-5-4 15:35:01 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
#-----------------------------------------------------------------------
# create "settings", a persistent Settings object
# Note that the "filename" argument is required.
# The directory for the persistent file must already exist.
#-----------------------------------------------------------------------
settingsFilename = os.path.join("C:", "FishCApp", "settings.txt")  # Windows example
settings = Settings(settingsFilename)  #报错啊 name Settings 没有被定义。应该怎么弄?我看着文档一步步做下来的,复制过来也木有用

小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2015-5-4 21:35:55 | 显示全部楼层
改为easygui.Settings
或者在脚本开头写 from easygui import *
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-5-5 13:15:34 | 显示全部楼层
还是木有用啊,

Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> from easygui import * #调用过了
>>> filesavebox()
'C:\\Users\\Administrator\\Desktop\\1'
>>> settingsFilename = os.path.join('E:','hello','world.txt')
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    settingsFilename = os.path.join('E:','hello','world.txt')
NameError: name 'os' is not defined
>>> import os #调用过了
>>> settingsFilename = os.path.join('E:','hello','world.txt')
>>> settings = Settings(settingsFilename)
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    settings = Settings(settingsFilename)
NameError: name 'Settings' is not defined  #照样出错
>>> settingsFilename = os.path.join('E:','helloworld','test.txt')
>>> import sys
>>> settings = Settings(settingsFilename)
Traceback (most recent call last):
  File "<pyshell#8>", line 1, in <module>
    settings = Settings(settingsFilename)
NameError: name 'Settings' is not defined
难道因为版本问题?我的是3,4,3的
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2015-5-7 11:05:37 | 显示全部楼层
easygui里面没有这个函数 Settings()
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2015-5-7 11:06:21 | 显示全部楼层
当然就报错了,应该是要自己定义这个函数
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-5-7 15:39:17 | 显示全部楼层
我按着小甲鱼的一步步抄下来的啊。
那应该怎么弄?
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2026-2-15 22:53

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表