473,398 Members | 2,212 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.

list control

hi,
i want to know what is wrong about line no.7 & 8 . in the code below pleasse give an alternate method to im oplement this
Expand|Select|Wrap|Line Numbers
  1. for j in c:
  2.     for x in range(0,15,1):
  3.         try:
  4.             print "try1", ,j.contents
  5.             y=x*2
  6.             print y
  7.             print j.contents[y]
  8.             cusine[x]=j.contents[y]
  9.             print "try"
  10.         except:    
  11.             try:
  12.                 print cusine
  13.             except:    
  14.                 print "er"
Jun 28 '07 #1
4 1342
bartonc
6,596 Expert 4TB
hi,
i want to know what is wrong about line no.7 & 8 . in the code below pleasse give an alternate method to im oplement this
Expand|Select|Wrap|Line Numbers
  1. for j in c:
  2.     for x in range(0,15,1):
  3.         try:
  4.             print "try1", ,j.contents
  5.             y=x*2
  6.             print y
  7.             print j.contents[y]
  8.             cusine[x]=j.contents[y]
  9.             print "try"
  10.         except:    
  11.             try:
  12.                 print cusine
  13.             except:    
  14.                 print "er"
First of all, you have not used CODE tags, but I've fixed that. Your little numbering scheme doesn't work at all. Just paste the code surrounded by CODE tags. Instructions on on the right hand side of the page while posting or replying.

Secondly, you have not given us enough to go on. What should it do? What's in c that you are trying to iterate over? What does the object j look like? Etc., etc.
Jun 28 '07 #2
First of all, you have not used CODE tags, but I've fixed that. Your little numbering scheme doesn't work at all. Just paste the code surrounded by CODE tags. Instructions on on the right hand side of the page while posting or replying.

Secondly, you have not given us enough to go on. What should it do? What's in c that you are trying to iterate over? What does the object j look like? Etc., etc.
i am extracting data form a web page. under the heading "menu" it can have 0 item or as much as 15 ITEMs, separated by "<br>". this changes from time to time. so how do i extract the data.
i dont want to write the code 15 times for each ITEM and try for exception. that is why i tried to loop it but the list j does support an array like structure as in C++.
my code "print j.contents[y]" where y is a variable does not seem to work.
Jun 28 '07 #3
i am extracting data form a web page. under the heading "menu" it can have 0 item or as much as 15 ITEMs, separated by "<br>". this changes from time to time. so how do i extract the data.
i dont want to write the code 15 times for each ITEM and try for exception. that is why i tried to loop it but the list j does support an array like structure as in C++.
my code "print j.contents[y]" where y is a variable does not seem to work.
please help. its urgent
Jun 28 '07 #4
bartonc
6,596 Expert 4TB
please help. its urgent
You still need to post more of the code in order for anyone to know what the heck you are trying to do. (See #2, above).
Jun 28 '07 #5

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

Similar topics

8
by: sara | last post by:
I am learning Access and programming. I wanted to have the user select the departments for an ad from the list of all departments. Found code (that I could understand) on this site, and it works....
1
by: Steve | last post by:
I have application which displays dialog containing CListCtrl control. The OnTimer message handler updates values in this list control. In case if there are more items then visible area of list...
0
by: H. Scott Buckwalter | last post by:
ASP.NET: I want to control the color of the text for a check box control in JavaScript on the client. I am able to do this by surrounding the check box in a SPAN tag. I then color the span and...
3
by: http://www.visual-basic-data-mining.net/forum | last post by:
I have the following problem. My asp.net page has one html list box control and I made that as "RUN AS SERVER" so that I could access it in client side script as well as server side script. And also...
7
by: David Freeman | last post by:
Hi There! I'm trying to create a User Registration page in ASP.NET and wondering what is the best way to get the list of up-to-date Countries and Cities? Are there any Web Services on the web...
5
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
1
by: Valli | last post by:
Hi, I need to populate a dropdownlist control with values. Number of items for that list exceeds 100. I am using Html select list option. When I drop down the list control, it shows the item...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.