Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #105774 > unrolled thread

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

Started byJoel Goldstick <joel.goldstick@gmail.com>
First post2016-03-26 13:26 -0400
Last post2016-03-26 13:26 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: PLEASE HELP -- TOTALLY NEW TO PYTHON Joel Goldstick <joel.goldstick@gmail.com> - 2016-03-26 13:26 -0400

#105774 — Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2016-03-26 13:26 -0400
SubjectRe: PLEASE HELP -- TOTALLY NEW TO PYTHON
Message-ID<mailman.49.1459013221.28225.python-list@python.org>
On Sat, Mar 26, 2016 at 1:31 AM, Juan Dent <juandent@mac.com> wrote:

>
> I am trying to run ‘python cppdep.py’ but get the following:
>
>
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> analyzing dependencies among all components ...
> Traceback (most recent call last):
>   File "cppdep.py", line 675, in <module>
>     main()
>   File "cppdep.py", line 643, in main
>     calculate_graph(digraph)
>   File "cppdep.py", line 570, in calculate_graph
>     (cycles, dict_node2cycle) = make_DAG(digraph, key_node)
>   File "/Users/juandent/Downloads/cppdep-master/networkx_ext.py", line 79,
> in make_DAG
>     for ind in range(len(subgraphs)-1, -1, -1):
> TypeError: object of type 'generator' has no len()
>
>
> Please, I know no python and am in a hurry to get this working… Please help
>
>
> Regards,
> Juan
> --
> https://mail.python.org/mailman/listinfo/python-list
>

As a painless quick try I would change this line:

for ind in range(len(subgraphs)-1, -1, -1):

to this:

for ind in range(len(list(subgraphs))-1, -1, -1):

If that works, when you have time track down what is really going on.
-- 
Joel Goldstick
http://joelgoldstick.com/ <http://joelgoldstick.com/stats/birthdays>
http://cc-baseballstats.info/

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web