2011-11-21 19:31:32

Hi i  would like to learn a cupple things about python. I have found a lot of tutirals online but one thing that anoys me about python and other programing langwidges (although i no there is a comand for this in other langwidges) is the fact that, when i run my (dot) py file the window opens then instetly closes.
is there a wait comand i can use or something? to see that my file has run correctly. because the idal (python gui( isn't accesible to us.
I am using notepad 2.
so any help would be apresheated.
thanks

I'm gone for real :)

2011-11-21 20:52:24

Will python output to the windows command prompt?
I find the command prompt very useful for programming. I'd definitely recommend learning how to use it.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2011-11-21 20:58:00

I don't no if it does. i've herd of the camand prompt but never got round to trying it.
where can i go to start learning about it and how would i no if python outputted to the comand prompt?

I'm gone for real :)

2011-11-22 01:56:24

Hi,

the command prompt is accessed by going to the run dialog, and executing "cmd"... AKA typing it iin de box and hittin' dat OK button.
Then you're in the console window. At this point, all you do is type commands, the computer does the appropriate action, then returns text for status.
Typing help gives you a list of commands to be used, at least in the windows shell.
Now: To run your python code, you do the following:
- Change to the path of your code
type the drive letter, followed by colon and press enter. This moves you to that drive. Like "c:"
Then, cd to the directory of your script. Like: "cd "documents and settings\brad\my documents\python\codes\" (This is a very long path. I recommend putting it somewhere, like c:\python\codes\, to make it easier to get to. Also, you can have it autocomplete names with tab.)
Once you're there, if the default app to open your code with is the snake, just type it's name and press enter. You'll get notified if anything went wrong.
Please note: if anything was worded wrongly or described wrongly or inappropriately in this post, it's due to my amount of sleepyness. I just felt too helpful to disregard and wait for tomorrow. big_smile

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2011-11-22 02:05:03

thanks a lot. i will try that now. thank you very much.

I'm gone for real :)

2011-11-22 02:07:46

Hi,

No problem. Love to help. smile
I myself probably couldn't help you that much with the snake though, I didn't mess with it enough. Sorry. sad

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2011-11-22 03:10:06

hmm i must admit I don't have a clue what you are talking about. snake? where?
oh nooo! it's going to biiite meeee!
arrrrg!
(dies)
muhahhahahaha now i shele take over the world with my great snake of doom! smile

I'm gone for real :)

2011-11-22 03:59:42

Hi,
The snake/ lol....I've never heard that one before...good sudonym.

Best Regards,
Hayden

2011-11-22 11:07:00

Hi,

Haha the Snake... It's Python. Get the point? big_smile
I just had to call it snake. In this thread though, snake means Python... Most likely.

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2011-11-22 11:38:30

As far as I know, and be warned that my knowledge of ancient greek mythology is pretty poor, Python was a snake who was supposed to be threatening the city of Delphy (another programming paralel here, lol), killing people, destroying buildings, etc. When, finally, someone was able to defeat him (not sure if it was heracles or another hero or even a god), the city was rebuilt into the famous residence for the oracle, also called Pythia, and many other gods. I believe they even started holding Pythian games there regularly as a memorandum of the victory over Python, and that might be where the idea of Olympic games actually began.
Lukas

I won't be using this account any more or participating in the forum activity through other childish means like creating an alternate account. I've asked for the account to be removed but I'm not sure if that's actually technically possible here. Just writing this for people to know that I won't be replying, posting new topics or checking private messages until the account is potentially removed.

2011-11-22 11:41:15

Hi,

As far as I know, some called Python a dragon. And Apollo was the one who defeated him. I do believe that I'm quite correct here. smile

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2011-11-22 12:29:03

Oh, all right then, thanks for the correction. :-) I've certainly heard him described as snake in Czech, and I can't remember him portrayed as a dragon, but who cares, both dragons and snakes should be classified as reptiles. LOL
Lukas

I won't be using this account any more or participating in the forum activity through other childish means like creating an alternate account. I've asked for the account to be removed but I'm not sure if that's actually technically possible here. Just writing this for people to know that I won't be replying, posting new topics or checking private messages until the account is potentially removed.

2011-11-22 13:31:41

Hi,

You've classified myself as a reptile. Rofl!
Personally, I'd call him a snake though too, so yeah.
I don't know much more though, just some non-fitting puzzle pieces. big_smile
None of them though have to do with CUI's, STDIn and SDOuts though, as if you were coding a console app in Python. :3

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2011-11-22 14:03:37

Hi.
What language is the easiest to learn as a totally newbie? BGT? Autoit? or Python?

Best regards SLJ.
Feel free to contact me privately if you have something in mind. If you do so, then please send me a mail instead of using the private message on the forum, since I don't check those very often.
Facebook: https://facebook.com/sorenjensen1988
Twitter: https://twitter.com/soerenjensen

2011-11-22 15:20:15

Hi,

Depends on what you're going for. Windows: Audio games? BGT. Simple GUI apps and that, AutoIt. If you run another OS, you might want to look at the availabilities there. But Python is absolutely awesome when it comes to multiplatform things.

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2011-11-22 21:34:23

Hi,
wow! i'm dumb!
lol i didn't even think of that snake refrence.
hmm could be due to the fact that i am lazy lol and it was 1240 or something when i typed the message.
hmm what is simple to learn for beginners in terms  of printing hello world.
ppython is easyest it is just... print ("hello world")
I can't remember what it is in bgt but it is something like...
voidd main()
{
print "hello", "i am a bgt script";
}
someone correct me if you want to. hmm i would have to say for printing python is easyest. as for other things i don't no as i am thinking of letting the programers program because i am rubbish and don't understand it. lol

I'm gone for real :)

2011-11-22 22:13:09

Hi,

BGT would appear to be: void main() { alert ("Yo", "Dragon says Hello World"); }
AutoIt would appear to be: msgbox(64, "Yo", "Dragon says Hello World")
JavaScript would appear to be: Alert("Dragon says Hello world");
I could go on and on, but there ya go. And while those actually print a window on the screen with a button to click, what you did in Python is a simple CUI which wrote hello world and then quit. The other code snippets I posted here wait for the user to press OK.

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2011-11-23 10:02:45

thanks much for these examples. Well, things are beginning to make sense for me, and I'm beginning to understand when developers says that most programming languages are pretty much like the same when you know the basics. I thought programming languages was much harder to understand, but it doesn't seems to.
For me, it seems as the real difference between programming languages is how you write things in braces, quotes and other kind of characters, and all the basics seems to be the same. Or, am I totally wrong?

Best regards SLJ.
Feel free to contact me privately if you have something in mind. If you do so, then please send me a mail instead of using the private message on the forum, since I don't check those very often.
Facebook: https://facebook.com/sorenjensen1988
Twitter: https://twitter.com/soerenjensen

2011-11-23 10:14:15

Hi,


You're not wrong, in fact you're pretty right, with the exception of:
There are 2 main language-types. There are C-style languages like BGT, which use braces, and basic-like languages which use EndIf, EndFunc and all those.
But other than that, the basics are the same, mostly. Except in LOL Code or BrainFuck, or the other custom languages.

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2011-11-25 05:31:02

Brainfuck? Oh, now you've asked for it!
>++++++[<+++++++++++>-]<.>++++++[<++++++++>-]<.>++++[<---->-]<-.++++++++.+++++.--------.+++++++++++++++.>+++[<------>-]<.++++++++.>+++++[<--------------->-]<.>++++++++[<+++++++++>-]<+.++++++++++.>+++++++++[<--------->-]<--.>+++++++[<++++++++++++>-]<.------------.---.>++++++[<----------->-]<---.>++++++[<+++++++++++>-]<.+++.++++++++++++++.+.>+++++++[<------------>-]<.>+++++[<+++++++++++++++>-]<+.-----------.+++++++++++++.-------.++++++++++++++.>++++[<----->-]<.++++++.--.>++++++[<----------->-]<---.>++++++[<+++++++++++>-]<+++.>++++[<++++>-]<+.>++++[<---->-]<-.+++++++++++++.>+++++++++[<--------->-]<.>+++[<------->-]<--.----------
So there! Lol I just couldn't resist.
Oh and, if you're trying to debug some python code, just run your program from that command prompt. Once you're in the directory where your py file is, jsut go
python stuff.py
and hit enter. If your program dies, or something else happens, it'll show up in that console.

HTH!
Thanks,
KJ4UFX
{.i doi .tcikoritys. mi cuxna ba'e do}

"Actually, they're just super-advanced holograms created for the sole purpose of enriching a children's cardgame."

2011-11-25 07:57:13

BTW, thanks for mentioning lolcode. I'd never heard of it until that post... Amazing!
I HAS A LOLCODE ITZ "WIN"

"Actually, they're just super-advanced holograms created for the sole purpose of enriching a children's cardgame."

2011-11-25 11:14:43

Hi,

Oh yeah, forgot that Brainfuck's written with lower-case f. Sorry about that. tongue
I didn't play with LOLCode for long... I'll do that again though. It was fun. big_smile

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.