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

size of an array..

hi..

another basic question...

in the following:
#test python script
import libxml2dom
import urllib

print "hello"

turl =
"http://courses.tamu.edu/ViewSections.aspx?campus=CS&x=hvm4MX4PXIY9J8C2Dcxz 5
0ncXTJdT7v2&type=M"

f = urllib.urlopen(turl)
s = f.read()
f.close()
# s contains HTML not XML text
d = libxml2dom.parseString(s, html=1)
# get the community-related links
for label in
d.xpath("/html/body/table/tr/td[2]/table/tr[6]/td/table/child::tr/td[@class=
'sectionheading']/text()"):
print label.nodeValue

print "/n/n/n/"

l =
d.xpath("/html/body/table/tr/td[2]/table/tr[6]/td/table/child::tr/td[@class=
'sectionheading']/text()")

xx = =sizeof(l)
print "test\n"
print "l = ".xx." \n"
print l[1].nodeValue
================================================== =======

how do i determine the size of "l"

from the "for label in d.xpath", i assume that "d.xpath" is returning
multiple strings/objects/etc... and that label is assigned to the next
"element during the loop.

is there a way to determine the number of elements in "l", or the number of
iterations for the "for loop" prior to running it...

the tutorials i've seen as of yet haven't mentioned this..

thanks

-bruce

Jul 2 '06 #1
1 2857
"bruce" <be*******@earthlink.netwrote:
from the "for label in d.xpath", i assume that "d.xpath" is returning
multiple strings/objects/etc... and that label is assigned to the next
"element during the loop.

is there a way to determine the number of elements in "l", or the number of
iterations for the "for loop" prior to running it...

the tutorials i've seen as of yet haven't mentioned this..
Have you tried len(object)?

-- Barry

--
http://barrkel.blogspot.com/
Jul 2 '06 #2

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

Similar topics

2
by: p175 | last post by:
Hi folks, I've tried reading just about every post I can on raid stiping / extent size etc and I'm just getting myself more confused than ever. Here's my situation. On a Windows Server 2000...
5
by: sugaray | last post by:
Hi, my problem with calculating the size of an array is when I pass an array as a parameter to a function which perform the calculation, the result never comes right, like below: int...
22
by: Wynand Winterbach | last post by:
I think every C programmer can relate to the frustrations that malloc allocated arrays bring. In particular, I've always found the fact that the size of an array must be stored separately to be a...
40
by: madireddy | last post by:
Hi, Inside a program how do i find out what size has been allocated to pointer using malloc. eg... int *p; p=(int*)malloc(1024*sizeof(int)); now how do find how much has been allocated to p?...
12
by: manochavishal | last post by:
Hi, I have a question. How can i know the size of array when it is passed to a function. For Example i have this code: #include <stdio.h> #include <stdlib.h>
8
by: redefined.horizons | last post by:
I would like to have an array declaration where the size of the array is dependent on a variable. Something like this: /* Store the desired size of the array in a variable named "array_size". */...
2
by: Harry | last post by:
Good Day To all, When i am declaring a array for e.g char ....it means i am declaring array of 45 characters each of which has a maximum,minimum value limit or range...for example in...
7
by: bowlderster | last post by:
Hello,all. I want to get the array size in a function, and the array is an argument of the function. I try the following code. /*************************************** */ #include<stdio.h>...
5
by: desktop | last post by:
I have a function that takes two pointers to an array. The first point to the first element while the other points to the last element. int nums = { 1, 2, 3, 4, 5, 7, 8, 9}; int* result; int...
33
by: Adam Chapman | last post by:
Hi, Im trying to migrate from programming in Matlab over to C. Im trying to make a simple function to multiply one matrix by the other. I've realised that C can't determine the size of a 2d...
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
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
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
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
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.