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 8375317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:08:39+00:00 2026-06-09T15:08:39+00:00

I just started learning Python about a week ago. I’ve made considerable progress thanks

  • 0

I just started learning Python about a week ago. I’ve made considerable progress thanks to everyone who has asked and answered questions. I came across a problem last night and after a lot of searching and pondering– I still can’t figure it out.

I tried making a Python project in xcode but I can’t find the output file. I started the project by selecting “Cocoa-Python Application from the “Choose your template menu:” In the main.py file, I have the following code:

import objc
import Foundation
import AppKit
from PyObjCTools import AppHelper

file = open('test.txt', 'w')

print >> file, 'Test of the emergency broadcast system.'
print 'This is merely a test...'

file.close()

The console shows the “This is merely a test…” statement but I can’t find the output file ‘test.txt’ anywhere. I’ve searched the computer and it’s nowhere to be found. I’m sure it’s something silly, but what am I missing?

  • 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-09T15:08:41+00:00Added an answer on June 9, 2026 at 3:08 pm

    Print this to your console, and you’ll see the file name:

    print file
    

    http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files


    If that just shows you the relative path, print the cwd like so:

    from os import getcwd
    print 'Current directory:', getcwd()
    

    http://docs.python.org/library/os#os.getcwd

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just started learning about Gimp scripting using Python, and was wondering, how do
Hi thanks in advance for your help. I'm just getting started learning Python and
I'm Java person who just started learning Python. Take this example: class Person(): def
I am a beginner and just started learning Python couple days ago (yay!) so
I just started learning Python a couple of days ago as my first language
We just started learning about class inheritance and attribute lookup in python. I have
I've just started learning Python a few hours ago, and there seems to be
I have just started learning python version 3 and trying to create a file
So ive just started learning python on WAMP, ive got the results of a
I just started using/learning Python and have some questions. I have a text file

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.