2
How do I make a include
or open a python page in another, for example in php:
include 'content/filename.php';
Load Html it loads the file more .py
no,
I’ve tried the command open
fp = open('content/header.py')
html = fp.read()
fp.close()
2
How do I make a include
or open a python page in another, for example in php:
include 'content/filename.php';
Load Html it loads the file more .py
no,
I’ve tried the command open
fp = open('content/header.py')
html = fp.read()
fp.close()
2
In fact, you didn’t even have to go as far back as Paulo mentioned above. You can make a function that stores these values and in the other file you pull it:
from arquivo1 import funcao
a,b,c = funcao()
Also you can leave these values stored in variables and pull them by the other file as if they were normal functions.
Thanks works too well!
It’s not that "it works too': that’s the way to do things. Just not the most common in PHP, why PHP evolved from a language to page templates. In programming, Voce uses modules with functions - and each function is reusable
Browser other questions tagged php python python-3.x python-2.7
You are not signed in. Login or sign up in order to post.
I don’t know if it’s clear... You have another file
.py
, and inside it wants to read html code?– Emoon
yes, only that this code will also have python code
– Gabriel José