Re: Fwd: Can you help me with this Python question?

2022-10-13 Thread Axy via Python-list
Well, although I never used pandas and never will, if that's about artworks, that's mine. Obviously, you need to iterate columns and sum values returned by the snippet you provided. A quick search tells us to use colums property. So, it might look like this: na_sum = sum(df[name].isnull().su

Fwd: Can you help me with this Python question?

2022-10-13 Thread Sarah Wallace
For a python class I am taking.. In this challenge, you'll be working with a DataFrame that contains data about artworks, and it contains many missing values. Your task is to create a variable called na_sum that contains the total number of missing values in the DataFrame. When that's completed,

Re: Fwd: Python Question re Executing a Script (dn)

2022-05-02 Thread MRAB
On 2022-05-02 17:23, Dennis Lee Bieber wrote: On Mon, 2 May 2022 20:33:02 +1200, dn declaimed the following: Perhaps an MS-Win user can help the OP, please? Not really -- at least from my viewpoint there is not enough information to perform any diagnoses... Other than to recommend th

Re: Fwd: Python Question re Executing a Script (dn)

2022-05-02 Thread Dennis Lee Bieber
On Mon, 2 May 2022 20:33:02 +1200, dn declaimed the following: >Perhaps an MS-Win user can help the OP, please? Not really -- at least from my viewpoint there is not enough information to perform any diagnoses... Other than to recommend that, if the OP initially posted to the list/newsgr

Fwd: Python Question re Executing a Script (dn)

2022-05-02 Thread dn
t the Python script running in the same way I had it running before? Thank you! Brent -Original Message- From: Python-list On Behalf Of dn Sent: Saturday, April 30, 2022 5:48 PM To: python-list@python.org Subject: Re: Python Question re Executing a Script On 01/05/2022 10.37, Brent

Re: Python Question re Executing a Script

2022-04-30 Thread Mike Dewhirst
On 1/05/2022 8:37 am, Brent Hunter wrote: Hello, I just purchased a new Windows 11 computer and installed Python 3.10.4 (64 bit). I can't figure out from your documentation, how do I: 1. Run a python script that is located in the same directory ( C:\Users\Brent\AppData\Roaming\Microsoft

Re: Python Question re Executing a Script

2022-04-30 Thread Dennis Lee Bieber
On Sat, 30 Apr 2022 22:37:35 +, Brent Hunter declaimed the following: >Hello, > >I just purchased a new Windows 11 computer and installed Python 3.10.4 (64 >bit). I can't figure out from your documentation, how do I: > > > 1. Run a python script that is located in the same directory ( >

Re: Python Question re Executing a Script

2022-04-30 Thread dn
On 01/05/2022 10.37, Brent Hunter wrote: > Hello, > > I just purchased a new Windows 11 computer and installed Python 3.10.4 (64 > bit). I can't figure out from your documentation, how do I: > > > 1. Run a python script that is located in the same directory ( > C:\Users\Brent\AppData\Roami

Python Question re Executing a Script

2022-04-30 Thread Brent Hunter
Hello, I just purchased a new Windows 11 computer and installed Python 3.10.4 (64 bit). I can't figure out from your documentation, how do I: 1. Run a python script that is located in the same directory ( C:\Users\Brent\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.10 )

Re: basic Python question

2020-05-08 Thread MRAB
On 2020-05-08 21:19, joseph pareti wrote: yet, something is still unclear; in Python you can do things like: *clf0.fit(X_train,y_train)* which is not the way I programmed in other languages where a left-hand side and a right hand side is required. All it's doing is performing the calculation

Re: basic Python question

2020-05-08 Thread joseph pareti
yet, something is still unclear; in Python you can do things like: *clf0.fit(X_train, y_train)* which is not the way I programmed in other languages where a left-hand side and a right hand side is required. Am Fr., 8. Mai 2020 um 21:52 Uhr schrieb joseph pareti < joeparet...@gmail.com>: > yes,

Re: basic Python question

2020-05-08 Thread joseph pareti
yes, it is random forest classifier from scikit learn. Thank you. Am Fr., 8. Mai 2020 um 21:50 Uhr schrieb MRAB : > On 2020-05-08 20:02, joseph pareti wrote: > > In general I prefer doing: > > > > > > X_train, X_test, y_train, y_test = train_test_split(X, y, > test_size=0.33, random_state=42) >

Re: basic Python question

2020-05-08 Thread MRAB
On 2020-05-08 20:02, joseph pareti wrote: In general I prefer doing: X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42) >clf = RandomForestClassifier(n_estimators = 100, max_depth= None) *clf_f = clf.fit(X_train, y_train)* predicted_labels = clf_f.pred

