473,378 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

String and quotation marks

Hi All,

I'm displaying some static text in wx.python. All is ok if I write the text
as so;

self.label_1 = wx.StaticText(self, -1, " categggirlcow")

However I have the names as a string without quotes

names = ['cat','egg','girl','cow']

# flatten names

for i in names:
h = map(None, ab[i])

l1 = []
for i in h:
for j in list(i):
l1.append(j)
x = "".join(l1)
print x,
# - gives of course cat egg girl cow

printnames = " \"x\"" # -- I've tried this, but it doesn't work
self.label_1 = wx.StaticText(self, -1, printnames)

Could someone show me how to get some quotes around the string so I can use
it for the static text?

Thanks,

Malcolm
Jul 18 '05 #1
2 3945
M. Clift wrote:
Hi All,

I'm displaying some static text in wx.python. All is ok if I write the text
as so;

self.label_1 = wx.StaticText(self, -1, " categggirlcow")

However I have the names as a string without quotes

names = ['cat','egg','girl','cow']


names is a list of strings so you just need to join
them together and if your example is correct prepend
a single space.

self.label_1=wxStaticText(self, -1, " "+"".join(names))

This would produce exactly the same string as
" categggirlcow" that you pass in as a literal.

Larry Bates
Jul 18 '05 #2
Hi Larry,

Thanks, perfect.

Malcolm
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Stephen Poley | last post by:
One disadvantage of using a simple text editor to produce HTML is that it is relatively time-consuming to put in the proper typographical quotation marks and dashes. A round tuit having arrived...
63
by: Tristan Miller | last post by:
Greetings. Do any popular browsers correctly support <q>, at least for Western languages? I've noticed that Mozilla uses the standard English double-quote character, ", regardless of the lang...
24
by: Sathyaish | last post by:
This one question is asked modally in most Microsoft interviews. I started to contemplate various implementations for it. This was what I got. #include <stdio.h> #include <stdlib.h> #include...
1
by: vince | last post by:
need to create a string with embedded quotation marks, like string str1 = " they said "go away" "; How can this be done? Thanks, vince
4
by: | last post by:
Hi, How do I trim double quotation mark " in a string? Or, how do I match pattern if the string has double quotation mark already like "string"? Thanks in advance. Hugh
2
by: bcastaing | last post by:
My Windows service includes the following lines: string Arguments3 = @"%OvAgentDir%\bin\OpC\cmds\ref-ovo-services.vbs ServiceApplicatif ServiceOVO"; string expandedArguments3 =...
3
by: Ufit | last post by:
Simple,dumm question - how to include quotation marks in the string? F.ex. "Data Source=.\SQLEXPRESS;AttachDbFilename="C:\client data.mdf";Integrated Security=True;User Instance=True" I get syntax...
10
by: lovecreatesbea... | last post by:
Is it correct and safe to compare a string object with "", a pair of quotation marks quoted empty string?If the string object: s = ""; does s contain a single '\'? Is it better to use...
31
by: The Bicycling Guitarist | last post by:
Hi. For many years I have been using &quot; for double quotation marks in the HTML code, but the opening and closing quotation marks render the same in my browser. I'm considering going through and...
1
by: U Aye Thein | last post by:
I found in internet how to solve single quotation mark in string and how to solve double quotation mark in string but my string may be contained single quote or double quote. How to write an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.