#print("Это выгрузка из всех сайтов RDB")
print("Считываю данные со всех базовых станций:")
#print(kmlfile)
needdir = netpath+alldir+"/"+kmlfile
#print(needdir)
#with open(kmlfile,"r", encoding="utf8") as rdbfile:
with open(needdir,"r", encoding="utf8") as rdbfile:
file = rdbfile.read()
#print(file)
[Unit]
Description=Telegram dato38it-bot
After=network.target
[Service]
User=tuser
Group=tuser
WorkingDirectory=/home/tuser/dato38itbot/
VIRTUAL_ENV=/home/tuser/dato38itbot/telegaenv
Environment=PATH=$VIRTUAL_ENV/bin:$PATH
ExecStart=/home/tuser/dato38itbot/telegaenv/bin/python /home/tuser/dato38itbot/main.py
Restart=on-failure
[Install]
WantedBy=multi-user.target
<VirtualHost *:80>
ServerAdmin admin@dato138it.ru
ServerName dato138it.ru
ServerAlias www.dato138it.ru
DocumentRoot /var/www/thost
ErrorLog ${APACHE_LOG_DIR}/dato138it.ru_error.log
CustomLog ${APACHE_LOG_DIR}/dato138it.ru_access.log combined
Alias /static /var/www/thost/static
<Directory /var/www/thost/static>
Require all granted
</Directory>
Alias /media /var/www/thost/media
<Directory /var/www/thost/media>
Require all granted
</Directory>
<Directory /var/www/thost/dato138it>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess dato138it python-path=/var/www/thost python-home=/var/www/thost/pyenv
WSGIProcessGroup dato138it
WSGIScriptAlias / /var/www/thost/dato138it/wsgi.py
</VirtualHost>
$ cat main.py
#tag - теги html
#file - переменная файла
#fileread - считывание файла
#replacetags - замена тегов
#addtags - добавление тега p в файле
#tags=["<p>","</p>","<br>"," "]
tags=["< p >","< /p >","< br >"," ","< strong > Task: < /strong >"]
#print(tags[2])
with open("text.txt") as file:
fileread = file.read()
#print(fileread)
replacetags = fileread.replace(" ", tags[3]).replace("\n", tags[2]).replace("Task:", tags[4])
#print(replacetags)
#print(tags[0], replacetags, tags[1])
addtags = tags[0]+replacetags+tags[1]
#print(addtags)
with open("output.txt", "w") as file:
file.write(addtags+"\n")