determining the bounds of a tuple returned from a database

ronrsr ronrsr at gmail.com
Fri Nov 17 07:24:06 CET 2006


it looks like the  len() function is the one I want.

for:   len(result) - i get 248,

but for len(result[0]) or len(result[1]) i always get 0.


ronrsr wrote:
> here is my result.
> How do I determine the number of tuples in this array, returned from a
> mysql database?
>
> How do I determine the number of characters or entry in each tuple?
>
> thanks very much for your assistance,
>
> -rsr-
>
>
> (('Agricultural subsidies; Foreign aid',), ('Agriculture; Sustainable
> Agriculture - Support; Organic Agriculture; Pesticides, US, Childhood
> Development, Birth Defects; Toxic Chemicals',), ('Antibiotics,
> Animals',), ('Agricultural Subsidies, Global Trade',), ('Agricultural
> Subsidies',), ('Biodiversity',), ('Citizen Activism',), ('Community
> Gardens',), ('Cooperatives',), ('Dieting',), ('Agriculture, Cotton',),
> ('Agriculture, Global Trade',), ('Pesticides, Monsanto',),
> ('Agriculture, Seed',), ('Coffee, Hunger',), ('Pollution, Water,
> Feedlots',), ('Food Prices',), ('Agriculture, Workers',), ('Animal
> Feed, Corn, Pesticides',), ('Aquaculture',), ('Chemical Warfare',),
> ('Compost',), ('Debt',), ('Consumerism',), ('Fear',), ('Pesticides, US,
> Childhood Development, Birth Defects',), ('Corporate Reform,
> Personhood (Dem. Book)',), ('Corporate Reform,  Personhood, Farming
> (Dem. Book)',), ('Crime Rates, Legislation, Education',), ('Debt,
> Credit Cards',), ('Democracy',), ('Population, World',), ('Income',),
> ('Democracy, Corporate Personhood, Porter Township (Dem. Book)',),
> ('Disaster Relief',), ('Dwellings, Slums',), ('Economics, Mexico',),
> ('Economy, Local',), ('Education, Protests',), ('Endangered Habitat,
> Rainforest',), ('Endangered Species',), ('Endangered Species,
> Extinction',), ('antibiotics, livestock',), ('Pesticides, Water',),
> ('Environment, Environmentalist',), ('Food, Hunger, Agriculture, Aid,
> World, Development',), ('Agriculture, Cotton Trade',), ('Agriculture,
> Cotton, Africa',), ('Environment, Energy',), ('Fair Trade (Dem.
> Book)',), ('Farmland, Sprawl',), ('Fast Food, Globalization,
> Mapping',), ('depression, mental illness, mood disorders',), ('Economic
> Democracy, Corporate Personhood',), ('Brazil, citizen activism, hope,
> inspiration, labor issues',), ('citizen activism, advice, hope',),
> ('Pharmaceuticals, Medicine, Drugs',), ('Community Investing',),
> ('Environment, Consumer Waste Reduction, Consumer Behavior and
> Taxes',), ('Hunger, US, Poverty',), ('FERTILITY, Women',),
> ('Corporatism, Environment',), ('Economic Democracy, Corporate
> Farming',), ('Economic Democracy, Inspiration',), ('FEAR
> (Fearlessness)',), ('Federal budget, military spending, foreign
> cultural exchange programs',), ('Fish Farming',), ('Fish population,
> commercial fishing industry',), ('GMO, BT Cotton',), ('Food borne
> Illness, Water',), ('Food Charity',), ('Food Charity, Urban Farming',),
> ('Food Consumption, Luxury',), ('Food Cost, international',), ('Food
> Disposal, Waste',), ('Food stamps, eligibility for',), ('Food,
> expenditure on',), ('Foreign Aid',), ('Genetics, Food, Agriculture,
> International',), ('Global Policy, Bush Administration',), ('Global
> Trade, food',), ('Global Trade, free trade, clothing',),
> ('Globalization',), ('GMO, SACTO Protests',), ('GMO, Wheat, trade',),
> ('Happiness and income',), ('Health Care - Spending',), ('Hope',),
> ('Hope, inspirational quote',), ('Human Cloning',), ('Hunger',),
> ('Hunger, income',), ('IMF, Argentina',), ('IMF, failings',),
> ('Inequality',), ('INEQUALITY, GLOBALIZATION, POVERTY',), ('Inequality,
> Globalization, Latin America',), ('Inspiration',), ('Junk Food',),
> ('Junk Food, Soft Drinks',), ('Junk Food ,Children, Education,
> Media',), ('Junk Food, Education, Children, Nutrition',), ('Junk Food,
> Global, Coke',), ('Junk Food, McDonald\x92s',), ('Junk Food,
> McDonald\x92s, Global',), ('Junk Food, Soft Drinks, Water',), ('Junk
> Food, Education, Nutrition, Childhood Illness',), ('Junk food,
> Nutrition, Schools',), ('Labor',), ('Labor Issues, Agriculture,
> Sustainable Agriculture Support',), ('Labor Issues, Employee
> Ownership',), ('Land Reform, Brazil, Infant mortality',),
> ('Livestock',), ('Meat',), ('Meat, Brazil, Soybeans, Deforestation',),
> ('Meat, concentration',), ('Meat, Recalls, Contamination',), ('Meat,
> Recalls',), ('Media',), ('Microloans',), ('Military Spending',),
> ('Nutrition Programs, School Meals, Snapple',), ('Nutrition,
> Finland',), ('Obesity',), ('Obesity, Childhood',), ('Obesity,
> Africa',), ('Organic Food',), ('Obesity, Global',), ('Obesity, related
> illnesses',), ('Obesity, related illnesses, children',), ('Oil',),
> ('Organic Agriculture',), ('Organic Agriculture, Growth',), ('Organic
> Agriculture, Nutrition',), ('Organic Agriculture, Productivity',),
> ('Organic food prices',), ('Community',), ('Corporate Concentration',),
> ('Community Gardens, Urban Gardens',), ('Pollution, Air, CO2
> emissions',), ('Population, Water',), ('Poverty, Aid',), ('Poverty,
> World Bank, Hunger',), ('Organic Produce',), ('Organic Produce,
> Farmer\x92s Markets, CSA Community Initiatives (Dem. Book)',),
> ('Pakistan, Education, Poverty, Terrorism',), ('Pesticides',),
> ('Pollution, US',), ('Population, Women',), ('Poverty, Labor Issues',),
> ('t2',), ('Agriculture, Subsidies, Farming, Ranching, Government,
> Livestock, Cattle',), ('School, Farmers\x92 Fresh Produce Food',),
> ('School, Fast Food, Lunch Programs',), ('School, Fast Food, Lunch
> Programs, Harms',), ('Citizens Groups',), ('Public Health, Bacteria',),
> ('Violence, Impotence',), ('Private Food Aid, Food Stamps',), ('Prison
> Rates, Race',), ('Produce, Nutritional content of produce, Historical
> Perspective',), ('Public Opinion',), ('Slavery',), ('Solar, Renewable
> Energy',), ('Suicide',), ('Sustainable agriculture, Moringa tree',),
> ('Sweatshop Labor',), ('Tax Cuts, George W. Bush',), ('Economic
> Democracy (Dem. Book)',), ('Tobacco',), ('Toxic Chemicals',),
> ('Trade',), ('Trade, Agricultural Raw materials',), ('Trade, Coffee',),
> ('Trade, Cotton',), ('Trade, NAFTA, Mexico',), ('Vegetarianism',),
> ('Veterans\x92 Benefits',), ('Violence',), ('Violence, Media,
> Children',), ('Water',), ('Water, Privatization',), ('Welfare
> Reform',), ('Wind, Renewable Energy',), ('Words',), ('World
> Population',), ('World Bank',), ('Grassroots, Community, Living Wage,
> Poverty',), ('Subsidies',), ('Protest, Action',), ('Nuclear Power
> Plants, Emissions',), ('Media, Fear, Religion, George W. Bush',),
> ('Consciousness, Change',), ('Peace, Security, Oil',), ('Globalization,
> Inequality, Commodity prices',), ('Water, Corporate',), ('Consumerism,
> Developing Nations',), ('Nuclear Power, Wind Power',),
> ('Sustainability, Hope',), ('Ozone, CFCs, Chlorine, Atmosphere',),
> ('Hydrogen, Emissions, Ozone',), ('Water, Pesticides',), ('Iraq,
> Military, Health',), ('Toxic Waste Reduction, Toxic Waste Disposal,
> Environmental Regulation, Recycling Electronics',), ('Shareholder
> Advocacy, Social Responsibility, Community Investing (Dem. Book)',),
> ('Fair Trade',), ('Genetically Modified Food, Africa, USAID, ISAAA',),
> ('Sustainability, Progress',), ('Sustainability, Human Rights,
> Globalization, Corporatization',), ('Agricultural Subsidies,
> Agricultural Policy',), ('Agricultural Subsidies, Farmers',), ('Cotton,
> Rice',), ('Agricultural Subsidies, Farmers, Livestock',),
> ('Agricultural Subsidies, Prices',), ('Food scarcity, Hunger, Urban
> Agriculture',), ('GMO farming, Toxic chemicals',), ('Hunger,
> Children',), ('Hunger, Food Insecurity',), ('Inspiration, Corporatism,
> War',), ('Inspiration, Economic Growth',), ('Land Vacancies, US Land
> Reform',), ('Local agriculture, Local produce, Nutritional content of
> local produce',), ('Local produce, Urban agriculture',), ('Pakistan,
> Religion, Education',), ('Pharmaceuticals',), ('Privatization',),
> ('Public panic, Altruism',), ('QA rewrite: citizen activism,
> corporatism-environment, hope, inspiration',), ('Wal-Mart, Food
> Stamps',), ('Socially Responsible Investment, Banking and Environmental
> Initiatives',), ('Terrorism, Suicide Attacks',), ('Agriculture,
> Corporate v. Family Farming',), ('Depression, Health',), ('Depression,
> Health, Employment, Work, Employee',), ('Self-Interest, Vote,
> Altruism',), ('Animal Feed',), ('Corporate Reform (Dem. Book)',),
> ('Economic Growth',), ('Corporate History, Globalization',),
> ('Agriculture',), ('Environment, Public Opinion (Dem. Book)',),
> ('Illiteracy, poverty',), ('Military, Arms Sales',), ('Agriculture;
> Agricultural imports; Global trade',), ('Africa; Foreign aid; Third
> World debt; Loan forgiveness; Jubilee',), ('Foreign aid; Military aid;
> Development aid; Humanitarian aid',), ('Foreign aid; Development
> assistance',), ('Agricultural Subsidies; Foreign aid; Cotton subsidies;
> Africa',))
> >>>




More information about the Python-list mailing list