Select to view content in your preferred language

raw_input() and input() functions? What happened to them in the ArcGISPython Window?

3950
4
11-24-2010 11:26 AM
Ryan_Galbraith
Occasional Contributor
raw_input() and input() functions?  What happened to them in the ArcGIS Python Window?
I get a runtime error.
0 Kudos
4 Replies
JasonScheirer
Esri Alum
STDIN is not functional in the Python window in ArcGIS 10 (the interpreter doesn't actually open stdin/stdout pipes to talk to the interpreter), and therefore input and raw_input do not work either.
0 Kudos
by Anonymous User
Not applicable
Original User: xiaowen

Is there anyway to work around this?

thanks
0 Kudos
KimOllivier
Honored Contributor
import win32api
win32api.MessageBox(0,"msgbox", "title")
win32api.MessageBox(0,"ok cancel?", "title",1)
win32api.MessageBox(0,"abort retry ignore?", "title",2)
win32api.MessageBox(0,"yes no cancel?", "title",3)


You can use the Windows API to popup messages and store the response. Have a look in the Pythonwin help for additional tools.

You can also use Tkinter (standard library) to create a full dialog. See the example to create a scrolling list to supplement the data driven pages tool on the Resource Centre. Python Selection Script with Tkinter User Interface
http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=F0B54854-1422-2418-A0F6-37042...
0 Kudos
by Anonymous User
Not applicable
Original User: rdg129

That works!  Thanks.
0 Kudos