Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3948524
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:23:07+00:00 2026-05-20T01:23:07+00:00

self.response.out.write(\n) When i upload a data of multiline using text property and then printing

  • 0
self.response.out.write("\n")

When i upload a data of multiline using text property and then printing it back it prints in a single line….
i upload the ascii hexa code ….
so carriage return is 0x10 but when pringing it in ascii from datastore the new line is not inserted…
instead it prints as a single line

import cgi
#import codecs
print 'Content-Type: text/plain'
print ''
print 'Hello, world!'

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db

import operator

class Vault(db.Model):
    username=db.StringProperty()
    filename=db.StringProperty()
    data=db.TextProperty()

op=""
op1=""
username=""
filename=""


class MainPage(webapp.RequestHandler):
    def get(self):
        stri=""
        global username
        global filename
        stri=""
        username = self.request.get("name")
        filename=self.request.get("filename")
        mac=self.request.get("mac")
        mac=mac.replace(':','')
        q=db.GqlQuery("SELECT * FROM Vault WHERE filename=:1",filename)
        for vault in q:
            stri=cgi.escape(vault.data)
        s=0
        e=12
        cycle=len(stri)/12
        z=""
        for j in range(cycle):
            plain=stri[s:e]
            #print plain
            s1=0
            s2=2
            for i in range(6):
                x=int(plain[s1:s2],16)
                y=int(mac[s1:s2],16)
                s1=s1+2
                s2=s2+2
                z+=chr(operator.xor(x,y))
            mac=plain
            s=s+12
            e=e+12
        print z

application = webapp.WSGIApplication([('/dec', MainPage)],debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:23:07+00:00Added an answer on May 20, 2026 at 1:23 am

    Where are you printing that data back out to? If it’s inside of HTML (well, unless it’s surrounded by <pre> tags), the newlines will be ignored regardless of whether the EOL is indicated by \n or \r\n.

    If that’s what’s going on, you can just do

    self.response.out.write(myString.replace("\n", "<br />"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that doesn't extend webapp.RequestHandler , and I can't use self.response.out.write()
I am using a form to upload files to the google app engine and
self.logger.info(msg) popinstance=poplib.POP3(self.account[0]) self.logger.info(popinstance.getwelcome()) popinstance.user(self.account[1]) popinstance.pass_(self.account[2]) try: (numMsgs, totalSize)=popinstance.stat() self.logger.info(POP contains + str(numMsgs) + emails)
Pretty self-explanatory, I tried google and got a lot of the dreaded expertsexchange, I
Pretty self explanatory question. Is there any reason to use one or the other?
Assuming self-registration is used to install components as part of a larger installer program,
This is a self-explanatory question: Why does this thing bubble into my try catch's
As a self-taught computer programmer, I'm often at a loss to estimate the O()
If you were to self-fund a software project which tools, frameworks, components would you
Other than self.class.send :method, args... , of course. I'd like to make a rather

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.