473,569 Members | 3,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

5 New Member
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 10999
bvdet
2,851 Recognized Expert Moderator Specialist
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 Recognized Expert Expert
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
1572
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 ($condition_is_met) $this->buildTree($newID); $this->html = $html;
68
4305
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, 2), this isn't really intuitive to me! Also I don't like the brackets.
3
1594
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 the program only runs 'single threaded'. I don't want simultaneously session of my program to be run. My program must be an .exe. Is there a way to control this in a simple way ?? Rgds
3
2246
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) 550 queries with a single id in the IN-clause resulting into overall time of <60 seconds; The table consists of 950.000 records, and the resultset consists of 205.000 records.
1
2789
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 record from each group including ungrouped fields also. For example, from the following records, A B C A B D A B E A H F
0
1921
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 void GetObjectData(SerializationInfo info, StreamingContext context) {} } public abstract class B : A, ISerializable
2
6889
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 (frmMain) that loads the dataset and reads the data but then I have other forms that give the ability to add, modify, and delete rows. This of course changes the dataset and I need that reflected...
59
7464
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 SEEK method on indexes. I'm having an issue when the recordset opens a table. When I write Set rst = db.OpenRecordset("MyTable",dbOpenTable, dbReadOnly) I get an error. I believe it's...
6
2620
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
2157
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: ____________________________ #include <stdio.h> #include <stdlib.h> #include <assert.h>
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.