I need to input a csv as parameter 1. Parameter 2 should be a dropdown displaying the various fields (the headerline) where I can select a column to use for geoprocessing.     Param1:  c:\my.csv Param2: (dropdown) select header
I have a python script that checks file path names for corresponding files in a drive location. All of the inputs were originally hard coded, and it works well enough:      import arcpy     import os     shp = r"C:\Users\dotwell\Desktop\Locations.shp"     fields = ["ZdriveLoc"]     f = open (r"C:\Users\dotwell\Desktop\ValMapsTest.txt", "w")     cursor = arcpy.da.SearchCursor (shp, fields)         for row in cursor:             Roll=str(row[0])             if not os.path.exists(Roll):             f.write(Roll + os.linesep)       f.close()   I'm trying to create an ArcGIS script tool from this, and I've only had partial success. I can use   shp = arcpy.GetParameterAsText(0)   to allow the user to select the shapefile. I'd like to then have a drop down list of the fields in that shapefile for the user to select the field that contains the path names, but I can't get it to work. Can someone show me how to generate the drop down? Here's my latest try. It works, but requires the user to type in the field name. It would also be nice for the user to designate the output text file name and location.   import arcpy import os shapefile = arcpy.GetParameterAsText(0) field = arcpy.GetParameterAsText(1) f = open (r"C:\Users\dotwell\Desktop\ValMapsTemp.txt", "w") cursor = arcpy.da.SearchCursor (shapefile, field) for row in cursor:     Roll=str(row[0])     if not os.path.exists(Roll):         f.write(Roll + os.linesep)   f.close()   Here are the parameters in my ArcGIS script tool:
Why on the first page Google says there are thousands of results but on the last page there are less than a hundred? If M is a non-orientable closed connected 3 manifold prove H1(M) is an infinite group. Mathematician learning theoretical physics How to check if a column exists in a SQL Server table? I need to add a specific column if it does not exist. I have something like the following, but it always returns false:  IF EXISTS(SELECT *           FROM   INFORMATION_SCHEMA.COLUMNS           WHERE  TABLE_NAME = 'myTableName'                  AND COLUMN_NAME = 'myColumnName')    How can I check if a column exists in a table of the SQL Server database? When customers buy things from a store, you say:  (1) Customers give ABC Store business.  If I "turn this around", can I say:  (2) ABC Store obtains or acquires business from its customers.  Do these verbs work in (2)? PHP get number of week for month Langage to declare a circuit board One of the most commonly asked questions of beginners. How do ranks work in Go for amateurs?  Why do we start backwards? And why do we suddenly count upwards again? What is the difference between 9d and 9p? How is this related to rating? What are the basic differences between ranks used in different countries and different servers? How do I check if a string is a number (float)? Possibly offensive usernames I flagged  as having a  ():    I said "possibly offensive" because it's possible it's a genuine surname I wasn't aware of, but googleing didn't show any evidence and  pretty much matched my definition of it which seems offensive.   Is this really a genuine name? If not how is it possibly not offensive and thus a bad flag?   (I flagged in good faith so even if it is a genuine name declining seems harsh) $ d_1,d_2\mid n\iff {\rm lcm}(d_1,d_2)\mid n\ $ [LCM Universal Property] Say I have 12 and have to factorize it in 2 factors. Now possible factors are 1, 12 2, 6 3, 4   Now 3,4 is such that value of maximum factor i.e. 4 is minimized among all pairs.  How to find the solution in generic case where a number N is to be divided in K factors minimizing maximum value. How to quit Skype on Android? Creating point to center of polyline? I'm trying to create a points in the middle of polylines. The data is now in the form of shapefile. Is there an easy way to do this? How to get client's IP address using JavaScript? I need to somehow retrieve the client's IP address using JavaScript; no server side code, not even SSI.  However, I'm not against using a free 3rd party script/service. $\sum_{1}^{n}\left ( a_{i}b_{i} \right )\geq \prod_{1}^{n}\left ( a_{i}^{b_{i}} \right )$ Let $a,b,c,x,y,z&gt;0$ and $x+ y+ z= 1$. Show that $$ax+ by+ cz\geq  a^{x}.b^{y}.c^{z}$$ I have found the generalization of this inequality: For 2 sets of numbers $\left \{ a_{i} \right \}, \left \{ b_{i} \right \}&gt; 0$ and $\sum_{1}^{n}b_{i}= 1$, we have: $$\sum_{1}^{n}\left ( a_{i}b_{i} \right )\geq  \prod_{1}^{n}\left ( a_{i}^{b_{i}} \right )$$ First solution Simply compare the logs: as the natural logarithm is a concave function, one has $$\ln\bigl(a^x b^y c^z)=x\ln a+y\ln b+z\ln c\le \ln(ax+by+cz)$$ for all non-negative $x,y,z$ such that $x+y+z=1$. How about another solution? I really hope to see that. Thanks! I'm having some trouble proving that the Gaussian Integer's ring ($\mathbb{Z}[ i ]$) is an Euclidean domain. Here is what i've got so far.  To be a Euclidean domain means that there is a defined application (often called norm) that verifies this two conditions:   $\forall a, b \in \mathbb{Z}[i] \backslash {0} \hspace{2 mm} a \mid b \hspace{2 mm} \rightarrow N(a) \leq N (b)$ $\forall a, b \in \mathbb{Z}[i] \hspace{2 mm} b \neq 0 \rightarrow \exists c,r \in \mathbb{Z}[i] \hspace {2 mm}$ so that $\hspace{2 mm} a = bc + r \hspace{2 mm} \text{and} \hspace{2 mm} (r = 0 \hspace{2 mm} \text{or} \hspace{2 mm} r \neq 0 \hspace{2 mm} N(r) \lt N (b) )$   I have that the application meant to be the "norm" goes: $N(a +b i) = a^2 + b^2$, and I've managed to prove the first condition, given that N is a multiplicative function, but I can not find a way to prove the second condition.   I've search for a similar question but I have not found any so far, please redirect me if there's already a question about this and forgive me for my poor use of latex. Why is my ASCII art all wonky? Nothing looks right in the ASCII art.  It looks wrong and nothing is proportional, how do I fix this? I have tried fiddling with my font size, but nothing still looks right! Can houseplants actually improve air quality? Ubuntu Wifi drivers not working after getting update