473,386 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Finding "hidden" syntax errors

It doesn't happen often, but once in a while I will
introduce a syntax error into a Python program I'm
working on (in IDLE) and doing File-Check responds
with the expected "Failed to check, syntax error -
invalid syntax". The problem is where the cursor
stops is perfectly legal syntax. I then begin
going through the laborious job of cutting out
pieces of the code until I find what is wrong. Is
there some easier way of doing this. I tried
pychecker but got nowhere because it said it
couldn't import (which I'm sure is because of the
syntax error). Does anyone out there have a "better"
way of tracking down these difficult to locate
errors?

Thanks in advance for any hints.

Regards,
Larry Bates
Syscon, Inc.

Jul 18 '05 #1
1 1582
Hello Larry,
I tried pychecker but got nowhere because it said it couldn't import
(which I'm sure is because of the syntax error). Does anyone out there
have a "better" way of tracking down these difficult to locate errors?

I'm using pychecker. It says where the error is:
--- syn.py ---
def f(x):
if x = 2: # Syntax error
print "YO"
else:
print "Halt! Who goes there?"
--- syn.py ---

[10:45] $pychecker syn.py
Processing syn...
SyntaxError: invalid syntax (syn.py, line 2)
if x = 2: # Syntax error
^

Warnings...

syn:1: NOT PROCESSED UNABLE TO IMPORT
[10:45] $

pychecker found out that the problem is in line 2.

Maybe some concrete example?

Bye.
--
-------------------------------------------------------------------------
Miki Tebeka <mi*********@zoran.com>
The only difference between children and adults is the price of the toys.

Jul 18 '05 #2

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

Similar topics

1
by: Stone | last post by:
OK .. admittedly this is newbie dumb... Its a JAVA script in a FORM I have passed (successfully) the referring URL into my form page on loading.... <script language="JavaScript"><!-- //...
6
by: Saqib Ali | last post by:
I have created a slider using Javascript and html tables that generally works very well. As you move the "knob" to the right, a numeric value in an adjactent <INPUT type="text"> tag increases....
3
by: neverstill | last post by:
hi- I need to have an asp:TextBox that will allow me to set the type attribute to hidden. I can't seem to find a way to do this. Basically, I have a Wizard application that will show/hide...
2
by: SAL | last post by:
I have the following line of code in my Page_Load Event of my ASP.net page: txtExplanationofChange.Attributes.Add ("style","overflow :hidden"); which allows me to can turn off the Scrollbar of my...
7
by: parag1234567 | last post by:
Hi, I am dynamically generating a html file which will contain only <div> tags which contents are hidden from user( set by style="visibility:hidden") Now the next step is i am enabling some of...
1
by: mark | last post by:
Forgive me if this seems like a stupid question but I need help... I'm trying to do a simple online form that emails me the results from a few fields. Here is the code: <form...
1
by: msg2ajay | last post by:
hi, i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error. <html> <head> <script...
3
by: dba | last post by:
Without giving a lot of script at this time, I am having a problem with php and form input type="hidden". Problem is that the hidden variable displays last line from database query. Some code....
1
by: Patient Guy | last post by:
I have a "hidden" anchor in the body of a doc. By "hidden," I mean that the contained text of the anchor is indistinguishable from the surrounding text, the text contained by its parent/ancestor...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...

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.