Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8729255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:48:00+00:00 2026-06-13T08:48:00+00:00

Not sure how to form corectly, but the problem is related to a shapefile(python

  • 0

Not sure how to form corectly, but the problem is related to a shapefile(python library) function of writing a new row, which requires to write variables..
From my data I’m creating a list, which I thought I can cast to tuple and will solve my problem, but nah.. I doesn’t go so easy…

The function is asking this:
w.record(a, b, c, d....) or w.record('a', 256, 25.2444, 'd'....)
My data is in a list, but the list length is not known my default, it depends form the input data and the right length is important!

I could also write w.record(list[0], list[1]...list[len(list)-1]), but then I have to create this automatically and not sure how could I do that.

Btw, I use an old python: 2.5… (not my choise)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:48:01+00:00Added an answer on June 13, 2026 at 8:48 am

    There are 4 kinds of argument in a function declaration: –

    • Positional Argument
    • Default Argument (or, keyword argument – in the form: – a = 5)
    • Non-Keyword Argument
    • Keyword Argument (or, dictionary type keyword argument)

    A typical function declaration goes like this: –

    func(positional_args, keyword_args,
                         *tuple_grp_nonkw_args, **dict_grp_kw_args)
    

    You need non-keyword argument, which take extra argument and store them as tuple:

    w.record(*yourvalues)
    

    Similarly keyword argument, takes dictionary as input. They are denoted with **kwarg.

    • All the keyword arguments after the non-keyword arguments go into **kwarg
    • And all the keyword arguments before the non-keyword arguments are default arguments

    For E.G: –

    // nkwarg takes a list
    // kwarg takes a dictionary
    def foo(arg, defaultarg = 5, *nkwarg, **kwarg):
        print arg
        print defaultarg
        print nkwarg
        print kwarg
    
    
    foo("hello", ["how", "are", "you"], a = 3, b = 4)
    

    OUTPUT: –

    hello
    5
    (['how', 'are', 'you'],)
    {'a': 3, 'b': 4}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure what the problem is here, I've inherited some code form Zend
Not sure how to word this but my problem is that my fields will
I'm not sure how to make a few parts of my form to populate
I'm not sure why the Chosen Plugin is not being called when my form
I'm trying to autosubmit a form with greasemonkey however I'm not sure how to
Not sure if im just being stupid or something but here goes i work
Not sure how to ask this, but i'll give it a try: I have
Not sure if this is a big deal. But wondering why when the site
not sure what I'm missing here, but i keep getting the error. SQLSTATE[HY093]: Invalid
I am not sure if I remember correctly, but I think I read once

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.