basic Python question

2020-05-08 Thread joseph pareti
In general I prefer doing: X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42) clf = RandomForestClassifier(n_estimators = 100, max_depth= None) *clf_f = clf.fit(X_train, y_train)* predicted_labels = clf_f.predict( X_test) score = clf.score(X_test, y_test) s

Re: Python question

2020-03-13 Thread Michael Torrie
On 3/12/20 4:19 PM, Mike Dewhirst wrote: > I'm not sure I understand what you are saying. How is gmail > behaviour breaking things? The problem is if I post to a mailing list from gmail (either the web interface or Thunderbird via Google's SMTP servers), Google will silently discard my own message

Re: Python question

2020-03-12 Thread Michael Torrie
On 3/11/20 8:47 PM, DL Neil via Python-list wrote: > Didn't someone once claim "do no harm"? > > There are two sides to every story! Rather than changing the (Discussion > List) server, which affects everyone; ask those who don't like Google's > tactics/behavior to change their (email) client!

Re: Python question

2020-03-12 Thread Souvik Dutta
Ya at least I thought that. On Thu, Mar 12, 2020, 12:45 PM Mike Dewhirst wrote: > On 12/03/2020 1:47 pm, DL Neil via Python-list wrote: > > On 12/03/20 3:03 AM, Rhodri James wrote: > >> On 11/03/2020 04:06, Michael Torrie wrote: > >>> On 3/10/20 6:49 PM, Souvik Dutta wrote: > What about mov

Re: Python question

2020-03-12 Thread Mike Dewhirst
On 12/03/2020 1:47 pm, DL Neil via Python-list wrote: On 12/03/20 3:03 AM, Rhodri James wrote: On 11/03/2020 04:06, Michael Torrie wrote: On 3/10/20 6:49 PM, Souvik Dutta wrote: What about moving on to a social media app completely made in pythoj for python? No thanks. I don't want to be on

Re: Python question

2020-03-11 Thread DL Neil via Python-list
On 12/03/20 3:03 AM, Rhodri James wrote: On 11/03/2020 04:06, Michael Torrie wrote: On 3/10/20 6:49 PM, Souvik Dutta wrote: What about moving on to a social media app completely made in pythoj for python? No thanks. I don't want to be on yet another web forum.  I don't need "social media" or a

Re: Python question

2020-03-11 Thread Grant Edwards
On 2020-03-11, Michael Torrie wrote: > On 3/10/20 6:49 PM, Souvik Dutta wrote: >> What about moving on to a social media app completely made in pythoj for >> python? > > No thanks. I don't want to be on yet another web forum. I don't need > "social media" or a "social media app." Email works exc

Re: Python question

2020-03-11 Thread Rhodri James
On 11/03/2020 04:06, Michael Torrie wrote: On 3/10/20 6:49 PM, Souvik Dutta wrote: What about moving on to a social media app completely made in pythoj for python? No thanks. I don't want to be on yet another web forum. I don't need "social media" or a "social media app." Email works exceedin

Re: Python question

2020-03-10 Thread Michael Torrie
On 3/10/20 6:49 PM, Souvik Dutta wrote: > What about moving on to a social media app completely made in pythoj for > python? No thanks. I don't want to be on yet another web forum. I don't need "social media" or a "social media app." Email works exceedingly well for this sort of thing, despite G

Re: Python question

2020-03-10 Thread Souvik Dutta
What about moving on to a social media app completely made in pythoj for python? On Wed, 11 Mar, 2020, 12:36 am DL Neil via Python-list, < python-list@python.org> wrote: > On 11/03/20 7:34 AM, Michael Torrie wrote: > > On 3/10/20 6:40 AM, Chris Angelico wrote: > >> On Tue, Mar 10, 2020 at 11:22 P

Re: Python question

2020-03-10 Thread DL Neil via Python-list
On 11/03/20 7:34 AM, Michael Torrie wrote: On 3/10/20 6:40 AM, Chris Angelico wrote: On Tue, Mar 10, 2020 at 11:22 PM Marco Sulla via Python-list ... I'm also reading this in Gmail, and I didn't get any such warning. I'm going to call that a spurious warning, a false positive. Gmail often r

Re: Python question

2020-03-10 Thread Michael Torrie
On 3/10/20 6:40 AM, Chris Angelico wrote: > On Tue, Mar 10, 2020 at 11:22 PM Marco Sulla via Python-list >> I would reply, but I was already too much off topic. I want only to >> write what Gmail reports to me about the last message of the person >> that started this discussion: >> >>> This message

Re: Python question

2020-03-10 Thread Chris Angelico
On Tue, Mar 10, 2020 at 11:22 PM Marco Sulla via Python-list wrote: > > On Fri, 6 Mar 2020 at 17:30, Souvik Dutta wrote: > > And you cannot form opinions for > > other people's by saying them not to support a person. That is injustice > > and rude. > > I would reply, but I was already too much of

Re: Python question

2020-03-10 Thread Marco Sulla via Python-list
On Fri, 6 Mar 2020 at 17:30, Souvik Dutta wrote: > And you cannot form opinions for > other people's by saying them not to support a person. That is injustice > and rude. I would reply, but I was already too much off topic. I want only to write what Gmail reports to me about the last message of t

Re: Python question

2020-03-08 Thread Peter J. Holzer
On 2020-03-05 20:49:14 -0800, Mr. Lee Chiffre wrote: > > 2. he does not trust binaries from pip. > > What is the point of open source if you cannot compile from source code? You can get the source code from pypi. I don't see any option for pip to do that, but you can easily do it manually. If yo

Python question

2020-03-07 Thread Mr . Lee Chiffre
Thank you Marco for at least taking the time to read my message even if you do not agree with me on things. And no disrespect to you. But I came here for python related questions and help. Not to be called suspicious and untrustworthy only because I am concerned about security of users and for b

Re: Python question

2020-03-07 Thread Souvik Dutta
This is not a place to quarrel our only task is to discuss and help other learn and learn ourselves. To Mr. Marco what Mr. Lee says is correct. Since he is working on a cryptocurrency project and he might use our original code in his final project I don't think offering money is bad. After all t

Python question

2020-03-06 Thread Mr . Lee Chiffre
Thank you Marco for at least taking the time to read my message even if you do not agree with me on things. And no disrespect to you. But I came here for python related questions and help. Not to be called suspicious and untrustworthy only because I am concerned about security of users and for b

Re: Python question

2020-03-06 Thread Souvik Dutta
This is not a place to quarrel our only task is to discuss and help other learn and learn ourselves. To Mr. Marco what Mr. Lee says is correct. Since he is working on a cryptocurrency project and he might use our original code in his final project I don't think offering money is bad. After all t

Re: Python question

2020-03-06 Thread Souvik Dutta
This is not a place to quarrel our only task is to discuss and help other learn and learn ourselves. To Mr. Marco what Mr. Lee says is correct. Since he is working on a cryptocurrency project and he might use our original code in his final project I don't think offering money is bad. After all t

Re: Python question

2020-03-06 Thread Souvik Dutta
This is not a place to quarrel our only task is to discuss and help other learn and learn ourselves. To Mr. Marco what Mr. Lee says is correct. Since he is working on a cryptocurrency project and he might use our original code in his final project I don't think offering money is bad. After all ther

Python question

2020-03-06 Thread Mr. Lee Chiffre
Thank you Marco for at least taking the time to read my message even if you do not agree with me on things. And no disrespect to you. But I came here for python related questions and help. Not to be called suspicious and untrustworthy only because I am concerned about security of users and for bein

Re: Basic python question

2019-10-03 Thread Peter Otten
Jagga Soorma wrote: > Thanks again Aldwin. This seems to work, guess it is the set that is > flipping the numbers: > > x,y = (output.split()) The parens on the right are superfluous: >>> a, b = "foo bar".split() >>> a 'foo' >>> b 'bar' > inode_cmd = "/bin/df --output=pcent,ipcent /var| grep -

Re: Basic python question

2019-10-02 Thread Jagga Soorma
Thanks again Aldwin. This seems to work, guess it is the set that is flipping the numbers: x,y = (output.split()) Much appreciated! On Wed, Oct 2, 2019 at 9:19 PM Aldwin Pollefeyt wrote: > > Seems to work also: > > >>> [x,y] = output.split() > > On Thu, Oct 3, 2019 at 12:17 PM Aldwin Pollefeyt

