Re: [Tutor] noob python question

2015-10-26 Thread Asokan Pichai
Can you retype the question and your code?

On 26 October 2015 at 04:46, bob5487  wrote:

> Howdy!
>
> Reading *Learn Python the Hard Way* Zed Shaw
>
> All good so far but got to Ex 42 dealing with classes...
>
> I get a TypeError: getattr(): attribute name must be a string when I run
> the
> program...
>
> I looked online, python reference manual 3rd edition, etc...
>
> I was wondering if anyone has experience with this book because I hit a
> road
> block
>
>
>
>
>
> --
> View this message in context:
> http://python.6.x6.nabble.com/noob-python-question-tp5174789.html
> Sent from the Python - tutor mailing list archive at Nabble.com.
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
Asokan Pichai
*---*
We will find a way. Or, make one. (Hannibal)

*To find everything profound — that is an inconvenient trait.* It makes one
strain one's eyes all the time, and in the end one finds more than one
might have wished. -- Nietzsche
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] noob python question

2015-10-26 Thread Cameron Simpson

On 25Oct2015 16:16, bob5487  wrote:

Reading *Learn Python the Hard Way* Zed Shaw
All good so far but got to Ex 42 dealing with classes...

I get a TypeError: getattr(): attribute name must be a string when I run the
program...

I looked online, python reference manual 3rd edition, etc...
I was wondering if anyone has experience with this book because I hit a road
block


As always with this list, please post the code you're trying. Even if we had 
the book (I do not, personally), we don't know if your failing code matches the 
code in the book, or if the code in the book is correct.


So please post the code, and the complete error message your computer gives 
you.


Also not that getattr takes a string, per the error message. So to fetch the 
.foo attribute from some object "o" you would write:


 attribute = getattr(o, 'foo')

Note the quotes.

CHeers,
Cameron Simpson 
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] noob python question

2015-10-26 Thread Bob Gailer
Welcome to the tutor list. In order for us to help you please post the
following:
Python version
Operating system
The code you are running
To trace back you are getting
The trace back will be several lines of references to various programs and
line numbers

Once we have that information then it becomes easy to help good luck
On Oct 26, 2015 12:08 AM, "bob5487"  wrote:

> Howdy!
>
> Reading *Learn Python the Hard Way* Zed Shaw
>
> All good so far but got to Ex 42 dealing with classes...
>
> I get a TypeError: getattr(): attribute name must be a string when I run
> the
> program...
>
> I looked online, python reference manual 3rd edition, etc...
>
> I was wondering if anyone has experience with this book because I hit a
> road
> block
>
>
>
>
>
> --
> View this message in context:
> http://python.6.x6.nabble.com/noob-python-question-tp5174789.html
> Sent from the Python - tutor mailing list archive at Nabble.com.
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Python excel filter

2015-10-26 Thread Lucas Mascia
Hello,

I would like some guidance in a way to filter data from an excel sheet
(.xlsx)

I will be exporting an extensive table from a website with 400x20 infos. In
this sheet, I need to apply 3 or 4 filters and collect the amount of info
it shows then. Eg.:

1 - Export .xlsx from website
2 - Run python to filter
2.1 - Filter by client A
2.2 - Filter by task A
2.3 - Filter by Person A
3 - Repeat filter for different clients, tasks and persons
4 - Collect the amount each person does inside each client.


Please Help guide my through a starting poing

Thank you,

Lucas R. Mascia

| VIEW MY | 

"It is not the strongest of the species that survives, nor the most
intelligent that survives. It is the one that is most adaptable to change."
 - Darwin.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python excel filter

2015-10-26 Thread Alan Gauld

On 26/10/15 12:21, Lucas Mascia wrote:

Hello,

I would like some guidance in a way to filter data from an excel sheet
(.xlsx)

I will be exporting an extensive table from a website with 400x20 infos. In
this sheet, I need to apply 3 or 4 filters and collect the amount of info
it shows then. Eg.:

1 - Export .xlsx from website


Can you export to CSV instead? Its much easier to work with CSV files 
using the standard library than to use Excel sheets natively. There are 
Excel modules that you can download but CSV is standard functionality 
and Excel CSV format is the default.



2 - Run python to filter
2.1 - Filter by client A
2.2 - Filter by task A
2.3 - Filter by Person A


Thats pretty meaningless without knowing the format of the tables.


3 - Repeat filter for different clients, tasks and persons


I'm not sure what you mean by "repeat filter" can you elaborate?


4 - Collect the amount each person does inside each client.


What do you mean "the amount"? Is that a column in the table
or are you meaning a count of the number of entries by user?

Without a view of the table format its hard to be any more specific.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] noob python question

2015-10-26 Thread boB Stepp
Greetings!

On Sun, Oct 25, 2015 at 6:16 PM, bob5487  wrote:
> Howdy!
>
> Reading *Learn Python the Hard Way* Zed Shaw
>
> All good so far but got to Ex 42 dealing with classes...
>
> I get a TypeError: getattr(): attribute name must be a string when I run the
> program...
>
> I looked online, python reference manual 3rd edition, etc...
>
> I was wondering if anyone has experience with this book because I hit a road
> block

As many will not have access to this book, what is usually done here
is to copy and paste your code as well as your FULL error message into
a plain text email.  Also, it is usually helpful to state your Python
version and OS type and version.  This will give everyone the
information they need to help you.  Also, you probably need to
summarize what exercise 42 is asking you to do.

I have a copy of that book at home.  If memory serves me correctly, it
is written for Python 2.  If that is the case you probably want to be
looking at the Python 2 documentation.  Also, if you are trying to run
Python 2 code and you have Python 3 installed on your computer, you
will from time to time run into issues just because there ARE
differences between Python 2 and 3 syntax in some areas.

HTH,



-- 
boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python excel filter

2015-10-26 Thread john

take a look at python-excel

xlwt is what I use. BTW there are others Johnf



On 10/26/2015 05:21 AM, Lucas Mascia wrote:

Hello,

I would like some guidance in a way to filter data from an excel sheet
(.xlsx)

I will be exporting an extensive table from a website with 400x20 infos. In
this sheet, I need to apply 3 or 4 filters and collect the amount of info
it shows then. Eg.:

1 - Export .xlsx from website
2 - Run python to filter
2.1 - Filter by client A
2.2 - Filter by task A
2.3 - Filter by Person A
3 - Repeat filter for different clients, tasks and persons
4 - Collect the amount each person does inside each client.


Please Help guide my through a starting poing

Thank you,

Lucas R. Mascia

 | VIEW MY | 

"It is not the strongest of the species that survives, nor the most
intelligent that survives. It is the one that is most adaptable to change."
  - Darwin.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor