[Tutor] sound implementation problems
eryksun
eryksun at gmail.com
Sat Jun 15 11:59:24 CEST 2013
On Fri, Jun 14, 2013 at 6:35 PM, Jim Mooney <cybervigilante at gmail.com> wrote:
> On 14 June 2013 08:49, eryksun <eryksun at gmail.com> wrote:
>>
>> C:\>python -i -c "import os; os.chdir('C:/Python33')"
>
> Well, that didn't work anyway. Got me the right directory and the
> interpeter, but I couldn't run a py file from command. Batch file didn't
> work the way I wanted, either. But PYTHONSTARTUP finally worked nicely,
> for my personal purposes, by running the same python script that puts
> PyScripter into the right directory, based on why Py version is run. So
> all is well ;')
I was just clarifying how -c works, plus for some reason I thought you
wanted an interactive session. In fact, I'm still confused about that
because PYTHONSTARTUP only runs for an interaction startup. It doesn't
run with -c, -m, or a script.
If I run a program that's on the PATH, I expect it to load/save files
relative to my current working directory, so I'm -1 on changing the
working directory. If you have a resource stored relative to the
script, use __file__ or sys.argv[0] to find it. Store per-user
configuration and data in the user's profile:
Windows
Registry (HKCU) - %USERPROFILE%\NTUSER.DAT
%APPDATA% - %USERPROFILE%\AppData\Roaming
%LOCALAPPDATA% - %USERPROFILE%\AppData\Local
Linux Freedesktop
$XDG_CONFIG_HOME - ~/.config
$XDG_DATA_HOME - ~/.local/share
$XDG_CACHE_HOME - ~/.cache
More information about the Tutor
mailing list