472,353 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

"EOL while scanning single-quoted string", what is the meaning?

5
I am trying to write a long string into a txt file, the string includes some backslash, looks like:
'd:\#########\#######\####### d:\######\####\####\### d:\###\###\'
then I got a error saying 'EOL while scanning single-quoted string'. But it works when I just delete the last backslash or add one more backslash in the end.
Can someone tell me what is the meaning of this error, and how to handle this problem? Thanks.
Nov 2 '06 #1
2 10886
bvdet
2,851 Expert Mod 2GB
I am trying to write a long string into a txt file, the string includes some backslash, looks like:
'd:\#########\#######\####### d:\######\####\####\### d:\###\###\'
then I got a error saying 'EOL while scanning single-quoted string'. But it works when I just delete the last backslash or add one more backslash in the end.
Can someone tell me what is the meaning of this error, and how to handle this problem? Thanks.
Try this:
Expand|Select|Wrap|Line Numbers
  1. >>> s = 'd:\\#########\\#######\\####### d:\\######\\####\\####\\### d:\\###\\###\\'
  2. >>> print s
  3. d:\#########\#######\####### d:\######\####\####\### d:\###\###\
Nov 2 '06 #2
bartonc
6,596 Expert 4TB
I am trying to write a long string into a txt file, the string includes some backslash, looks like:
'd:\#########\#######\####### d:\######\####\####\### d:\###\###\'
then I got a error saying 'EOL while scanning single-quoted string'. But it works when I just delete the last backslash or add one more backslash in the end.
Can someone tell me what is the meaning of this error, and how to handle this problem? Thanks.
or use
r'd:\#########\#######\####### d:\######\####\####\### d:\###\###\'
for raw string which works for windows dirictory.
Nov 3 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Phil Powell | last post by:
class DepartmentTree { function &buildTree($id) { static $html; if (!isset($html)) { // DO STUFF HERE TO $html } // DO MORE STUFF if...
68
by: Marco Bubke | last post by:
Hi I have read some mail on the dev mailing list about PEP 318 and find the new Syntax really ugly. def foo(x, y): pass I call this foo(1,...
3
by: Martin Ink | last post by:
I have a program linked to an .exe and this program is started from an other program. I would like to control the execution of the program so that...
3
by: Paul Janssen | last post by:
Hello! Can anyone help me out with the following situation: (a) a single query with 550 id's in the IN-clause resulting into 800+ seconds; (b)...
1
by: sarak13_2000 | last post by:
I am using Access2000 . In a query window, after selection of a group of records using aggregate function "group by", I want to retrieve only one...
0
by: Laharl | last post by:
This is what I am trying to do: public abstract class A : ISerializable { public A(SerializationInfo info, StreamingContext context){} public...
2
by: John Granade | last post by:
I'm looking for the best way to make a dataset available from multiple Windows forms. The dataset is created from an XML file. I have a main form...
59
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the...
6
by: Nirjhar Oberoi | last post by:
Hi, Can you add two numbers using a Single Variable? :-) If yes then show me the code!!! Regards Nirjhar
2
by: Chris Thomasson | last post by:
I was wondering if the 'SLINK_*' and 'SLIST_*' macros, which implement a simple singly-linked list, will produce _any_ possible undefined behavior:...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.