Re: [Tutor] Python function

2018-12-14 Thread Avi Gross
@python.org Subject: Re: [Tutor] Python function On 13/12/2018 17:21, Sammy Lee wrote: > How do I create a python function that opens a CSV file and determines > how many columns of data are in the file? The CSV files have been > randomly generated from https://www.mockaroo.com/

Re: [Tutor] Python function

2018-12-13 Thread Alan Gauld via Tutor
On 13/12/2018 17:21, Sammy Lee wrote: > How do I create a python function that opens a CSV file and determines how > many columns > of data are in the file? The CSV files have been randomly generated from > https://www.mockaroo.com/ > > def csv_column_count(openfile): You will find a bunch of s

Re: [Tutor] Python function

2018-12-13 Thread Bob Gailer
On Dec 13, 2018 1:55 PM, "Sammy Lee" wrote: > > How do I create a python function that opens a CSV file and determines how many columns > of data are in the file? The CSV files have been randomly generated from https://www.mockaroo.com/ > > def csv_column_count(openfile): Same comments as I made

[Tutor] Python function

2018-12-13 Thread Sammy Lee
How do I create a python function that opens a CSV file and determines how many columns of data are in the file? The CSV files have been randomly generated from https://www.mockaroo.com/ def csv_column_count(openfile): ___ Tutor maillist - Tutor@pyth

Re: [Tutor] Python function argument passing problem

2014-01-09 Thread Alan Gauld
On 09/01/14 00:33, Manoj Rout wrote: I have been working with python from last couple of weeks. As I am new to python I have a problem with my work. So can you please look into the below code. with open('C:\\Users\\Manoj\\Desktop\\XMC1100_rm_v1.0.6_SVD.xml','r') as xmlfile: sv

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread David Hutto
scripts\lowerdir\lowerdir.py >>> As long as you have sys imported at somepoint, then all you have to do is print sys.argv[0], and that should be the exact name and location of the current running script, David --- On Fri, 2/5/10, Daniel Sarmiento wrote: From: Daniel Sarmiento Su

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread David Hutto
ir\lowerdir.py >>> As long as you have sys imported at somepoint, then all you have to do is print sys.argv[0], and that should be the exact name and location of the current running script, David --- On Fri, 2/5/10, Daniel Sarmiento wrote: From: Daniel Sarmiento Subject: Re: [Tu

Re: [Tutor] python function to know the path of the program in execution * *

2010-02-05 Thread Rohit Roger$
tps://www.boxbe.com/anno?tc=1530328725_1435846689&disp=b> | Block > domain <https://www.boxbe.com/anno?tc=1530328725_1435846689&disp=b&dom> > > > > Date: Fri, 5 Feb 2010 17:43:37 +0530 >> From: Spoorthi >> To: "Rohit Roger$" >> Cc:

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread Daniel Sarmiento
Date: Fri, 5 Feb 2010 17:43:37 +0530 From: Spoorthi To: "Rohit Roger$" Cc: tutor Subject: Re: [Tutor] python function to know the path of the program in execution * Message-ID: <6c9f52051002050413o57bd76bax7ac5986b17304...@mail.gmail.com> Content-

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread Rohit Roger$
13 PM, David Hutto wrote: >>>> >>>>> Junk Score: 2 out of 10 (below your Auto Allow >>>>> threshold<https://www.boxbe.com/mail-screening>) >>>>> | Approve sender <https://www.boxbe.com/anno?tc=1529381613_418589136>| >>>&g

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread Spoorthi
nno?tc=1529381613_418589136> | >>>> Block sender<https://www.boxbe.com/anno?tc=1529381613_418589136&disp=b>| >>>> Block >>>> domain <https://www.boxbe.com/anno?tc=1529381613_418589136&disp=b&dom> >>>> >>>> >>&g

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread Rohit Roger$
ning>) >>> | Approve sender <https://www.boxbe.com/anno?tc=1529381613_418589136> | >>> Block >>> sender <https://www.boxbe.com/anno?tc=1529381613_418589136&disp=b> | Block >>> domain <https://www.boxbe.com/anno?tc=1529381613_418589136&disp=b&

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread Spoorthi
.com/anno?tc=1529381613_418589136&disp=b> | Block >> domain <https://www.boxbe.com/anno?tc=1529381613_418589136&disp=b&dom> >> >> >> >> --- On *Fri, 2/5/10, nikunj badjatya * wrote: >> >> >> From: nikunj badjatya >> Subject: [Tutor]

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread Rohit Roger$
t; | Approve sender <https://www.boxbe.com/anno?tc=1529381613_418589136> | Block > sender <https://www.boxbe.com/anno?tc=1529381613_418589136&disp=b> | Block > domain <https://www.boxbe.com/anno?tc=1529381613_418589136&disp=b&dom> > > > > --- On *Fr

Re: [Tutor] python function to know the path of the program in execution

2010-02-05 Thread David Hutto
--- On Fri, 2/5/10, nikunj badjatya wrote: From: nikunj badjatya Subject: [Tutor] python function to know the path of the program in execution To: tutor@python.org Date: Friday, February 5, 2010, 5:08 AM Hi , Is there any python function to know the path of the python program under

[Tutor] python function to know the path of the program in execution

2010-02-05 Thread nikunj badjatya
Hi , Is there any python function to know the path of the python program under execution.? If someone executes a program , he should come to know the path of the program..!! ex. suppose a user ABC is running prog.py which is in ~ directory, the user currently is in XYZ directory. [ a...@localhost X

Re: [Tutor] Python Function Doubt

2009-05-26 Thread Alan Gauld
"nikhil" wrote Are objects for arguments, that persist between function calls, created during function definition ONLY when they have default values ? In Python the parameters are not objects but names. names are used to reference objects. If there is no default value then there is no objec

Re: [Tutor] Python Function Doubt

2009-05-26 Thread spir
Le Tue, 26 May 2009 19:42:34 +0530, nikhil s'exprima ainsi: > Hi, > > Thanks for reply. > > I went through the link you provided. It was very helpful. > > What I understood is this, > > --> Objects are created for default argument types, inside the function > object. ... for default argument

Re: [Tutor] Python Function Doubt

2009-05-26 Thread Dave Angel
nikhil wrote: Hi, I am learning Python and came across this example in the Python Online Tutorial ( http://docs.python.org/tutorial/controlflow.html#default-argument-values) for Default Argument Values. ex: def func(a, L=[ ]): L.append(a) return L print func(1) print func(2) print func(3)

Re: [Tutor] Python Function Doubt

2009-05-26 Thread nikhil
Hi, Thanks for reply. I went through the link you provided. It was very helpful. What I understood is this, --> Objects are created for default argument types, inside the function object. This happens only once when the function definition statement is executed. These objects persist

Re: [Tutor] Python Function Doubt

2009-05-26 Thread Christian Witts
nikhil wrote: Hi, I am learning Python and came across this example in the Python Online Tutorial (http://docs.python.org/tutorial/controlflow.html#default-argument-values) for Default Argument Values. ex: def func(a, L=[ ]): L.append(a) return L print func(1) print func(2) print func(3)

[Tutor] Python Function Doubt

2009-05-26 Thread nikhil
Hi, I am learning Python and came across this example in the Python Online Tutorial ( http://docs.python.org/tutorial/controlflow.html#default-argument-values) for Default Argument Values. ex: def func(a, L=[ ]): L.append(a) return L print func(1) print func(2) print func(3) *O/P* [1] [1,2] [