Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 28th, 2002, 05:41 AM
nickname nickname is offline
inexperienced and useless
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Stevenage, uk
Posts: 10 nickname User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry embedded html causing problems

I'm writing a cgi with python at the minute and I seem to be getting some very strange errors from the embedded html.

I get ValueErrors for unsupported format character ' " ' at index 266

I have checked through my code and find myself unable to see what could be causing this error, as there are no ' " ' out of place.

If you can help I would greatly appreciate it.

Thanks

Reply With Quote
  #2  
Old January 28th, 2002, 06:48 AM
Taradino Taradino is offline
Python Prophet
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Amersfoort, The Netherlands
Posts: 45 Taradino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
What do you mean with embedded HTML? You're using ASP+Python and <% + %> tags? Or are you just using the print statement?
Could you also post some code fro your script where you get your error?
__________________
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. - Jamie Zawinski, in comp.lang.emacs

Reply With Quote
  #3  
Old January 28th, 2002, 07:03 AM
nickname nickname is offline
inexperienced and useless
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Stevenage, uk
Posts: 10 nickname User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yeah sorry about that, I'm using %s and the html is actually within a cgi script as a variable, which can then be printed and the %s variables be defined.

Here's the html of the script:

<table bgcolor="#FFb573" width="65%" border="0" cellpadding="5" cellspacing="0">

<tr>
<td>mudid: </td>
<td>
<input type=text name=mudid>
</td>
</tr>
<tr>
<td>Server:<select "Server: " name="Server" align=left>
%s <!--Server list-->
</select></td>
<td>Database:<select name="Database" align=left>
%s <!--Database List-->
</select></td>
</tr>
<tr>
<td>search type: </td>
<td>substructure:
<input type=radio name=searchtype value=substrusture>
string:
<input type=radio name=searchtype value=string>
superstructure:
<input type=radio name=searchtype value=superstructure>
</td>
</tr>
<tr>
<td>smiles: </td>
<td>
<input type=text name=smi>
</td>
</tr>
<tr>
<td colspan=2><input type=hidden name=mol_inline><embed type="chemical/x-mdl-molfile" width=300 height=250 bgcolor=#ffffff queryformbox="document.qbuild.mol_inline">
</td>

</tr>
<tr>
<td>smiles or structure: </td>
<td>smiles:
<input type=radio value=strucorsmiles name=smiles>
structure:
<input type=radio value=strucorsmiles name=structure>
</td>
</tr>
</table>
</td></tr>
</table>

not really sure what could be causing the errors.
Thanks

Reply With Quote
  #4  
Old January 29th, 2002, 01:49 AM
Taradino Taradino is offline
Python Prophet
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Amersfoort, The Netherlands
Posts: 45 Taradino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
I see the problem, you're using this code: 65%". Python thinks the % starts the format specifier, and then it reports " is an illegal format character. You should replace all % that are not used for formatting with %%.

http://python.sourceforge.net/devel...eq-strings.html

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > embedded html causing problems

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap