Im using gtk2x, python 2.7.3 and I need to make a list from values entered in one of the gtkEntry textboxes. Is there any “simple” way to go around this?
Global variable def:
groupID = []
Definition of the gtkEntry box:
<object class="GtkEntry" id="gtkENTRY1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="text" translatable="yes">-</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
Getting object:
self.gID = builder.get_object("gtkENTRY1")
Getting text from the object:
groupID = self.gID.get_text()
Values entered:
value1,value2
Needed output:
list = [value1,value2]
Actual output:
list = [v,a,l,u,e,1,v,a,l,u,e,2]
If somebody would like to know and for future reference, I allready solved this by RE split. Something like this: