List Info

Thread: Compiled pyton in windows




Compiled pyton in windows
user name
2007-06-25 18:00:49
This question is as much about python as wing, but this
group might know the 
answer.

Is there a way to configure wing or python so that the
compiled (.pyc) files 
go into a different directory hierarchy than the source? I'd
like to be able 
to ftp the source tree up to my (linux) server, and I'd like
to leave the 
compiled files behind.



_________________________________________________
Wing IDE users list
http://wingware.com
/lists/wingide

RE: Compiled pyton in windows
user name
2007-06-26 07:53:11
I don't think there is a way to have .pyc files not show up
in their
associated source file directories.  It makes sense if you
think about
it, otherwise how would you know what package a module
belongs to?  I
guess you could have some elaborate `tree mirror' somewhere,
but that
well it's pretty elaborate .

But if you just want to skip *.pyc files, you could use
tar's --exclude.
I think the command line would look something like this:

tar --exclude='*.pyc' -cjf mytarfile.tar.bz2 sourcedir

HTH!
jw

> -----Original Message-----
> From: Tom Stambaugh [mailto:tmszeetix.com]
> Sent: Monday, June 25, 2007 6:01 PM
> To: wingide-userswingware.com
> Subject: [wingide-users] Compiled pyton in windows
> 
> This question is as much about python as wing, but this
group might
know
> the
> answer.
> 
> Is there a way to configure wing or python so that the
compiled (.pyc)
> files
> go into a different directory hierarchy than the
source? I'd like to
be
> able
> to ftp the source tree up to my (linux) server, and I'd
like to leave
the
> compiled files behind.
> 
> 
> 
> _________________________________________________
> Wing IDE users list
> http://wingware.com
/lists/wingide

_________________________________________________
Wing IDE users list
http://wingware.com
/lists/wingide

RE: Compiled pyton in windows
user name
2007-06-26 14:41:48
You can create a simple makefile rule to use the compile
module of python.
I have done this:

$/%.pyc: ./src/%.py
    test -d `dirname $` | mkdir -p `dirname $`
    $(PYTHON) -c "import py_compile;
py_compile.compile("$<","$")"

Where TARGET_DIR is the dir of the pyc files.



-----Original Message-----
From: wingide-users-bounceswingware.com
[mailto:wingide-users-bounceswingware.com] On Behalf Of
Wyant, Jaime
Sent: Tuesday, June 26, 2007 5:53 AM
To: wingide-userswingware.com
Subject: RE: [wingide-users] Compiled pyton in windows

I don't think there is a way to have .pyc files not show up
in their
associated source file directories.  It makes sense if you
think about it,
otherwise how would you know what package a module belongs
to?  I guess you
could have some elaborate `tree mirror' somewhere, but that
well it's pretty
elaborate .

But if you just want to skip *.pyc files, you could use
tar's --exclude.
I think the command line would look something like this:

tar --exclude='*.pyc' -cjf mytarfile.tar.bz2 sourcedir

HTH!
jw

> -----Original Message-----
> From: Tom Stambaugh [mailto:tmszeetix.com]
> Sent: Monday, June 25, 2007 6:01 PM
> To: wingide-userswingware.com
> Subject: [wingide-users] Compiled pyton in windows
> 
> This question is as much about python as wing, but this
group might
know
> the
> answer.
> 
> Is there a way to configure wing or python so that the
compiled (.pyc) 
> files go into a different directory hierarchy than the
source? I'd 
> like to
be
> able
> to ftp the source tree up to my (linux) server, and I'd
like to leave
the
> compiled files behind.
> 
> 
> 
> _________________________________________________
> Wing IDE users list
> http://wingware.com
/lists/wingide

_________________________________________________
Wing IDE users list
http://wingware.com
/lists/wingide

_________________________________________________
Wing IDE users list
http://wingware.com
/lists/wingide

Re: Compiled pyton in windows
user name
2007-06-26 15:26:52
Dan and Jaime, thanks for your information. I fear I have
not said enough 
about my problem.

I create and debug the python source on a local WinXP
machine. After it 
works, I upload the source to a linux box.

