คือผม เพิ่งจะเรียนโปรแกรม Python มา แล้วเรื่อง อัลกอริทึ่ม ไม่ต้องพูดถึงเลยครับ ไม่ค่อยเข้าใจมากเท่าไหร่
ก้เลยดันไปก๊อปในเวปส่งอาจารย์แล้วทีนี่ อาจารย์ดันให้แสดงค่ามากกว่าในเวป คราวนี้เลยกลายเป็นปัญหาเลยครับ
ว่า โปรเจค ผมทำเรื่องแปลงค่าตัวเลขเป็นตัวหนังสือ แล้วทีนี่ พอแปลงค่าเสร็จด้วบย คำสั่ง ฟังก์ชัน แล้ว อาจารย์ให้แสดงค่าออกมาในรูปของ หน้าต่าง Windos ครับ ซึ่งผมลองทำดูแล้วไม่ได้ เพื่อนๆ คนไหนพอจะแนะนำหรือสงเคราะห์ได้บ้างครับนี่

Hiring! บริษัทที่น่าสนใจ

Carmen Software company cover
Carmen Software
Hotel Financial Solutions
Next Innovation (Thailand) Co., Ltd. company cover
Next Innovation (Thailand) Co., Ltd.
We are web design with consulting & engineering services driven the future stronger and flexibility.
KKP Dime company cover
KKP Dime
KKP Dime บริษัทในเครือเกียรตินาคินภัทร
Kiatnakin Phatra Financial Group company cover
Kiatnakin Phatra Financial Group
Financial Service
Fastwork Technologies company cover
Fastwork Technologies
Fastwork.co เว็บไซต์ที่รวบรวม ฟรีแลนซ์ มืออาชีพจากหลากหลายสายงานไว้ในที่เดียวกัน
Thoughtworks Thailand company cover
Thoughtworks Thailand
Thoughtworks เป็นบริษัทที่ปรึกษาด้านเทคโนโยลีระดับโลกที่คว้า Great Place to Work 3 ปีซ้อน
Iron Software company cover
Iron Software
Iron Software is an American company providing a suite of .NET libraries by engineer for engineers.
CLEVERSE company cover
CLEVERSE
Cleverse is a Venture Builder. Our team builds several tech companies.
Nipa Cloud company cover
Nipa Cloud
#1 OpenStack cloud provider in Thailand with our own data center and software platform.
Bangmod Enterprise company cover
Bangmod Enterprise
The leader in Cloud Server and Hosting in Thailand.
CIMB THAI Bank company cover
CIMB THAI Bank
MOVING FORWARD WITH YOU - CIMB is the leading ASEAN Bank
Bangkok Bank company cover
Bangkok Bank
Bangkok Bank is one of Southeast Asia's largest regional banks, a market leader in business banking
MuvMi (Urban Mobility Tech Co.,Ltd.) company cover
MuvMi (Urban Mobility Tech Co.,Ltd.)
Shape the future of urban mobility towards affordable, clean, and safe solutions
T.N. Digital Solution Co., Ltd. company cover
T.N. Digital Solution Co., Ltd.
TNDS has been involving in every first move of banking’s major digital transformation.
KBTG - KASIKORN Business-Technology Group company cover
KBTG - KASIKORN Business-Technology Group
KBTG - "The Technology Company for Digital Business Innovation"
Siam Commercial Bank Public Company Limited company cover
Siam Commercial Bank Public Company Limited
"Let's start a brighter career future together"
Icon Framework co.,Ltd. company cover
Icon Framework co.,Ltd.
Global Standard Platform for Real Estate แพลตฟอร์มสำหรับธุรกิจอสังหาริมทรัพย์ครบวงจร มาตรฐานระดับโลก
REFINITIV company cover
REFINITIV
The Financial and Risk business of Thomson Reuters is now Refinitiv
H LAB company cover
H LAB
Re-engineering healthcare systems through intelligent platforms and system design.
The Gang Technology Co., Ltd. company cover
The Gang Technology Co., Ltd.
We're a Digital Agency that helps our customers transform their business into digital with ease.
LTMH company cover
LTMH
LTMH มุ่งเน้นการพัฒนาผลิตภัณฑ์ที่สามารถช่วยพันธมิตรของเราให้บรรลุเป้าหมาย
Seven Peaks company cover
Seven Peaks
We Drive Digital Transformation
Wisesight (Thailand) Co., Ltd. company cover
Wisesight (Thailand) Co., Ltd.
The Best Choice For Handling Social Media · High Expertise in Social Data · Most Advanced and Secure
MOLOG Tech company cover
MOLOG Tech
We are Modern Logistic Platform, Specialize in WMS, OMS and TMS.
Data Wow Co.,Ltd company cover
Data Wow Co.,Ltd
We enable our clients to realize increased productivity by solving their most complex issues by Data
LINE Company Thailand company cover
LINE Company Thailand
LINE, the world's hottest mobile messaging platform, offers free text and voice messaging + Call
LINE MAN Wongnai company cover
LINE MAN Wongnai
Join our journey to becoming No.1 food platform in Thailand

เลือกเอาเลยครับหรือ seaarch พวก GUI python , graphical with python อะไรพวกนี้ครับอันนี้ตัวอย่าง

