Re: Python includes?

  • From: "Alex Hall" <mehgcap@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 25 Dec 2009 01:01:19 -0500

Know what? Never mind... just an error (I was trying to import file.py, not just file). I hate those stupid mistakes! Thanks for the responses, though, and enjoy your Christmas (or whatever you celebrate)! Now off to explore this API in more detail. Expect a question sometime soon about Python GUI libraries...



Have a great day,
Alex
New email address: mehgcap@xxxxxxxxx
----- Original Message ----- From: "Tyler Littlefield" <tyler@xxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, December 25, 2009 0:57
Subject: Re: Python includes?


I'm confused as to what you want then. all I see is a import facebook.py a="a" b="b" etc. can you post the code your using? I see a myapp then you talk about three different variables later. Are you using the class right?
On Dec 24, 2009, at 10:44 PM, Alex Hall wrote:

Sorry, include was in my head. The statement is import, and it worked to import the facebook.py file, but my file failed. All that is in the file are three variables which I want to be accessible. I am most familiar with Java, so I will compare what I want to do with having a very small class with three public variables. That way, any program can create an instance of that class and call class.varName on any public var. Again, though, this is Python, but I want to replicate the concept.


Have a great day,
Alex
New email address: mehgcap@xxxxxxxxx
----- Original Message ----- From: "Tyler Littlefield" <tyler@xxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Thursday, December 24, 2009 22:28
Subject: Re: Python includes?


what do you mean "include the file?" I think you should go read the python tutorial, and start with the basics. Python doesn't use "include."
On Dec 24, 2009, at 8:17 PM, Alex Hall wrote:

Hi all,
I have a Facebook id and api key and so on. I want to put this in a file called myApp.py so I can include it in any python files I make for this app and log on by just saying
fb=facebook.Facebook(myApp.id,myApp.sk)
However, trying to include the file results in a "no module named py" error on line 1. The file is just

id=1
ak='ab2'
sk='bc3'

but those numbers and strings are, of course, made up. Why is it not letting me do this? Thanks!


Have a great day,
Alex
New email address: mehgcap@xxxxxxxxx
__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: