#python - Sun 29 Apr 2007 between 01:57 and 02:15

NY Lost Funds



KirkMcDonaldopen('foo.txt', 'w').write(
Err
open('foo.txt', 'w').write('stuff')
Icezizimthanks
KirkMcDonaldIcezizim: Have you read the tutorial? You are asking some very basic questions.
Behold! Here is how you fish: http://docs.python.org/index.html
TFKyleor use with if you want to be cool :)
Icezizimo
ok thanks
Xamuskspeaking about locales, does anyone know how to handle the tzinfo stuff? I couldn't understand by reading the docs
TFKyleXamusk: personally I just use pytz normally, localtime can be annoying at times though
XamuskTFK, so, I have to install the python-tz package or is it from the standard lib?
TFKylenope, it's separate
Xamusk:(
I gotta read more about this pytz
though not now, as I'm falling asleep already
red_herringdammit. this importing crap is making me bash my head in
TFKylered_herring: sup?
red_herringim trying to run a script in a subdirectory that inherets a class from the base directory
and it will NOT work no matter how hard i try
it says 'to make a package, make a __init__.py in that directory'
i do that, and even add __all__=[asdfasdfasdf]
TFKylered_herring: put the upper one in a package then the one in the subdir in a subpackage then import upperpackage.modname?
dijixred_herring: make sure that your base directory is in your PATH
red_herringTFKyle: thats just it, how exactly do i make packages?
TFKyleor with python 2.5 you could do from __future__ import absolute_import then from .. import modname
red_herring: a package is basically a dir with an __init__.py and various other .py files in it
red_herringTFKyle: mhm
which i got (i think)
TFKylered_herring: then the dir above it needs to be in your PYTHONPATH (or the packagedir needs to be in site-packages or some dir already in sys.path)
red_herringhrm....
TFKylecould also import sys.path and modify it if needed
er, import sys and modify sys.path rather
red_herringi'd love to use python 2.5's from __future__... but i gotta keep it 2.4 compatable
TFKyle: so would i have to make a shell script to modify PYTHONPATH to be the current dir, then run it?
also, if i make it a package do i need antyhing specific in __init__.py other than __all__
TFKylered_herring: well, probably easier just to make the script append to sys.path if you go that route (well, depends on the situation I guess)
and nope
you don't even need stuff in __all__, it is useful though
red_herringyeah

Page: 2 9 16 23 30 37 44 51 58 65 72 79 

IrcArchive

NY Lost Funds