Re: Creating an .exe with Tkinter involved

2008-07-03 Thread Fouff

Alex Bryan a écrit :
I know this is possible so someone out there should be able to help me! 
Okay, I have a program that uses Tkinter, and BeautifulSoup. I don't 
think it should be a problem. I want to create an exe of it. I have 
py2exe but I don't really know how to work it. I read their tutorial 
thing and did a setup that looked something like this:


from distutils.core import setup
import py2exe

setup(console['myFunProgram.py'])

(isn't really called myFunProgram)

This seems terribly wrong however because... it isn't a console app. So 
I am wondering if anyone can show me how or point me in the right 
direction to a place where I can learn how to do this. I would 
appreciate it!


Hi.

If your program isn't a concole one, maybe should you rename it .pyw and then
in your setup.py file, replace the line
> setup(console['myFunProgram.py'])
by this one
   setup(windows=["myFunProgram.pyw"])

I use it under MS windows (I don't know if it is your case too).

You will find more informations here 
http://www.py2exe.org/index.cgi/ListOfOptions
and more generally at http://www.py2exe.org/


Fouff
--
http://mail.python.org/mailman/listinfo/python-list


Question about python 2.4 documentation

2005-04-19 Thread Fouff
Hello all.
I have a small question concerning the functions open(...) and file(...) 
with python 2.4

In the online version of the documentation in the build-in functions 
(section 2.1 http://docs.python.org/lib/built-in-funcs.html) here is an 
quote of the file(...) doc :
The file() constructor is new in Python 2.2 and is an alias for open().
Both spellings are equivalent.
The intent is for open() to continue to be preferred for use as a factory 
function which
returns a new file object.
The spelling, file is more suited to type testing (for example, writing 
"isinstance(f, file)").

In my installed python 2.4 documentation the correspondig quote :
The file() constructor is new in Python 2.2.
The previous spelling, open(), is retained for compatibility, and is an alias 
for file().
If I understand well, in my version it is recommended to use file() 
function instead of open(), and in the online version it is the opposite.

what is the favorite function you recommend me to use ?
Thanks for your responses .
--
http://mail.python.org/mailman/listinfo/python-list


Re: Add System Path?!?

2005-04-05 Thread Fouff
[EMAIL PROTECTED] a écrit :
Hello NG,
I have a GUI (written in wxPython) that calls some external exe files.
Some of them requires that I add to the PATH variable 1 directory. Basically,
the exe are located in:
/MyApp/Solvers/FirstExe
/MyApp/Solvers/SecondExe
And so on, while the dll needed by these exe are located in:
/MyApp/MyDll
These exe files do not work if I don't set the PATH variable also to that
adress. I know I can do it by hand (and also my users can), but I wonder
if there is a way to do it in Python...
Thank you for all suggestions/pointers.
Andrea.

Why not just adding in your app
import os
os.environ['PATH'] += ";the_new_adress_needed_by_exe"
this will just modify locally to your app the environement variable PATH
If you want to modify it for ever, just open a console DOS (cmd.exe) and 
type:
set PATH=%PATH%;the_new_adress_needed_by_exe

--
http://mail.python.org/mailman/listinfo/python-list


Re: copying a file in the python script

2005-04-04 Thread Fouff
Raghul a écrit :
hi
   I am having a problem. I want to copy a file from the folder and
paste it or move it to another folder. Is it possible in python?
Actually I need to implement this in the zope for my site. When I click
any file it should move or copied to another folder in the same machine
using zope.
Thanks in advance.
Hello.
try this :
import shutil
shutil.copyfile(srcfile, dstfile)
if you want to move, just use this after
import os
os.remove(srcfile)
Bye
Fouff
--
http://mail.python.org/mailman/listinfo/python-list


Re: how to import a .py in a parent directory ?

2005-02-15 Thread Fouff
raver2046 a écrit :
hello,
I know to import a .py in a subdirectory is   :   .  (dot)
but what is the statment for parent directory ?
thank you.
olivier noblanc
http://www.logiciel-erp.fr

sys.path.append("..")
import you_python_file_you_want_to_import.py
--
http://mail.python.org/mailman/listinfo/python-list


Re: goto, cls, wait commands

2005-02-10 Thread Fouff
BOOGIEMAN a écrit :
I've just finished reading Python turtorial for non-programmers
and I haven't found there anything about some usefull commands I used in
QBasic. First of all, what's Python command equivalent to QBasic's "goto" ?
I had a professor that told me that using goto in prog is that there is 
a mistake in the algorythm.
If I remember, I think there is no goto instruction in python !

Secondly, how do I clear screen (cls) from text and other content ?
I don't understand well what you exactly want to do. Can you explain 
more please.

And last, how do I put program to wait certain amount of seconds ?
If I remeber correctly I used to type "Wait 10" and QBasic waits 
10 seconds before proceeding to next command.
import time
   time.sleep(10)
--
http://mail.python.org/mailman/listinfo/python-list


Re: [OT] SciTe

2005-01-11 Thread Fouff
I use Scintilla which is Scite with a lot of configurations files.
In directory exists a file "cpp.properties" and near the end of the file 
is describe the command line use to compile, to link, ...

I think you would be able to change here the compiler.
regards
Fouff
--
http://mail.python.org/mailman/listinfo/python-list