As Jaime points out, unless I do lots of WinXP magic, I get
.pyc files 
intermingled with the .py files in the same directory on my
WinXP machine. 
Unless I do something like cygwin (which I have but don't
use much), I don't 
have any winxp-side tools like tar and make. OTOH, if cygwin
DOES include 
tar, then perhaps that's the way to go. My immediate problem
is that FTP 
blindly transfers the .pyc files along with the .py files.
Even something as 
simple as applying a filter within FTP, saying "don't
send files with an 
extension of .pyc" would work. I just don't see such a
filter within the ftp 
doc (I use WS-FTP pro).

Don, I think I probably didn't explain my problem clearly
enough. I have a 
cable modem between my local WinXP box and my linux server.
While the 
download speed is very high, the *upload* speed is much
slower. Because of 
this communication bottleneck, I'm looking for an easy way
to avoid pushing 
the .pyc files up the channel to the server. I don't see how
a makefile 
running on either machine solves this.

Thx,
Tom

----- Original Message ----- 
From: "Dan Cook" <onedscsonic.net>
To: <wingide-userswingware.com>
Sent: Tuesday, June 26, 2007 3:41 PM
Subject: RE: [wingide-users] Compiled pyton in windows


> You can create a simple makefile rule to use the
compile module of python.
> I have done this:
>
> $/%.pyc: ./src/%.py
>    test -d `dirname $` | mkdir -p `dirname $`
>    $(PYTHON) -c "import py_compile;
py_compile.compile("$<","$")"
>
> Where TARGET_DIR is the dir of the pyc files.
>
>
>
> -----Original Message-----
> From: wingide-users-bounceswingware.com
> [mailto:wingide-users-bounceswingware.com] On Behalf Of
Wyant, Jaime
> Sent: Tuesday, June 26, 2007 5:53 AM
> To: wingide-userswingware.com
> Subject: RE: [wingide-users] Compiled pyton in windows
>
> I don't think there is a way to have .pyc files not
show up in their
> associated source file directories.  It makes sense if
you think about it,
> otherwise how would you know what package a module
belongs to?  I guess 
> you
> could have some elaborate `tree mirror' somewhere, but
that well it's 
> pretty
> elaborate .
>
> But if you just want to skip *.pyc files, you could use
tar's --exclude.
> I think the command line would look something like
this:
>
> tar --exclude='*.pyc' -cjf mytarfile.tar.bz2 sourcedir
>
> HTH!
> jw
>
>> -----Original Message-----
>> From: Tom Stambaugh [mailto:tmszeetix.com]
>> Sent: Monday, June 25, 2007 6:01 PM
>> To: wingide-userswingware.com
>> Subject: [wingide-users] Compiled pyton in windows
>>
>> This question is as much about python as wing, but
this group might
> know
>> the
>> answer.
>>
>> Is there a way to configure wing or python so that
the compiled (.pyc)
>> files go into a different directory hierarchy than
the source? I'd
>> like to
> be
>> able
>> to ftp the source tree up to my (linux) server, and
I'd like to leave
> the
>> compiled files behind.
>>
>>
>>
>> _________________________________________________
>> Wing IDE users list
>> http://wingware.com
/lists/wingide
>
> _________________________________________________
> Wing IDE users list
> http://wingware.com
/lists/wingide
>
> _________________________________________________
> Wing IDE users list
> http://wingware.com
/lists/wingide
> 



_________________________________________________
Wing IDE users list
http://wingware.com
/lists/wingide

Re: Compiled pyton in windows
user name
2007-06-26 15:47:22
why not open a windows command prompt and run

del /s *.pyc

to delete all .pyc files in all subdirectories before you
ftp.

Cheers
Tim

-- 
Tim Mitchell
Software Engineer
Applied Research Associates (NZ) Ltd. (www.aranz.com)
Ph: +64 (3) 374-6120 ext: 203
Fax: +64 (3) 374-6130
Skype: tim-mitchell

_________________________________________________
Wing IDE users list
http://wingware.com
/lists/wingide

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )