|
Error in script?
|
|
12-13-2012, 06:02 AM
Post: #1
|
|||
|
|||
|
Error in script?
So I am designing an easy way to randomly generate numbers without needing to open up a web browser, and something is screwing up...
Code: import easyguiNow at the bottom where it displays the results, I get brackets showing up and it makes the gui look like shit. Ex. "{Done. Number is} 69" Also I need software that will compile python(I only know that and a bit of c++ so I can't do it in another language). |
|||
|
12-13-2012, 08:24 AM
(This post was last modified: 12-13-2012 11:37 AM by Drakehawke.)
Post: #2
|
|||
|
|||
|
RE: Error in script?
Use this instead and it should work
Code: easygui.msgbox(msg=('Done. Number is %d' %number), title='Results', ok_button='Finished')Here's a way to create executable files on windows http://www.py2exe.org/ |
|||
|
12-13-2012, 11:37 AM
Post: #3
|
|||
|
|||
|
RE: Error in script?
I don't actually know the language, but shouldn't there by a comma before %number?
Drakehawke SRH Leader Lua Scripter "Scientia Potentia Est" For also knowledge itself is power Francis Bacon - 1597 |
|||
|
12-13-2012, 12:30 PM
Post: #4
|
|||
|
|||
|
RE: Error in script?
Nope that was my first thought as well but putting a comma there gave me an error.
|
|||
|
12-13-2012, 03:39 PM
Post: #5
|
|||
|
|||
RE: Error in script?
(12-13-2012 08:24 AM)Kerp Wrote: Use this instead and it should work thanks, py2exe doesn't work for python 3.3 though. |
|||
|
12-14-2012, 03:34 AM
(This post was last modified: 12-14-2012 03:35 AM by Inferno IV.)
Post: #6
|
|||
|
|||
|
RE: Error in script?
shouldn't %number be %d?
http://docs.python.org/2/library/stdtype...formatting Tester of the Beta-Server. ![]()
|
|||
|
12-14-2012, 07:05 AM
(This post was last modified: 12-14-2012 09:05 AM by Kerp.)
Post: #7
|
|||
|
|||
|
RE: Error in script?
Look I just googled something like "int to string conversion python" and got an example that looked like this. I tested it to make sure that it worked and when it did I didn't think more about it.
Edit I just tested some stuff and it seems like A = "test %d", 20 will create a table with key test and value 20 and A = "test %d" %20 will create the string "test 20" Both A = "test %d", %20 and A = "test %d" 20 generates a syntax error. |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)





![[Image: hans_totalleh.jpg]](http://a134.idata.over-blog.com/400x651/3/10/33/88/hans_totalleh.jpg)
![[Image: jaeson-why-are-you-late.jpg]](http://www.troll9.com/wp-content/uploads/2013/01/jaeson-why-are-you-late.jpg)









![[Image: owneru.png]](http://img585.imageshack.us/img585/5020/owneru.png)