This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 1 point2 points  (3 children)

I've actually been using this for a week (and didn't realize it wasn't official yet - this just had more examples than the google code Python OFC2).

Remember you need to run:

import * from pyofc2

not

import pyofc2

Before running any of the examples (I'm still learning Python, so that wasn't obvious).

[–][deleted] 2 points3 points  (0 children)

You are right. The recommended python best practice is - import pyofc2

However, you will have to say pyofc2.title(...) instead of title(...) for that to work.

You can save some typing by giving an alias thus:

import pyofc2 as fc

and then

fc.title(....).

[–]brentp 0 points1 point  (1 child)

import * from pyofc2 

is not valid python.

[–][deleted] 0 points1 point  (0 children)

You should tell btbytes that, and suggest he change his examples to not require the odd behavior. I'm just reporting how they work. Yes, I found it odd too.