http://wiki.python.org/moin/GuiProgramming

http://zetcode.com/wxpython/

ใช่เลยครับ เหมือนใน สองรูปแรกอะครับ แต่ของผมพอใส่ช่องแรก คือตัวเลข แล้วช่องที่สองเป็นการแปลงค่าของตัวเลขนั้นเป็นตัวหนังสือน่ะครับ

ต้องทำอย่างไรบ้างครับ แนะนำให้ด้วยน่ะครับ

peanarak Sat, 17/03/2012 - 11:03

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python32\lib\tkinter_init_.py", line 1399, in call
return self.func(*args)
TypeError: readnum() takes at least 1 argument (0 given)

มันขึ้นอย่างนี้อ่ะครับ

อันนี้เป็น โปรดเจคผม

def readnum(num, exact=True):

num=int(num)

if num < 10:

if num == 9:

return "เก้า"

elif num == 8:

return "แปด"

elif num == 7:

return "เจ็ด"

elif num == 6:

return "หก"

elif num == 5:

return "ห้า"

elif num == 4:

return "สี่"

elif num == 3:

return "สาม"

elif num == 2:

return "สอง"

elif num == 1 and exact:

return "หนึ่ง"

elif num == 1 and not exact:

return "เอ็ด"

else:

return "ศูนย์"

else:

if num < 20 and num >= 10:

return "สิบ%s"%(readnum(num-10, False).replace("ศูนย์", ""))

import math

if num < 100:

minus = int(math.floor(num/10)*10)

return "%sสิบ%s"%(readnum(minus/10).replace("ศูนย์", "").replace("สอง", "ยี่"), readnum(num-minus, False).replace("ศูนย์", ""))

elif num < 1000:

minus = int(math.floor(num/100)*100)

return "%sร้อย%s"%(readnum(minus/100), readnum(num-minus, False).replace("ศูนย์", ""))

elif num < 10000:

minus = int(math.floor(num/1000)*1000)

return "%sพัน%s"%(readnum(minus/1000), readnum(num-minus, False).replace("ศูนย์", ""))

elif num < 100000:

minus = int(math.floor(num/10000)*10000)

return "%sหมื่น%s"%(readnum(minus/10000), readnum(num-minus, False).replace("ศูนย์", ""))

elif num < 1000000:

minus = int(math.floor(num/100000)*100000)

return "%sแสน%s"%(readnum(minus/100000), readnum(num-minus, False).replace("ศูนย์", ""))

else:

minus = int(math.floor(num/1000000)*1000000)

return "%sล้าน%s"%(self.readnum(minus/1000000), self.readnum(num-minus, False).replace("ศูนย์", ""))

import tkinter
import sys
root = tkinter.Tk()
root.title("แปรงตัวเลข")
root.resizable(width=True,height=True)

mainFrame = tkinter.Frame(root,borderwidth=1,padx=5,pady=5)
mainFrame.pack()

varNumber = tkinter.StringVar()
varChagne = tkinter.StringVar()

NumberLabel = tkinter.Label(mainFrame,text="Number :")

NumberLabel.grid(row=1,column=1)
NumberEntry = tkinter.Entry(mainFrame,textvariable=varNumber)

NumberEntry.grid(row=1,column=2)

ChagneLabel = tkinter.Label(mainFrame,text="Chagne :")

ChagneLabel.grid(row=2,column=1)
ChagneEntry = tkinter.Entry(mainFrame,textvariable=varChagne)

ChagneEntry.grid(row=2,column=2)

tkinter.Button(root,text="ok",command=readnum).pack()

tkinter.mainloop()

คำถามแรกเลยน่ะครับ
1.ผมควรสร้างอีก ฟังก์ชันเพื่อรันค่า ฟังก์ชัน readnum(num, exact=True):หรือ ไม่ต้องสร้างก็ได้เพียงผูกค่าฟังก์ชัน เข้ากับvarNumber = tkinter.StringVar() กับ varChagne = tkinter.StringVar() ได้เลยครับ
2แล้วเมื่อผมสร้างฟังก์ชันใหม่ขึ้นมาจะเรียกค่าฟังก์ชันแแรกยังไงแล้วผูกค่าให้มันแสดงใน ช่องWindows ยังไงเหรอครับ
3.หรือการเขียนมัน ผิด? ช่วยแนะนำด้วยน่ะครับ

ปล.โปรเจค จะส่งวันพรุ่งนี้แล้ว นั่ง เขียนอยู่นานไม่รันขึ้นสักทีครับ ผู้ีรู้ ผู้ชำนาญช้วยชี้แนะ ด้วยครับผมTT
ปล.ขอพระคุณอย่างสูงสุดใน 3 โลกครับ!!!

peanarak Sat, 17/03/2012 - 22:51

File "C:\Python32\lib\tkinter_init_.py", line 1399, in call
return self.func(*args)
TypeError: test() takes exactly 2 arguments (0 given)

มันขึ้นยังนี้คือ
1.ผมต้องสร้าง อีกฟังก์ชันอีก อัน แล้วเรียกค่า ฟังก์ชัน readnum ใช่ไหมครับ
2.แล้วผูกค่าจากฟังก์ชันที่สร้างขึ้นมารึเปล่าครับ