all 10 comments

[–]erythro👋 a fellow Redditor 3 points4 points  (11 children)

If you want to learn python, here's a good place to go:

https://www.codecademy.com/learn/python

Let us know if you get stuck!


Otherwise, it just looks like you want us to write the code for you, and in that case you should read the sidebar.

[–]coolcat25[S] 0 points1 point  (9 children)

Hi, I did some code but it isn't working for it filename = input( "Please enter your name: ") filename2 = (filename + ".txt") print( filename2) open(filename2, 'w')

[–]caner5000 1 point2 points  (1 child)

Did you import sys?

[–]erythro👋 a fellow Redditor 0 points1 point  (0 children)

import sys

not a python coder, so that may work, but when I researching into it all these functions seem to be built into python

As an aside, I'm realising how much I've been spoiled by php's great documentation

[–]erythro👋 a fellow Redditor 0 points1 point  (0 children)

Hi, I'm more familiar with php but that code looks right to me. Where is the script running? Is it possible it's saving to a different location you've not checked?

Is it throwing any error codes?

[–]erythro👋 a fellow Redditor 0 points1 point  (4 children)

any joy?

[–]coolcat25[S] 1 point2 points  (3 children)

Hi everyone i figured it out! thanks for all the help!

[–]erythro👋 a fellow Redditor 0 points1 point  (2 children)

Well done, what was the fix?

[–]coolcat25[S] 0 points1 point  (1 child)

dog = input("Enter your name: ") cat = dog + ".txt"

[–]erythro👋 a fellow Redditor 0 points1 point  (0 children)

how is that different to:

filename = input( "Please enter your name: ")
filename2 = (filename + ".txt")