hi I get user argv from the command line as follows: '0x000aff00'
'0x000aff00'
and I want python to treat it as hex directly ...
str = sys.argv[1]
how is this possible? thanks!
Try: i = int(sys.argv[1], 16)
i = int(sys.argv[1], 16)
try: i = int(sys.argv[1], 16) except Exception,e: print e else: # carry on
Source: https://habr.com/ru/post/1725387/More articles:run application after installshield patch - patchIs ASP.NET MVC required to reboot the server? - installationWhat protocols exist that can be used with WCF? - c #BlackBerry - Get the current process ID - processHow to reduce undo tablespace size in oracle? - oracleWhat is the right and easy way to handle content URLs in ASP.NET MVC? - asp.net-mvcJava RDF-библиотеки для Google App Engine? - javaIphone add task to EDT? something like SwingUtilities.invokeLater? - iphoneWhy is string.Empty more efficient than "" in .Net - stringmultithreading: event driven - multithreadingAll Articles