Re: Basic python question

2019-10-02 Thread Aldwin Pollefeyt
Seems to work also: >>> [x,y] = output.split() On Thu, Oct 3, 2019 at 12:17 PM Aldwin Pollefeyt wrote: > Oh, sorry .. please try this: > > >>> x,y = tuple(output.split()) > > On Thu, Oct 3, 2019 at 12:11 PM Jagga Soorma wrote: > >> Thanks Aldwin that helps but it looks like it is reversing the

Re: Basic python question

2019-10-02 Thread Aldwin Pollefeyt
Oh, sorry .. please try this: >>> x,y = tuple(output.split()) On Thu, Oct 3, 2019 at 12:11 PM Jagga Soorma wrote: > Thanks Aldwin that helps but it looks like it is reversing the numbers > for some reason: > > the df command returns the following: > 7 2 > > I used your example and did: > x,y =

Re: Basic python question

2019-10-02 Thread Jagga Soorma
Thanks Aldwin that helps but it looks like it is reversing the numbers for some reason: the df command returns the following: 7 2 I used your example and did: x,y = set(output.split()) My assumption would be that x should be 7 and y should be 2. However, when I print x and y it seems to be rev

Re: Basic python question

2019-10-02 Thread Aldwin Pollefeyt
You could use: >>> x, y = set(output.split()) On Thu, Oct 3, 2019 at 11:44 AM Jagga Soorma wrote: > Hello, > > I am new to python and trying to do some basic things with python. I > am writing a script that runs a df command and I need parts of that > output saved in 2 different variables. Is

Basic python question

2019-10-02 Thread Jagga Soorma
Hello, I am new to python and trying to do some basic things with python. I am writing a script that runs a df command and I need parts of that output saved in 2 different variables. Is this something that can be done? I can do this by running multiple df commands but would prefer to make only

Re: Not a python question, just programming logic trap?

2019-03-14 Thread jonas . thornvall
Den torsdag 14 mars 2019 kl. 06:09:02 UTC+1 skrev Rick Johnson: > jonas.t...@gmail.com wrote: > > Nah i can't see the error is due to the "If clause" branching possibly it > > should been an elseif at instead of separate if. No there is something > > going wrong with the variables. > > Well, the

Re: Not a python question, just programming logic trap?

2019-03-13 Thread Ben Finney
jonas.thornv...@gmail.com writes: > Anyone who is good at see logic traps in programming? > comp.lang.javascript is defunct so i try here. Please don't; this forum should primarily be used for discussing Python. I appreciate that you have tried another forum for JavaScript, but that's unrelated

Not a python question, just programming logic trap?

2019-03-13 Thread jonas . thornvall
Anyone who is good at see logic traps in programming? comp.lang.javascript is defunct so i try here. Using the metronome. https://midisequenser.000webhostapp.com I've tried to understand how following code can lead to that after the keyreleased the front of the keyed scrollbar raise/extend f

Re: Python question

2017-03-26 Thread Steve D'Aprano
On Sun, 26 Mar 2017 10:35 pm, Cameron Simpson wrote: > On 26Mar2017 20:55, Steve D'Aprano wrote: >>On Sun, 26 Mar 2017 01:55 pm, c...@zip.com.au wrote: >>> 1: He BCCed the list, not us individually. Look at the headers. >> >>BCCed addresses aren't visible in the headers. That's why they're BLIND

Re: Python question

2017-03-26 Thread Cameron Simpson
On 26Mar2017 20:55, Steve D'Aprano wrote: On Sun, 26 Mar 2017 01:55 pm, c...@zip.com.au wrote: 1: He BCCed the list, not us individually. Look at the headers. BCCed addresses aren't visible in the headers. That's why they're BLIND CC. Of course, but the received headers etc show it passed t

Re: Python question

2017-03-26 Thread Steve D'Aprano
On Sun, 26 Mar 2017 01:55 pm, c...@zip.com.au wrote: > 1: He BCCed the list, not us individually. Look at the headers. BCCed addresses aren't visible in the headers. That's why they're BLIND CC. The lack of personal email addresses in the headers doesn't prove they weren't there. All the headers

Re: Python question

