没有合适的资源?快使用搜索试试~ 我知道了~
More advanced Python & Tkinter 更高级的 Python 和 Tkinter.doc
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 45 浏览量
2024-04-03
10:38:35
上传
评论
收藏 163KB DOC 举报
温馨提示
试读
16页
More advanced Python & Tkinter 更高级的 Python 和 Tkinter.doc
资源推荐
资源详情
资源评论
AND
Well done!
You’ve made it through the forest of Tkinter, past the haunted lake of Pmw
and emerged (fairly) unscathed from a duel with Tabnanny. Good on ya!
Now, it gets REALLY interesting
Obviously, you’ve all read the study design for Unit 4 and you would know that
the SAC for Outcome 1 is as follows:
“On completion of this unit the student should be
able to apply the stages of software development
to produce purpose-designed software that takes
into account a networked information system
objective and the needs of end-users.”
A few key words here that I have highlighted for you:
Firstly – You have to design your own software (just like in Unit 3) using
Python to meet an objective
Secondly – We need to use a networked information system – so that a
number of people can use the system simultaneously. Remember your SAC
in Unit 3? Well, really only one user at a time could use it – NO GOOD for a
networked system
Thirdly – we need to meet the needs of the users of a particular scenario
So, what we’re going to do is create a GUI (Graphical User Interface) using
Tkinter, to allow us to enter and retrieve data that is saved in a MySQL
database.
I’m not going to go into a great deal about what MySQL is, how it works etc.,
short of saying that its FREE, you can download it at home if you want, it’s a
database and its pretty common throughout the world. There are lots of
variations on it (PostGreSQL, MSSQL amongst others)
If you want more information – go to www.mysql.com and there’s loads of
information
On with the show…
Chapter 1 – Getting MySQL installed and sorted
Thankfully, MySQL is already installed and ready to go on our (your) server
that you are going to be playing with, so no need to worry about that. If you
want to set it up at home, go to www.mysql.com, download the version that
you need and follow the instructions – dead easy. If you DO NOT have
access to the internet, or you are on dial up, see me for a copy of MySQL that
you can have on your flashdrive.
You will also need to download the MySQL bindings that allow Python to talk
to MySQL – these are already downloaded for us, so no need to worry, but if
you want to install these at home, go to:
http://sourceforge.net/project/showfiles.php?group_id=22307
and download the latest release version (at time of writing it was 1.2.2) or see
me with your flash drive. You just run the .exe file – dead easy!
Ok, so to get access to MySQL on the server, you need to type in
At home, you need to go to START > PROGRAMS > MySQL > MySQL
Server 5.0 > MySQL Command Line Client and input details straight from
there.
Chapter 2 – Some SQL queries
You should now be faced with a black window (called the COMMAND LINE
CLIENT) where you input data. It will look something like this.
Your PASSWORD is xxxxxx
Now the screen will look like this
All your commands to create your database table and set field sizes, names
and the such like will be done here
� Type help after the mysql> cursor
You will have a list of commands that you can use. At the level we are using
MySQL, we won’t be using many of these, with the exception of USE and
EXIT.
NOTICE how the mysql> cursor is back – that means you can type
something in straight away.
� Now type in SELECT VERSION(), CURRENT_DATE;
You should have a table telling you the version of MySQL that you are using
and the current date
MySQL is not too bothered about case, so you could type in:
� select version(), current_date;
Now try:
� SELECT USER();
The result of this is going to be important, so make a note of it. When I type
this in I get this result:
NOTICE that I typed in select user() and pressed Enter, then typed in ;
to get the result. All queries in MySQL need to end with a semicolon (;). If
you don’t put it in, then nothing will happen and you will need to enter it at the
next cursor.
NOTICE that the result of this is root@localhost
root is my USER
localhost is my host.
I will need to use these in my script later on, so keep a note of the result you
get.
剩余15页未读,继续阅读
资源评论
百态老人
- 粉丝: 1641
- 资源: 2万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功