472,958 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 1332
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...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.