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


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

(06-18-2014, 01:40 PM)Hatemind Wrote:
(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.


It was causing an error because The path was not correct


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

You also need to know that you'll have to add path for both the version of Python if you want to run 2.7 and 3.4 for cmd. Test it by simply typing python in the cmd, if it give you the command line interface then it's set to go Smile


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

(06-18-2014, 01:52 PM)Ex094 Wrote: You also need to know that you'll have to add path for both the version of Python if you want to run 2.7 and 3.4 for cmd. Test it by simply typing python in the cmd, if it give you the command line interface then it's set to go Smile

Got the command line, Everything is working now. Thankyou You can lock this now Confusedmile:


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

Then it would appear that Python is working correctly. I think the problem is with your code. My Python is a little rusty so perhaps @Ex094 or even @Anima Templi would be in a better position to help, but from the looks of it the function is not being used correctly try something like

Code:
welcome = raw_input('welcome to hackcommunity ') lol = raw_input('This is just a test ') def hack_community(welcome, lol): print welcome + " " + lol hack_community(welcome, lol)

running this gives the following output:
Code:
welcome to hackcommunity hi This is just a test ok hi ok



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

(06-18-2014, 02:00 PM)chmod Wrote: Then it would appear that Python is working correctly. I think the problem is with your code. My Python is a little rusty so perhaps @Ex094 or even @Anima Templi would be in a better position to help, but from the looks of it the function is not being used correctly try something like

Code:
welcome = raw_input('welcome to hackcommunity ') lol = raw_input('This is just a test ') def hack_community(welcome, lol): print welcome + " " + lol hack_community(welcome, lol)

running this gives the following output:
Code:
welcome to hackcommunity hi This is just a test ok hi ok


Nope, says it has a syntax error


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

(06-18-2014, 02:00 PM)chmod Wrote: Then it would appear that Python is working correctly. I think the problem is with your code. My Python is a little rusty so perhaps @Ex094 or even @Anima Templi would be in a better position to help, but from the looks of it the function is not being used correctly try something like

Code:
welcome = raw_input('welcome to hackcommunity ') lol = raw_input('This is just a test ') def hack_community(welcome, lol): print welcome + " " + lol hack_community(welcome, lol)

running this gives the following output:
Code:
welcome to hackcommunity hi This is just a test ok hi ok

Your code is correct, however you need a sleep or another input at the end to stop it from closing automatically. For a sleep you import time, then use time.sleep(seconds)


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

You must be using Pyrhon3 I wrote that for 2.7 my bad for python3 use:
Code:
welcome = input('welcome to hackcommunity ') lol = input('This is just a test ') def hack_community(welcome, lol): print (str(welcome) + " " + str(lol)) hack_community(welcome, lol)

@Hatemind that's a good call for when running the script through explorer but was omitted because we where discussing launching it through the command line


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

(06-18-2014, 02:19 PM)chmod Wrote: You must be using Pyrhon3 I wrote that for 2.7 my bad for python3 use:
Code:
welcome = input('welcome to hackcommunity ') lol = input('This is just a test ') def hack_community(welcome, lol): print (str(welcome) + " " + str(lol)) hack_community(welcome, lol)

@Hatemind that's a good call for when running the script through explorer but was omitted because we where discussing launching it through the command line


Working! Confusedmile:


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

(06-18-2014, 02:02 PM)root@localhost Wrote:
(06-18-2014, 02:00 PM)chmod Wrote: Then it would appear that Python is working correctly. I think the problem is with your code. My Python is a little rusty so perhaps @Ex094 or even @Anima Templi would be in a better position to help, but from the looks of it the function is not being used correctly try something like

Code:
welcome = raw_input('welcome to hackcommunity ') lol = raw_input('This is just a test ') def hack_community(welcome, lol): print welcome + " " + lol hack_community(welcome, lol)

running this gives the following output:
Code:
welcome to hackcommunity hi This is just a test ok hi ok


Nope, says it has a syntax error

CHeck the indentation, and also you may need to use input instead of raw_imput, depending on your version of python. also, ints and strs don't concatenate, so you may have to use the str function to do so.


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

(06-18-2014, 02:22 PM)Hatemind Wrote:
(06-18-2014, 02:02 PM)root@localhost Wrote:
(06-18-2014, 02:00 PM)chmod Wrote: Then it would appear that Python is working correctly. I think the problem is with your code. My Python is a little rusty so perhaps @Ex094 or even @Anima Templi would be in a better position to help, but from the looks of it the function is not being used correctly try something like

Code:
welcome = raw_input('welcome to hackcommunity ') lol = raw_input('This is just a test ') def hack_community(welcome, lol): print welcome + " " + lol hack_community(welcome, lol)

running this gives the following output:
Code:
welcome to hackcommunity hi This is just a test ok hi ok


Nope, says it has a syntax error

CHeck the indentation, and also you may need to use input instead of raw_imput, depending on your version of python. also, ints and strs don't concatenate, so you may have to use the str function to do so.


The error was on

Code:
print welcome + " " + lol

@chmod Updated it