Howdy, Im a beginner to programing and Ive chosen python as my first language to learn. I have recently completed my first "non-tutorial" code. I wrote a book modeled after the old "Choose Your Own Adventure" books. When ran it asks for your name, and puts you into the story, and at different intervals, asks for your input, and changes the direction of the story depending on how you choose your answers.

What I would like to know is how do i set this up as an exe so that I can share my story with others? Is there a way to set it up in python, or do i need to embed my code in another language like c# or java and create an execuitable there?

Any pointers/tips/links to other threads or tutorials, would be greatly appreciated!

Recommended Answers

All 6 Replies

Do a google search on py2exe. It's a great tool for your purpose.

Thanks for the help guys, Im currently lookin threw the py2exe wiki and ill check out your link in a bit vegaseat.

I have another newbie question and figured Id drop it in here instead of starting a new thread.

My finished script is basicly a series of long if else statements. I kinda dont like that. It starts out with 3 options, and then the if then statement branches down into more statements which all branch down and branch down, and once that story line is finished i went back and took the second option and repeated. was ALOT of typing. One thing i didnt like was i couldnt reuse "pages" later on. For instance, if the person takes a left turn and falls down a trap door and into a spiked trap, there is no way for him to back up the page and try a different option without going threw the whole program again.

Im pretty new so i dont know if its even possible to have an if else statement link to another if else statement somewhere else in the code.

Im assuming i would have to create a def, and have the page inside the def and then in the if/else statement, instead of print out whats happening, call the def and have it print, and that way the reader could type in a previous def and jump backwards in the story.

I did a little reading on python docs and i saw how you define a function, so you can call it later, but i couldnt figure out what arguements id have to put in the () for a strickly text based def, and how i would call that up in an if/else statement.


I know thats kind of rambled, but any help or pointers, or links to a page that could help me would be greatly appreciated

Can anybody help me out with this ?

if your function is strictly text based, then you don't need arguments in the parentheses for your function. if you use variables that are only used inside the function, then the same applys. however. if you need to pass information from outside the function and use it inside the function, well, that's when you need to worry about your arguments.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.