2017-03-25 Thread cs
On 26Mar2017 00:11, Erik wrote: On 25/03/17 20:26, MRAB wrote: On 2017-03-25 20:10, Terry Reedy wrote: On 3/25/2017 6:50 AM, Steve D'Aprano wrote: they BCC or CC me without a good excuse. As I was in this case: the OP BCCed me in his post. I'm not *that* special, so my guess is that he did a

Re: Python question

2017-03-25 Thread Abdul Abdul
Hi Cameron, Thanks for your kind reply and suggestion. Sure, please find my question below. I also show the different edits made and what errors emerged after those edits. Thanks for your support! I have the following code portion for a convolutional neural network: import numpy as np im

Re: Python question

2017-03-25 Thread Erik
On 25/03/17 20:26, MRAB wrote: On 2017-03-25 20:10, Terry Reedy wrote: On 3/25/2017 6:50 AM, Steve D'Aprano wrote: they BCC or CC me without a good excuse. As I was in this case: the OP BCCed me in his post. I'm not *that* special, so my guess is that he did a mass BCC of many regulars here, wh

Re: Python question

2017-03-25 Thread MRAB
On 2017-03-25 20:10, Terry Reedy wrote: On 3/25/2017 6:50 AM, Steve D'Aprano wrote: On Sat, 25 Mar 2017 10:09 am, Cameron Simpson wrote: On 24Mar2017 18:08, Abdul Abdul wrote: I hope you are doing fine. I have added a question on StackOverflow and thought you might have an idea on it. This i

Re: Python question

2017-03-25 Thread Terry Reedy
On 3/25/2017 6:50 AM, Steve D'Aprano wrote: On Sat, 25 Mar 2017 10:09 am, Cameron Simpson wrote: On 24Mar2017 18:08, Abdul Abdul wrote: I hope you are doing fine. I have added a question on StackOverflow and thought you might have an idea on it. This is the question

Re: Python question

2017-03-25 Thread Steve D'Aprano
On Sat, 25 Mar 2017 10:09 am, Cameron Simpson wrote: > On 24Mar2017 18:08, Abdul Abdul wrote: >>I hope you are doing fine. I have added a question on StackOverflow and >>thought you might have an idea on it. This is the question >>

Re: Python question

2017-03-25 Thread dieter
Abdul Abdul writes: > I hope you are doing fine. I have added a question on StackOverflow and > thought you might have an idea on it. This is the question > I do not want to go into the detail

Re: Python question

2017-03-24 Thread Cameron Simpson
On 24Mar2017 18:08, Abdul Abdul wrote: I hope you are doing fine. I have added a question on StackOverflow and thought you might have an idea on it. This is the question Hi Adbul, Please j

Python question

2017-03-24 Thread Abdul Abdul
Hello, I hope you are doing fine. I have added a question on StackOverflow and thought you might have an idea on it. This is the question . Thanks a lot for your kind support. Best, Abder --

Re: Another python question

2016-03-19 Thread sohcahtoa82
On Friday, March 18, 2016 at 3:46:44 PM UTC-7, Alan Gabriel wrote: > Sorry for the multiple questions but my while loop is not working as intended. > > Here is the code : > n = 1 > list1 = [] > count = 0 #amount of times program repeats > steps = 0 # amount of steps to reach 1 > step_list = [] >

Another python question

2016-03-18 Thread Alan Gabriel
Sorry for the multiple questions but my while loop is not working as intended. Here is the code : n = 1 list1 = [] count = 0 #amount of times program repeats steps = 0 # amount of steps to reach 1 step_list = [] while n!=0: n= int(input()) list1.append(n) length = len(list1) while count

Re: PYTHON QUESTION

2015-06-14 Thread Laurent Pointal
adebayo.abra...@gmail.com wrote his student exercise as raw text: > Help with this problem! > > Temperature converter > Description > > Write two functions that will convert temperatures back and forth from the > Celsius and Fahrenheit temperature scales. The formulas for making the > conversion

Re: PYTHON QUESTION

