I can't.
import file.py
is all very well if the interpreter knows where file.py is.
I want to do this :
import /directory1/directory2/file.py
Is this not possible ?
--
View this message in context:
http://www.nabble.com/Getting-started-with-Python-tp17273337p17273337.html
Sent from
On Fri, May 16, 2008 at 11:20 AM, Moishy Gluck [EMAIL PROTECTED]
wrote:
You need to place a __init__.py file in a directory you want to reference
in an import statement.
I don't believe the content of the file is important but you can place code
in the file that will affect how files are
Have you tried this ?
import sys
sys.path.append('/directory1/directory2')
import file.py
j
On Fri, May 16, 2008 at 10:20 AM, Moishy Gluck [EMAIL PROTECTED]
wrote:
On Fri, May 16, 2008 at 11:20 AM, Moishy Gluck [EMAIL PROTECTED]
wrote:
You need to place a __init__.py file in a directory
Tim Michelsen wrote:
Hello,
is there any function/module that allows me to open a directory in the
default file manager of a operating system?
On Windows you can use os.startfile().
On pure Unices there's no such thing as filetype associations
However, if you use a desktop environment, you
Your right, typo :-)
On Fri, May 16, 2008 at 10:57 AM, Hansen, Mike [EMAIL PROTECTED]
wrote:
Isn't it
import file
not
import file.py
or has that changed in recent versions?
Mike
--
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *jay
I'm looking for a faster way to do the following problem:
I have an urn with many different colors of marbles in it. I pull one
out and note the color. I do not replace it.
For the programming of this, I actually know how many are yellow,
green, etc. So the way the code works right now is:
Hi, I'm writing an AI for a board game called Blokus, and I believe
that the quality of the program is going to greatly depend on the
efficiency of the algorithm I use to generate legal moves and rate
them.
I know sort of how I'm going to do this legal move generation, and I
know it is going to
On 17/05/2008, Adam Clarridge [EMAIL PROTECTED] wrote:
I'm fairly new to Python, and I am not sure whether it would be faster
for me to use a Dictionary data type to represent the board
(advantages: indices can be strings or tuples, and the dictionary can
store different types of data as
Am I missing something? Why does May 7th
and other dates work but I'm getting invalid
token for May 8th and 9th? (I have not tested
many other dates of the year in this way) This
is from a freshly begun IDLE session:
IDLE 1.2
import datetime
datetime.datetime(2008,05,07)
On Fri, May 16, 2008 at 5:43 PM, Joel Miller [EMAIL PROTECTED] wrote:
I'm looking for a faster way to do the following problem:
I have an urn with many different colors of marbles in it. I pull one
out and note the color. I do not replace it.
You probably know, this is called sampling
From: [EMAIL PROTECTED]
To: tutor@python.org
Subject: datetime syntax error for May 8th and 9th 2008??
Date: Sat, 17 May 2008 00:09:03 -0400
Am I missing something? Why does May 7th
and other dates work but I'm getting invalid
token for May 8th and 9th? (I have not tested
many other
On 17/05/2008, Che M [EMAIL PROTECTED] wrote:
datetime.datetime(2008, 05, 08)
SyntaxError: invalid token
It's simpler than that... Try this:
x = 08
File stdin, line 1
x = 08
^
SyntaxError: invalid token
x = 010
x
8
Basically, python interprets integer literals starting with
On 17/05/2008, Joel Miller [EMAIL PROTECTED] wrote:
I have an urn with many different colors of marbles in it. I pull one
out and note the color. I do not replace it.
Kent's suggest seems simplest: represent the marbles as a list of
integers, where marbles[i] is the integer corresponding to
13 matches
Mail list logo