473,398 Members | 2,525 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,398 software developers and data experts.

How to compare the Operators?

440 256MB
Hi ,

while reading file I have to compare/check for the equal operator "=", and after this I have to collect the other data.

How to compare / check this operators?

Thanks in advance
PSB
Mar 3 '07 #1
3 996
ghostdog74
511 Expert 256MB
Hi ,

while reading file I have to compare/check for the equal operator "=", and after this I have to collect the other data.

How to compare / check this operators?

Thanks in advance
PSB
there are, assuming you want to check the "=" character
1) use the "==" equality operator.
eg
Expand|Select|Wrap|Line Numbers
  1. if ch == "=":
  2.  
2) use "in"
Expand|Select|Wrap|Line Numbers
  1. if "=" in line:
  2.  
Post some sample data if possible.
Mar 3 '07 #2
psbasha
440 256MB
SET 10 = 1101 1106 1107 1108 1109 1110 1111,

I have to compare the equal to "=" with in the string above and get the other numbers.So how to proceed with this
Mar 3 '07 #3
ghostdog74
511 Expert 256MB
SET 10 = 1101 1106 1107 1108 1109 1110 1111,

I have to compare the equal to "=" with in the string above and get the other numbers.So how to proceed with this
Assuming this line is from ae file, so iterating over the file
Expand|Select|Wrap|Line Numbers
  1. for line in open("file"):
  2.     if "=" in line:
  3.         ......
  4.  
Mar 3 '07 #4

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

Similar topics

12
by: Helmut Jarausch | last post by:
Hi, what does Python do if two objects aren't comparable (to my opinion) If I've understood "Python in a Nutschell" correctly it should raise an exception but it doesn't do for me. Here are...
122
by: Einar | last post by:
Hi, I wonder if there is a nice bit twiddling hack to compare a large number of variables? If you first store them in an array, you can do: for (i = 0; i < n; i++) { if (array != value) {...
49
by: raju | last post by:
hi can we compare two integers without using relational operators (== != < <= > >=) thanks rajesh s
19
by: David zhu | last post by:
I've got different result when comparing two strings using "==" and string.Compare(). The two strings seems to have same value "1202002" in the quick watch, and both have the same length 7 which I...
3
by: NathanV | last post by:
I'm trying to compare two byte's. I think I have to use binary operators. How can I tell if two bytes have the same value? Also, I have a function that is returning a byte value. Is there a...
11
by: Russ Green | last post by:
How does this: public TimeSpan Timeout { get { return timeout; } set { timeout = value; if(timeout < licenseTimeout) licenseTimeout = timeout; }
11
by: Marshall Dudley | last post by:
I am comparing two numbers, and the comparison gives absolutely bizzare results. I am comparing 5 with a number that is entered in a form. Then if the number entered is 5, or between 50 and 95, it...
3
by: raylopez99 | last post by:
This is an example of using multiple comparison criteria for IComparer/ Compare/CompareTo for List<and Array. Adapted from David Hayden's tutorial found on the net, but he used ArrayList so the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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...
0
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...
0
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,...

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.