2015-06-11 Thread David Palao
2015-06-11 12:44 GMT+02:00 : > Help with this problem! > > Temperature converter > Description > > Write two functions that will convert temperatures back and forth from the > Celsius and Fahrenheit temperature scales. The formulas for making the > conversion are as follows: > > Tc=(5/9)*(Tf-3

PYTHON QUESTION

2015-06-11 Thread adebayo . abraham
Help with this problem! Temperature converter Description Write two functions that will convert temperatures back and forth from the Celsius and Fahrenheit temperature scales. The formulas for making the conversion are as follows: Tc=(5/9)*(Tf-32) Tf=(9/5)*Tc+32 where Tc is the Celsius te

Re: Re: Simple Python question for some

2012-10-28 Thread Chris Angelico
On Mon, Oct 29, 2012 at 3:30 PM, Evan Driscoll wrote: > On 10/28/2012 7:18 PM, Chris Angelico wrote: >> Which means that strings will ALWAYS be compared as strings, and >> numbers will ALWAYS be compared as numbers, and ne'er the twain shall >> conflict. I can trust Python to compare MD5 hashes re

Re: Re: Simple Python question for some

2012-10-28 Thread Evan Driscoll
On 10/28/2012 7:18 PM, Chris Rebert wrote: > This is fixed in Python 3, where such nonsensical comparisons will > instead raise TypeError. It's worth pointing out that at least one kind of inequality comparison which some people (e.g. me) would consider nonsensical is still allowed in Python 3, wh

Re: Simple Python question for some

2012-10-28 Thread Chris Angelico
On Mon, Oct 29, 2012 at 10:51 AM, Mark L. Hotz wrote: > At the IDLE prompt, when I enter “b” > 99, it responds True. In fact, it > doesn’t matter which number is entered here, “b” is always greater (e.g. “b” >> 1 == True; “b” > 10 == True, or “b” < 99 = False). To Python, different object typ

Re: Simple Python question for some

2012-10-28 Thread Chris Rebert
On Sun, Oct 28, 2012 at 4:51 PM, Mark L. Hotz wrote: > I have what I think should be a relatively simple question for someone who > is knowledgeable about Python. > > At the IDLE prompt, when I enter “b” > 99, it responds True. In fact, it > doesn’t matter which number is entered here, “b” is alwa

Re: Simple Python question for some

2012-10-28 Thread Mark Lawrence
On 28/10/2012 23:51, Mark L. Hotz wrote: I have what I think should be a relatively simple question for someone who is knowledgeable about Python. Sorry you've come to the wrong place :) At the IDLE prompt, when I enter "b" > 99, it responds True. In fact, it doesn't matter which number is e

Simple Python question for some

2012-10-28 Thread Mark L. Hotz
I have what I think should be a relatively simple question for someone who is knowledgeable about Python. At the IDLE prompt, when I enter "b" > 99, it responds True. In fact, it doesn't matter which number is entered here, "b" is always greater (e.g. "b" > 1 == True; "b" > 10 == True, or "

Re: new to python question

2011-09-28 Thread Benjamin Kaplan
On Wed, Sep 28, 2011 at 5:06 PM, The Geek wrote: > I'm clearly not understanding something about scope in python...  Any help > is appreciated > In the following script I'm attempting to create 2 Foo objects, for each Foo > object I create 2 Bars and add them to Foo's bar array > Something hokey i

new to python question

2011-09-28 Thread The Geek
I'm clearly not understanding something about scope in python... Any help is appreciated In the following script I'm attempting to create 2 Foo objects, for each Foo object I create 2 Bars and add them to Foo's bar array Something hokey is occurring with the "foo.bars.append(bar)" line such that

Re: Need help with simple OOP Python question

2011-09-08 Thread Piet van Oostrum
Terry Reedy writes: > Indexing objects by their internal id is usually useless. obj.id is not the internal id. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help with simple OOP Python question

2011-09-05 Thread Terry Reedy
On 9/5/2011 9:15 AM, Kristofer Tengström wrote: Thanks everyone, moving the declaration to the class's __init__ method did the trick. Now there's just one little problem left. I'm trying to create a list that holds the parents for each instance in the hierarchy. This is what my code looks like no

Re: Need help with simple OOP Python question

2011-09-05 Thread Peter Otten
Jon Clements wrote: > I > must say I'm not 100% sure what the OP wants to achieve... Learn Python? ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help with simple OOP Python question

2011-09-05 Thread Jon Clements
On Sep 5, 3:43 pm, Peter Otten <__pete...@web.de> wrote: > Kristofer Tengström wrote: > > Thanks everyone, moving the declaration to the class's __init__ method > > did the trick. Now there's just one little problem left. I'm trying to > > create a list that holds the parents for each instance in t

Re: Need help with simple OOP Python question

2011-09-05 Thread Kristofer Tengström
Thanks everyone, moving the declaration to the class's __init__ method did the trick. Now there's just one little problem left. I'm trying to create a list that holds the parents for each instance in the hierarchy. This is what my code looks like now: - cla

Re: Need help with simple OOP Python question

2011-09-05 Thread Peter Otten
Kristofer Tengström wrote: > Thanks everyone, moving the declaration to the class's __init__ method > did the trick. Now there's just one little problem left. I'm trying to > create a list that holds the parents for each instance in the > hierarchy. This is what my code looks like now: > > --

Re: Need help with simple OOP Python question

2011-09-05 Thread srinivas hn
Hi, You are getting same object because you are overriding the dictionary update. Its printing the proper value with the last updated instance of B. If you want to see the two different instances of class B give print self.sub inside the sub_add method in class A. CHEERS CNA 9986229891 On Mon,

Re: Need help with simple OOP Python question

2011-09-05 Thread Ben Finney
Kristofer Tengström writes: > Hi, I'm having trouble creating objects that in turn can have custom > objects as variables. That terminology is rather confused. I think what you want is to have instances with their own attributes. > class A: > sub = dict() This binds a single object (a new

Re: Need help with simple OOP Python question

2011-09-05 Thread Peter Otten
Kristofer Tengström wrote: > Hi, I'm having trouble creating objects that in turn can have custom > objects as variables. The code looks like this: > > - > > class A: > sub = dict() Putting it into the class like this means sub is shared by all in

Re: Need help with simple OOP Python question

2011-09-05 Thread Stephen Hansen
On 9/4/11 11:47 PM, Kristofer Tengström wrote: > Hi, I'm having trouble creating objects that in turn can have custom > objects as variables. The code looks like this: > > - > > class A: > sub = dict() You are sharing this single "sub" dictionary w

Need help with simple OOP Python question

2011-09-04 Thread Kristofer Tengström
Hi, I'm having trouble creating objects that in turn can have custom objects as variables. The code looks like this: - class A: sub = dict() def sub_add(self, cls): obj = cls() self.sub[obj.id] = obj class B(A): id = 'inst'

Re: python question

2011-02-02 Thread Benjamin Kaplan
On Wed, Feb 2, 2011 at 4:08 PM, Robin wrote: > > how do you acccess a hash element in python 3? It completely changed > from version 2 and earlier, I think. > What do you mean by accessing a hash element? Do you mean the hash of an object? Because that's stayed the same: hash(obj). Do you mean ac

python question

2011-02-02 Thread Robin
how do you acccess a hash element in python 3? It completely changed from version 2 and earlier, I think. stop war straight up, direct or indectly, -- http://mail.python.org/mailman/listinfo/python-list

Re: Python question

2010-04-11 Thread DreiJane
Rereading my sent answer i wondered, what the variable s was used for besides that "find" and found nothing. Without it also the layout is better: if os.environ['PATH'].find(gtkBinDir) == -1: os.putenv("PATH", os.getenv("PATH")+ os.pathsep + gtkBinDir) -- http://mail.python.org/mailman/listi

Re: Python question

2010-04-11 Thread DreiJane
Hello, Python and gtk are "ambulant" (portable plus intallable by mere copying without admin rights). gtk only needs to have the path to its / bin on the PATH . The latter could - and possibly should be - done by the Python scripts using it, for example: s = os.environ['PATH'] if s.find(gtkBinDir

Re: Python question

2010-04-09 Thread Gabriel Genellina
En Fri, 09 Apr 2010 14:14:34 -0300, Binary escribió: How much space approximately is required to install the following packs on Windows XP? pycairo-1.4.12-2.win32-py2.6.exe python-2.6.1.msi pygobject-2.14.2-2.win32-py2.6.exe pygtk-2.12.1-3.win32-py2.6.exe pywin32-213.win32-py2.6.exe gtk-2.

Python question

2010-04-09 Thread Binary
How much space approximately is required to install the following packs on Windows XP? pycairo-1.4.12-2.win32-py2.6.exe python-2.6.1.msi pygobject-2.14.2-2.win32-py2.6.exe pygtk-2.12.1-3.win32-py2.6.exe pywin32-213.win32-py2.6.exe gtk-2.12.9-win32-2.exe Does all this packs requires installation

Re: compiling python question

2010-02-25 Thread Diez B. Roggisch
Am 25.02.10 01:55, schrieb Mag Gam: sorry for the vague answer. Its Linux. The configure build does not say anything actually. This is for SAGE. I managed to have it pick it up by compiling/installing tcl and tk and then recompile python Then most probably installing the tk-dev packages would

Re: compiling python question

2010-02-24 Thread Mag Gam
sorry for the vague answer. Its Linux. The configure build does not say anything actually. This is for SAGE. I managed to have it pick it up by compiling/installing tcl and tk and then recompile python On Wed, Feb 24, 2010 at 4:50 PM, Diez B. Roggisch wrote: > Am 24.02.10 03:00, schrieb Mag Ga

Re: compiling python question

2010-02-24 Thread Diez B. Roggisch
Am 24.02.10 03:00, schrieb Mag Gam: I am trying to compile python with Tk bindings. Do I need to do anything special for python to detect and enable Tk? What OS? What does the configure/build process say? Diez -- http://mail.python.org/mailman/listinfo/python-list

compiling python question

2010-02-23 Thread Mag Gam
I am trying to compile python with Tk bindings. Do I need to do anything special for python to detect and enable Tk? This is mainly for matplotlib's TkAgg. It seems my compiled version of python isn't finding the module _tkagg -- http://mail.python.org/mailman/listinfo/python-list

Re: python question

2009-05-22 Thread Tim Wintle
On Fri, 2009-05-22 at 05:51 -0700, Craig wrote: > I use python 2.6.2 and i useing ubuntu 9.04 not windows. What are you trying to install? is it available in Synaptic package manager? If it's a program written in python, then there may be a file called "setup.py". If there is then open a termin

Re: python question

2009-05-22 Thread Craig
I use python 2.6.2 and i useing ubuntu 9.04 not windows. --- On Thu, 5/21/09, Dave Angel wrote: > From: Dave Angel > Subject: Re: python question > To: "Craig" > Cc: python-list@python.org > Date: Thursday, May 21, 2009, 2:22 PM > Craig wrote: > > How do i

Re: python question

2009-05-21 Thread Dave Angel
Craig wrote: How do i install this.i never seen a python write in c before. Well, I've never seen a snake program in any language, python or otherwise. And I believe python was named after Monty Python, not the snake. But once it got its name, snake puns abound. Anyway, why not tell yo

python question

2009-05-21 Thread Craig
How do i install this.i never seen a python write in c before. -- http://mail.python.org/mailman/listinfo/python-list

RE: applescript/python question

2008-08-02 Thread jyoung79
Hi Diez, Thanks for your reply. I gave this a try too, but it doesn't seem to work either. However, a gentleman just emailed me off-list recommending to use the full path to Python that is in /usr/local/bin. This is where Python 2.5 looks to be installed rather than Python 2.3 which is in /u

Re: applescript/python question

2008-08-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: I can't seem to figure this out. I just installed Python 2.5.2 a few days ago on my OS X 10.4.11 system. It runs fine and if I type "Python -V" in the Terminal it outputs "Python 2.5.2" which is correct. However, if I try to run a 'do shell script' in AppleScript w

RE:applescript/python question

2008-08-01 Thread jyoung79
Hi Sean, Thanks for your fast reply. This still doesn't seem to work. I also tried changing it to #!/usr/local/bin/python since it looks like the Python 2.5 items are actually in there. I'm starting to wonder if AppleScript's 'do shell script' command is actually looking in /usr/bin for Pyth

Re: applescript/python question

2008-08-01 Thread Sean DiZazzo
On Aug 1, 5:41 pm, <[EMAIL PROTECTED]> wrote: > I can't seem to figure this out.  I just installed Python 2.5.2 a few days > ago on my OS X 10.4.11 > system.  It runs fine and if I type "Python -V" in the Terminal it outputs > "Python 2.5.2" which is > correct.  However, if I try to run a 'do she

applescript/python question

2008-08-01 Thread jyoung79
I can't seem to figure this out. I just installed Python 2.5.2 a few days ago on my OS X 10.4.11 system. It runs fine and if I type "Python -V" in the Terminal it outputs "Python 2.5.2" which is correct. However, if I try to run a 'do shell script' in AppleScript which I'm wanting to run a Py

  1   2   3   >