Hamza Lachi
Hamza Lachi

Reputation: 1064

How to write quotes with your python script

I want to know how to write this '' with script using python

Because I Don't Know How To Write this from script using python ''

Here is my code:

from selenium import webdriver
import time
from random import *
import pyautogui as pg


time.sleep(2)
for i in range(1,510):
    pg.typewrite('')
    # here i want to type quotes in typewrite

here i want to type quotes in typewrite

i want to write quotes in notepad with my script but it's not writing quotes if some chracter in abc or 123 it writing

Thanks!

is there any special character like \n or what is?

Upvotes: 0

Views: 402

Answers (2)

Nathan
Nathan

Reputation: 471

You can simply use double quotes:

    pg.typewrite("''")

Upvotes: 5

emremrah
emremrah

Reputation: 1775

You should use escape character, which is \ for most cases:

pg.typewrite('\'\'')

Escape character (\) will treat ' as literal character instead of a string identifier.

Upvotes: 2

Related Questions