Project layout / Import files from different subdirectories
Hi folks. I'm new to python and have a slight problem importing - or maybe understanding - modules. I'm writing a GUI application using Qt4 and wanted to separate the business from the view logic. So I have my folder structure as following: project/ main.py important.py project/ gui/ __init__.py mainwindow.py anotherwindow.py Now I can import mainwindow etc. from main and important, but how do I do it the other way round? Also, is there maybe a better project layout? I couldn't find anything useful on it asking Dr. Google. Best regards, Markus -- PGP/GPG key 0x2EB39BF9 -- -- PGP/GPG key 0x2EB39BF9 -- http://mail.python.org/mailman/listinfo/python-list
Re: Project layout / Import files from different subdirectories
Diez B. Roggisch schrieb: > > By placing a __init__.py into project, and then > > import project.main > import project.gui.mainwindow > > > Diez Ouch. Thanks. Markus -- PGP/GPG key 0x2EB39BF9 -- http://mail.python.org/mailman/listinfo/python-list
Re: Project layout / Import files from different subdirectories
Steve Holden schrieb: > If you want shorter names in your main code, of course, you can use > > import project.main as main > import project.gui.mainwindow as window > > or somethihg similar. > > regards > Steve Yeah, I was going with the "from x import y" scheme by now, didn't know "as" was available as well. Perfect, that makes it a bit easier. Thanks! Markus -- PGP/GPG key 0x2EB39BF9 -- http://mail.python.org/mailman/listinfo/python-list
Bug in PIL 1.1.6
Hi again. I seem to have stumbled over a bug in PIL 1.1.6's ImageQt module. It has problems with _some_ GIFs, which appear sheared after the conversion. Seems to be a scanline length problem or something. > ImageQt(Image.open(specific_gif_file)) displayed using a PyQt4 painter. Any idea where I should send this (and/or more) information to? Best regards, Markus -- PGP/GPG key 0x2EB39BF9 -- http://mail.python.org/mailman/listinfo/python-list
Re: Bug in PIL 1.1.6
[EMAIL PROTECTED] schrieb: > Markus Mayer: >> Any idea where I should send this (and/or more) information to? > > You can send your note and and image to effbot. > You can also put an image online somewhere and give here the link (a > small image, to avoid saturating your server, etc) so people can test > it. Okay, for the tip, here we go: http://www.defx.de/usenet/imgqtbug/index.html I included a small test case that shows this behavior. Regards, Markus -- PGP/GPG key 0x2EB39BF9 -- http://mail.python.org/mailman/listinfo/python-list
Re: Bug in PIL 1.1.6
Steve Holden schrieb: > [EMAIL PROTECTED] wrote: > From > > http://www.pythonware.com/products/pil/ > > """ > You can join the Image SIG via python.org's subscription page, or by > sending a mail to [EMAIL PROTECTED] Put subscribe in the > message body to automatically subscribe to the list, or help to get > additional information. > """ Hum, I was hoping I could avoid that. :/ (The list, of course) Markus -- PGP/GPG key 0x2EB39BF9 -- http://mail.python.org/mailman/listinfo/python-list
Re: Bug in PIL 1.1.6
Markus Mayer schrieb: > Okay, for the* tip, here we go: *2nd tip that is. I need some sleep. -- PGP/GPG key 0x2EB39BF9 -- http://mail.python.org/mailman/listinfo/python-list