0

Hey, guys!


having a little problem in python, how can I square root number or a varible in python?

And I'm trying incoparate the os function of unix, like using the clear command. How could I do that in python


Thanks for your help

3
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by Impact4ever
0

Ok, i Just remembered how to get the sqaure root thing going.

just need help on the other one.

thanks!

0

Ok, i Just remembered how to get the sqaure root thing going.

just need help on the other one.

thanks!

you can use os.system()

0

Ok thanks for the help!

So imported the module os and sys (though I'm not sure if I needed sys).
where do I go from there.

I just want to clear the screen in linux.

And for some reason my python beginners book doesn't show how to use the "os.system()" method.
If your guys wouldn't mind giving an example or link to one?

0

ok

The reason why the program wasn't working, using the "os.system()", I didn't encase the "clear" command with double quotes. (DUH!!!:P )

0

Here is a function that works both on Windows and Linux:

def clear_screen():
    """
    clear the screen in the command shell
    works on windows (nt, xp, Vista) or linux
    """
    import os
    os.system(['clear','cls'][os.name == 'nt'])
0

Hey thanks for the example.

That really got me thinking on how i should tweak my script.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.