• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: File Output from Python to Obj-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File Output from Python to Obj-C


  • Subject: Re: File Output from Python to Obj-C
  • From: "Pontus Ilbring" <email@hidden>
  • Date: Mon, 15 May 2006 14:55:29 +0200

On 5/15/06, Wesley <email@hidden> wrote:
Hi,

I'm doing a research project that was prototyped in Python, but is
beginning to bog as the numbers get massive, so I'm translating it to
Obj-C. It's gone fairly well. I'm stumped, however, by writing to a
file. I thought to use NSFileHandle, but I can't seem to figure out
how to use it. Can anyone suggest a straight forward way to translate
the following:

        ft = open('out.xls', 'w')
        ft.write("Leaders\tTop\tInteractivity\tContribution\n")

        for eachTry in tries:
                commCompare = simulateCommunity(C)
                line = "%d\t%d\t%d\t%f\n" % (int(A*100), commCompare[0], commCompare
[1],\
                        commCompare[0]/float(commCompare[1]))
                ft.write(line)

ft.close()

You have full access to the standard C libraries in Objective-C, so use fopen and fprintf. _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >File Output from Python to Obj-C (From: Wesley <email@hidden>)

  • Prev by Date: Re: C++ gets translated into ObjC? Strange compiler errors... [RESOLVED]
  • Next by Date: Re: Accessing SQL Databases
  • Previous by thread: File Output from Python to Obj-C
  • Next by thread: Re: File Output from Python to Obj-C
  • Index(es):
    • Date
    • Thread