473,608 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"End Of Line" Confusion

ncf
I'm having an odd problem. I'm getting an error from IDLE saying "End
Of Line detected while scanning single-quoted string." Odd thing is,
it's not single-quoted, it's one of the doc-strings (if that's what you
call them).

In the following code (class name replaced with <<<NAME>>>), the error
is being highlighted as the hyphen joining "non" and "ASCII".

class <<<NAME>>>:
<<<CUT>>>
def digest():
''' char[28] digest ( )

Return the digest of the strings passed to the update() method
so far.
This is a 28-byte string which may contain non-ASCII
characters,
including null bytes.
'''
raise NotImplementedE rror, 'digest() is not yet implemented.'
Thanks in advance. -Wes

Jul 19 '05 #1
3 1963
Well, copying and pasting this text, and changing <<<NAME>>> to Foo so
that its a legal Python identifier (why did you not want to name your
class, out of curiosity), I get no problems with this.

class Foo:
def digest():
''' char[28] digest ( )

Return the digest of the strings passed to the update() method
so far.
This is a 28-byte string which may contain non-ASCII
characters,
including null bytes.
'''
raise NotImplementedE rror, 'digest() is not yet implemented.'
foo = Foo()
foo

<__main__.Foo instance at 0x00B30C38>

So all I can suggest is that you have accidentally mixed double and
single quotes, or there is a quote mark somewhere in the docstring in
your copy of the code, or some strange, platform/system/text editor/etc
specific bug is causing this, or i don't know what else.

Oh and btw, I suspect, form the lack of @staticmethod on the line above
def digest():, that you perhaps meant def digest(self): ?

Jul 19 '05 #2
ncf
First off, my apologies...Goo gle Groups doesn't seem to want to let me
reply inline.

I refrained from putting the name in there as it's potentially
offensive (gotta love America). If you would aid you, I can send you
the entire Python script via. email. Editor was IDLE on Slackware Linux
using the ReiserFS Filesystem (not like the FS matters :P).

There is not a quote mark in the docstring. What I posted for the
function def is a straight-forward copy and paste.

I'll try doing a hex-dump on the file and see if there's any odd bytes
in there that shouldn't be. Yea, I think I did mean that. :P I hadn't
yet even *begun* to work on the other areas...just working on the
bit-wise math and what-not.

-Wes

Jul 19 '05 #3
If you email the script to me, I'd be happy to take a look at it and
see if I come up with the same error (I'm running IDLE on a Windows XP
box here, cant remember if the filesystem is FAT or NTFS ;-))

Although as a relative newbie I've never come across it myself, one
possible source of such mysterious errors in Python, apparently, is
mixing tabs and spaces in your indentation. Its also one of the few
factors I can think of that would have been lost in the
email-copy-paste process, which could explain why the code snippet
works on my machine and not yours.

My only other suggestion is to try my personal first rule for fixing
mysterious, unusual bugs in small, trivial pieces of code - which is to
delete the whole thing and type it out again from scratch. It works
surprisingly often.

Good luck
- Jordan

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1797
by: Andr? Roberge | last post by:
I want to "import and execute" a python program (input_test.py below) within another program (execute_test.py below) and "watch it" being executed. By watching it, I mean to display the file input_test.py in a window (GUI) and highlighting the line being executed. I am *simulating* this here by printing the line being executed with the corresponding line number and it works as expected for "simple" programs.
13
16529
by: Simon Wigzell | last post by:
Can I trap when the scroll is ended? This is what I want - the calculator disapears when the site visitor starts scrolling the main page. I'm doing that with an "onScroll()" function. I'm bringing the calculator back with a "onMouseup()" which I thoguht would activate when the scroll bar was released but it doesn't. What I really want is an "offScroll()" but there is no such thing! ...
3
3002
by: Colleyville Alan | last post by:
I am constructing a SQL command from a function. Some code builds the WHERE clause in a looping structure and passes that as an argument to the SQL-building function. But the results do not always execute as I envisioned they should. When I trap the finished SQL statement in the Immediates window and paste it to a query SQL window, I can see in the QBE why I am not getting what I want. Basically, I want the QBE window to have the OR...
3
18252
by: Summit | last post by:
Does anyone know what the C# equivalent for VB6 End is? I'm starting up a form with a boolean test. If I fail, I just want to end the app. Even though I close the form, it picks up on the line after the bracket and continues loading the form. Here's my snippet: DalMan._drCurrentUser = DalMan._dtUsers.FindByUserName("Init"); if (DalMan._drCurrentUser == null)
4
1755
by: Tran Hong Quang | last post by:
Hi, I'm using Windows 2000, English version, Microsoft Visual Studio.Net 2003. I compile a project developed for Japanese client, on which there are some Japanese messages. I have error "End of statement expected." at the line of Japanese message. How to make Visual Studio.Net 2003 understand that Japanese message? Thanks Tran Hong Quang
3
1766
by: caston | last post by:
Well, everybody can now agree with the fact that the Ajax hype is over. Still multiple Ajax Frameworks are flourishing, aren't they? So, last night I questioned myself with the following: "When Ajax Frameworks will be gone? What is required to get rid of them and start using browsers?" (To be more precise, I should probably also mention what kind of frameworks do i mean. These are: Dojo, BackBase, Qooxdoo etc.) I've got an answer that I...
5
3202
by: BA | last post by:
Hi there I am trying to write an "application" in Access 2000, that displays a front end and allows the user to interact with the database without seeing Access loaded, in the background, nor on the taskbar. When I click on the generate report button, from the front-end's form, no report/query is displayed. However, if i disable the code that "hides" Access, the reports and queries work perfectly. How do I get this functionality...
5
10796
by: Nathan Sokalski | last post by:
I have an ASP.NET application which is giving the following JavaScript error: 'theForm' is undefined However, when I do a View Source one of the <scriptelements is as follows: <script type="text/javascript"> <!-- var theForm = document.forms;
5
41110
by: cfli1688 | last post by:
I have the following xsl: =============================== <xsl:for-each select="ROWSET/ROW"> <xsl:choose> <!-- previous node is blank, this is the first node --> <xsl:when test="preceding-sibling::*/FS_STFACILITYIDENTIFIER=''"> <FacilitySiteAllDetails> <FacilitySite> <FacilitySiteName> <xsl:value-of select="FS_FACILITYSITENAME"/>
0
8011
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8503
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8488
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8160
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6826
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3972
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2479
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
1
1611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1339
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.