Sinisterly
where is it - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Python (https://sinister.li/Forum-Python)
+--- Thread: where is it (/Thread-where-is-it)

Pages: 1 2 3


where is it - BlueCat - 06-18-2014

I have python.exe open but how do run code? How do I open the white window where I can actually create a program and publish it, all am seeing is a console app. But not how to compile a program


RE: where is it - chmod - 06-18-2014

Python is a scripted language and as such doesn't compile.

You can write your programs in any plain text editor (notepad, or even better notpad++) and save them with a .py extension. to run your program navigate to the directory using the command prompt and enter

Code:
python filename.py



RE: where is it - BlueCat - 06-18-2014

(06-18-2014, 12:53 PM)chmod Wrote: Python is a scripted language and as such doesn't compile.

You can write your programs in any plain text editor (notepad, or even better notpad++) and save them with a .py extension. to run your program navigate to the directory using the command prompt and enter

Code:
python filename.py

I done a little dummy test one.

Code:
def hack_community(): welcome = input('welcome to hack communtiy') lol = input('This is just a testing') print('welcome + lol') hack_community()

Went to cmd and typed

Code:
cd desktop

as i saved it on the desktop then typed

Code:
python Testing.py

and get an error saying its not recognised


RE: where is it - chmod - 06-18-2014

That's fine just means that the path is not set for python follow this and add the path for your python executable then try again (you may need to log out and back in again for the changes to take effect)


RE: where is it - Ex094 - 06-18-2014

You need to set the PATH to python.exe, for that

1) Right click My Computer, Goto Advance System Settings
2) Goto the Advance tab and click Environment Variables
3) Now under System Variables find Path and edit it
4) Add ";C:\Python34\" Without the quotes to the end (Replace 34 with your version like for 2.7 it's 27 etc.)
5) Save it
Have fun Smile


RE: where is it - BlueCat - 06-18-2014

(06-18-2014, 01:24 PM)Ex094 Wrote: You need to set the PATH to python.exe, for that

1) Right click My Computer, Goto Advance System Settings
2) Goto the Advance tab and click Environment Variables
3) Now under System Variables find Path and edit it
4) Add ";C:\Python34\" Without the quotes to the end (Replace 34 with your version like for 2.7 it's 27 etc.)
5) Save it
Have fun Smile

I linked it to the exe yesterday and when I looked at it again now a bunch of other paths where added to it 0.o let me try it out now


RE: where is it - Hatemind - 06-18-2014

For windows you don't need to type python before the name of the py file, for example you can use:
file.py
istead of:
python file.py
But that isn't your problem, just a heads up. Sounds to me like a reinstall of python would be a simple fix.


RE: where is it - BlueCat - 06-18-2014

(06-18-2014, 01:34 PM)Hatemind Wrote: For windows you don't need to type python before the name of the py file, for example you can use:
file.py
istead of:
python file.py
But that isn't your problem, just a heads up. Sounds to me like a reinstall of python would be a simple fix.

Mate there is nothing wrong with it. I installed python34 yesterday and today I installed python33. Nothing needs re-installing


RE: where is it - BlueCat - 06-18-2014

(06-18-2014, 01:23 PM)chmod Wrote: That's fine just means that the path is not set for python follow this and add the path for your python executable then try again (you may need to log out and back in again for the changes to take effect)

Thanks for that, I had to log in and out for it to take effect. But now.....

[Image: q8PLtL4.png]


RE: where is it - Hatemind - 06-18-2014

(06-18-2014, 01:35 PM)root@localhost Wrote:
(06-18-2014, 01:34 PM)Hatemind Wrote: For windows you don't need to type python before the name of the py file, for example you can use:
file.py
istead of:
python file.py
But that isn't your problem, just a heads up. Sounds to me like a reinstall of python would be a simple fix.

Mate there is nothing wrong with it. I installed python34 yesterday and today I installed python33. Nothing needs re-installing

Your python program wouldn't run after you made it. It never called the function either, but you said it wasn't recognized. I'll just shut up though since I didn't sleep last night and I'm not functioning well.