Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python Render template
#1
Hello,
I've created a template using python, but now I need to generate a .qml file from it, I wanted to work with rendered template but I coudn't go any where Wall
this is my example :

import string
v={'var1':'screen'}
x=string.Template("""
{
id :$var1
width :22
height :123
""")
print'Item: ', x.substitute(v)
y="""
{
id :$sm1
x :11
y :8
width :12
height :65

}
}

"""
print 'Rectangle ' , y%v

I really need your help!
thank u ^^
Reply


Messages In This Thread
python Render template - by Akhou - Apr-26-2018, 09:57 PM
RE: python Render template - by j.crater - Apr-26-2018, 10:27 PM
RE: python Render template - by Akhou - Apr-26-2018, 10:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: Diagram.render() takes 1 positional argument but 2 were given sachin1361 0 330 Apr-23-2024, 06:39 AM
Last Post: sachin1361
  What is bug template using python Anldra12 0 1,003 Nov-02-2021, 11:36 AM
Last Post: Anldra12
  Python C++ Template Equivalent deanhystad 7 3,573 May-04-2021, 07:45 PM
Last Post: deanhystad
  Erreur de code python sur un template rpm de zabbix samba 0 1,990 Apr-02-2021, 09:43 AM
Last Post: samba
  With SplashRequest to run javascript onclick function to render page properly don 0 1,944 Feb-04-2019, 03:29 AM
Last Post: don

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020