How do I get the OS System Font Directory(Cross-Platform) in python?
How do I get the OS System Font Directory(Cross-Platform) in python? Need a simple script for Windows, Linux, Mac, etc.. Or using wxPython. I can't seem to find anything that works, and I don't want to hard-code paths. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do I get the OS System Font Directory(Cross-Platform) in python?
For a portable font install tool. Finding if a particular font exists, useful when testing apps in virtual environent, rendering text from a font, Font file manipulations, etc.. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do I get the OS System Font Directory(Cross-Platform) in python?
@ Chris “Kwpolska” Warrick Thanks, that is a start anyway. a Pure-Python way was what I was wanting, not win32api stuff. "C:\Windows\Fonts" The windows path proves valid. Works on XP, Vista, 7. Not sure about win8...? Don't have a mac handy, but the link should be enough to help write some code before testing. I don't own a mac, but IIRC macs come with python installed, so a trip to the apple shop might be in order. As far as linux goes, basically Ubuntu/Kubuntu(dirivs), Mandriva/Mageia, Mint, and some of the more popular distros is all I am really looking for. Checking for these is VirtualBox shouldn't be too hard with your instructions and platform.linux_distribution() Thanks again. Here is the 'Open Font License 1.1 (OFL 1.1)' Fonts I will be using. http://sourceforge.net/projects/sourcecodepro.adobe/ http://sourceforge.net/projects/sourcesans.adobe/ Also found these links that might help with pathing. http://www.fontation.com/feature/ http://www.yearbooks.biz/?event=FAQ.Detail&faq=3 -- http://mail.python.org/mailman/listinfo/python-list
Re: How do I get the OS System Font Directory(Cross-Platform) in python?
On Thursday, July 11, 2013 12:47:01 PM UTC-5, Nobody wrote: > > What makes you think the system *has* a system font directory? Way back when I was kid, I remember a computer that had two colors and 1 built-in font and no mouse. Heck the keyboard was even attached in front a tube screen box. Wow... those were the days. And to think I hated that thing... If the OS doesn't *have* a dedicated system fonts dir that is accessable by the user, then I am not that much interested in dealing with it. Rendering a font from a other location will eventually be worked in, but that isn't the problem at hand. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do I get the OS System Font Directory(Cross-Platform) in python?
On Thursday, July 11, 2013 8:27:04 PM UTC-5, Christian Heimes wrote: > Am 11.07.2013 19:19, schrieb Metallicow: > > > @ Chris �Kwpolska� Warrick > > > Thanks, that is a start anyway. > > > a Pure-Python way was what I was wanting, not win32api stuff. > > > > > > "C:\Windows\Fonts" > > > The windows path proves valid. Works on XP, Vista, 7. Not sure about > > win8? > > > > That's the wrong way to do it. You have to use the proper Windows API to > > get to the font directory. It's SHGetKnownFolderPath() with > > FOLDERID_Font or SHGetFolderPath() with CSIDL_FONTS. > > > > See http://bugs.python.org/issue1763 > > > > Christian typo'd instead of copy/pasted. What I meant was... Chris's code... >>> FONTDIRS = os.path.join(os.environ['WINDIR'], 'Fonts') 'C:\\WINDOWS\\Fonts' returned valid as returned string. Forgot to add >>> part. Is there any way to edit posts? Don't see an edit linky anywhere. Is there something wrong with using os.environ...? win32api stuff is another dependency. Is it really needed? -- http://mail.python.org/mailman/listinfo/python-list
Re: How do I get the OS System Font Directory(Cross-Platform) in python?
On Saturday, July 13, 2013 12:36:45 AM UTC-5, Tim Roberts wrote: > Really? Because Windows is the ONLY one of the major operating systems > > that actually has a dedicated system fonts directory. Linux doesn't even > > have a dedicated windowing system. So... Is it expected to install duplicates to multiple locations with Mac and Linux...? -- http://mail.python.org/mailman/listinfo/python-list
Embroidermodder2 Kickstarter for Python also!
Dear Pythoneers, Just letting you know we got a Kickstarter going on for Embroidermodder2 finally. We are going to need all the support we can get. https://www.kickstarter.com/projects/redteam316/embroidermodder-2-for-windows-mac-linux-pi-and-ard What is the program for you may ask...? It is for making designs and stuff that can be embroidered on just about any fabric. It is the first real decent open-source embroidery software that handles many formats that would meet standard business/artists needs. https://en.wikipedia.org/wiki/Comparison_of_embroidery_software As an unofficial developer at this point my involvement hinders in the pure python side of things, but only upon project success. So what that means for everyone is that if the project IS successful, then I will be doing a pure python port of the application also(In PySide/PyQt first, then possibly a wxPy port) working closely with the two lead developers whom of which I know both well and respect and can attest to the level of devotion to quality being put into it. I already have the majority of the GUI code ported at alpha stage ATM so am off to a good start, but what is needed is at least initial funding before more work on the python side can continue, because we can't sustain self-funding this forever. Python bindings is a stretch goal also that was initially set. I don't recall exactly who it was here that joked about wanting the "Guido Van Rossum World Tour" Shirt, but it can be possible for anyone now with some basic skills and a machine(or you could take it to a local embroidery shop). The program aims to make the designer clothing side of the industry affordable and introducable for not only a small fry just starting a business, it also applies to shops that already exist as it provides open tools easily customizable to meet the jobs special purpose needs. So what we need is for the project to succeed by being funded and custom clothing design will then be finally open to the masses and so everyone can profit from it. There are many other rewards to consider also for your pledge. The campaign is going on until April 20th(Easter), so I encourage everyone interested in cheaper quality tools and clothes/etc to pledge what you can. Lets help these guys out. Thanks. Pic to python port WIPz http://i861.photobucket.com/albums/ab180/metallicow/Python/PySide-PyQt_Port.png -- https://mail.python.org/mailman/listinfo/python-list
Re: Examples of modern GUI python programms
On Sunday, March 30, 2014 9:16:06 PM UTC-5, Michael Torrie wrote: > On 03/30/2014 05:16 PM, D. Xenakis wrote: > > > What i need is to develop an android looking program (entirelly in > > python) for windows, but dunno if this is possible (most propably > > is), and which tool between those would help me most: tkinter - > > > wxpython - pyqt - pygtk . > > > > Any examples and suggestions are most welcome. > > Your best bet is to use PyQt. I bet you can make some android-looking > UIs using QtQuick (Javascript) with a bit of Python glue. Well, I wouldn't exactly say that Qt is the way to go just yet... The author needs to weigh the benefits of each toolkit and make a decision for themselves. As far as Qt is concerned, it is a bit more geared towards mobile apps at this point in its python life. It is a bit nicer with the animated stuff also. wxPython on the other hand has way better community support than QT side and has been around longer, so that may be a consideration. Tk is alright and bundled with python but requires more work than the others and isn't always native looking without a bit of extra work. Overall if you are fine with using a GUI builder for the GUI framework, then QT has a nice put-it-all-together IDE. If you are looking for a really customized(hand-tweakable) GUI with relative hassle, then I would recommend wxPython or if you know Tk this would be ok for the majority of stuff, but requires a bit more work. Another thing to consider is that if you are actually wanting this to work on a android or mobile device QT would be a better choice. Especially if touch support is an option. If you are only wanting it to look like android themed app, the other choices provide better long term benefits. As far as pygtk, that fairs better with linux, and in my opinion could use some updates platform-wise rounding the bugs out overall. My opinion would be wxPython if not actually using for a mobile, or PySide if you are. Both of these have acceptable licenses if you want to go commercial also without having to pay for commercial library usage. -- https://mail.python.org/mailman/listinfo/python-list
Re: Examples of modern GUI python programms
On Monday, March 31, 2014 3:48:33 AM UTC-5, Sturla Molden wrote: > If you are to distribute a program using LGPL software on AppStore or > Gopgle Play, then remember that the user must be allowed to relink the > program with anpther version of the library. That is an LGPL requirement. I > don't see how this requirement can be satisfied in this case. Thus, LGPL on > AppStore or Google Play is probably put of the question. At least on iOS, > the user cannot change what you put in an App bundle. This excludes > wxPython and PySide. Thus, the only viable cross-platform choices are > commercial PyQt + commercial Qt or tkinter. In case of iOS, PyObjC is also > an option. py2app will also be useful for creating App bundles on iOS. > > Sturla The OP didn't exactly detail what exactly was being looked for just "python on windows" basically. So that part still hasn't been answered... As far as wxPython, that is not LGPL, it is wxPython/wxWidgets which is fine for licensing your compiled app as however you want. Modifications to the library stuff for example is good in the fact with this that most all improvements(to the library-stuff) eventually work their way back in or have to be released GPL v2. One would have to tool through the PySide agreement for their specifics, but as I recall it is exactly the same as Qt is, which makes sense. Riverbank/PyQt is not Qt, they are a separate entity, just to make that clear. The reason PySide was made was because Riverbank didn't want to license their bindings that same as Qt basically. A lot depends on what you intend to do with "the" app and how many hoops you are willing to jump through license wise. Just because a library is LGPL doesn't mean the authors code has to be depending on the circumstances. That just means usually you have to be able to provide the library code(and your mods to it) used. If the author doesn't care about releasing his/her own source code, then just about any toolkit would be at the same level of "python on windows" for the most part. It all depends on what the target for the app is. "Windows desktop?", "Windows Phone?", "MSW XBox?", etc... -- https://mail.python.org/mailman/listinfo/python-list
Re: Examples of modern GUI python programms
On Monday, March 31, 2014 3:16:16 PM UTC-5, Sturla Molden wrote: > > According to their web page, PySide is only LGPL. Qt is LGPL or commercial. """ Licensing PySide has been published as a response to the lack of suitably licensed Qt bindings for Python. PySide is licensed under the LGPL version 2.1 license, allowing both Free/Open source software and proprietary software development. """ Read the legal definition of/and proprietary, then go consult a lawyer. That is caught as an exception/addition to the LGPL in the wording. I don't think anyone pressing the issue would get very far at all, unless there is a real good reason your own non-library source should be disclosed. Are there any legal precedents yet? If you didn't pay for it, or don't have a class action suit, or is of national security, then good luck. So, yes, PySide is acceptable also in certain situations you don't have to disclose own source. May need to consult with Qt personally on the matter if a Qt license is actually needed for your particular project, but in plain legal wording of the LGPL/Qts/PySides agreements, no, it is not but there are a few rules that have been layed out you will need to follow if you don't have a Qt license. Anywho, here is some infos detailing a bit more commonly asked situations on their forums regarding PySide. http://qt-project.org/wiki/About-PySide http://qt-project.org/forums/viewthread/34770 If you do have a Qt license, then the rules change a bit more in your favor at levels of what you can ignore, that others can't legally. A couple of our team members has a license to cover the stuff we do, so I don't worry about it much. The majority of it is open anyway, but pity those who expect everything for free. *I can hear it now* boo hoo pdf format is finally "free and open" after all these years of adobe's money*grubbin*making. geez... Lesson is: Any software/hardware dev should be familiar with the licensing terms of the toolkits they intend to use. There are always hoops to jump through for "Free-Types". Everyone needs to eat also, because as of this writing "Money" has yet to be abolished in this needy world of ours. And also it seems to fuel development in certain cases also. I often find the writings on the GPL pages about stuff related similarly to sound like a Richard being a crybaby at times, even tho I do respect him for his views he tries to emboss on everyone to create a "not-exactly-freeier-but-just-more-open" overall software society. If everyone had a flat wallet, then this idea would work out nicely. If I ever write a printer driver, I will make sure I license it GPL and personally send him a copy to inspect, believe me. Maybe when the next raspberry pi revision comes out he'll send 1000's of them out for free also to his supporters and developers also, but I somehow doubt it. http://www.gnu.org/philosophy/proprietary.html Anyhow, this should hopefully be enough infos for the OP to get a general idea of what toolkit would be needed for whatever project is in mind. As I say ",If not satisfied, contact sales. They are always reassuring to sound the least." -- https://mail.python.org/mailman/listinfo/python-list
trailing underscores naming convention_
I seem to be comfortable with all the information out around the net dealing with python naming conventions. Occasionally I have to remind myself on some of this stuff. The PEP8 does a good job for most of it, but I am having a bit of trouble finding some more detailed information on the trailing half of the underscores convention. The PEP8 says that one_ underscore is basically for helping fix python keyword names. OK. fair enough on that point. But what is the standards for everything else... purely coders choice?... ...or other... It would be nice if fellow pythoneers chimed in on the one or two trailing underscores convention and how the use it in their code. Ok so the situation is I have made myself a subclass of AuiManager. In AuiManager there is a method named OnLeftDClick. In my subclass I am not wanting to override(or hence copy the code into mine) to get my same named method to work as normally with event.Skip(). What I am wanting to do is just add extra functionality to the event(it doesn't matter if the event comes before or after) without stomping on(overriding) the AuiManager method. ...so what would be proper here for my method name...? one trailing underscore or two? OnLeftDClick_(self, event): or OnLeftDClick__(self, event): What is the norm for trailing underscores naming convention overall? Mostly with func/meth/class naming, but attribute explanation would be nice also. -- https://mail.python.org/mailman/listinfo/python-list
Re: trailing underscores naming convention_
On Thursday, May 8, 2014 10:24:00 PM UTC-6, Ian wrote: > On Thu, May 8, 2014 at 9:28 PM, Metallicow wrote: > > I seem to be comfortable with all the information out around the net dealing > > with python naming conventions. Occasionally I have to remind myself on some > > of this stuff. The PEP8 does a good job for most of it, but I am having a > > bit > > of trouble finding some more detailed information on the trailing half of > > the underscores convention. > > > > The PEP8 says that one_ underscore is basically for helping fix > > python keyword names. > > OK. fair enough on that point. > > > > But what is the standards for everything else... purely coders choice?... > > ...or other... > > It would be nice if fellow pythoneers chimed in on the one or two trailing > > underscores convention and how the use it in their code. > > I'm not aware of any convention for trailing underscores other than > the one described in PEP8. > > > > > Ok so the situation is I have made myself a subclass of AuiManager. > > In AuiManager there is a method named OnLeftDClick. > > In my subclass I am not wanting to override(or hence copy the code into > > mine) > > to get my same named method to work as normally with event.Skip(). > > > > What I am wanting to do is just add extra functionality to the > > event(it doesn't matter if the event comes before or after) without > > stomping on(overriding) the AuiManager method. > > If you use a different name in the subclass then whatever code calls > the method will continue to call the base class version instead of > your subclassed version. Is there a reason you don't just use super() > to chain the call to the base method? > > def OnLeftDClick(self, event): > event.Skip() > super(MyClassName, self).OnLeftDClick(event) I often see in other folks code methods/funcs/classes, etc with trailing underscores in them and and not sure if that was a convention thing or not. ...So basically you are telling me it is coders preference/naming style? I tried the super thing, but in this instance what you posted calls my method twice, which isn't desired. The renaming comes from the fact that I am only targeting this particular subclass for this event extension, otherwise I would have made a mixin out of it. But for something as simple as a standard event like this, unless the mixin could be used elsewhere, outside of this subclass, then making one is basically a waste of time overall. Anyway, my code works as expected with the _ appended on the method name. The class method is called, and event.Skip() allows my method to be called also without missing anything. I might look at toying with the super way more(it probably just needs tweaked a bit). I don't use super in the class __init__ anyway for readability and conciseness reasons BTW, just if that super coding style was an assumption. I just was not sure if there was common rules for that type of stuff. -- https://mail.python.org/mailman/listinfo/python-list
Re: trailing underscores naming convention_
I guess to be more clear here is a small code snippet that shows what is happening more readably. Hence the underscores question. class MainAuiManager(aui.AuiManager): def __init__(self, managed_window=None, agwFlags=0) aui.AuiManager.__init__(self, managed_window, agwFlags) ## self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick) self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick_) self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick__) self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick___) # etc... ## def OnLeftDClick(self, event): ## """This will override the aui.AuiManager.OnLeftDClick event method.""" ## event.Skip() ## print('OnLeftDClick') def OnLeftDClick_(self, event): """This will extend the aui.AuiManager.OnLeftDClick event method.""" event.Skip() print('OnLeftDClick_') def OnLeftDClick__(self, event): """This will extend the aui.AuiManager.OnLeftDClick event method.""" event.Skip() print('OnLeftDClick__') def OnLeftDClick___(self, event): """This will extend the aui.AuiManager.OnLeftDClick event method.""" event.Skip() print('OnLeftDClick___') -- https://mail.python.org/mailman/listinfo/python-list
Re: trailing underscores naming convention_
On Friday, May 9, 2014 3:10:26 AM UTC-6, Peter Otten wrote: > Metallicow wrote: > > > I guess to be more clear here is a small code snippet that shows what is > > happening more readably. Hence the underscores question. > > Working with multiple names with small differences is error-prone. > You should give a method a name that describes what it does rather than when > it's invoked: > > > class MainAuiManager(aui.AuiManager): > > def __init__(self, managed_window=None, agwFlags=0) > > aui.AuiManager.__init__(self, managed_window, agwFlags) > > self.Bind(wx.EVT_LEFT_DCLICK, self.EatMagicMushroom) > self.Bind(wx.EVT_LEFT_DCLICK, self.KillBlueMonster) > self.Bind(wx.EVT_LEFT_DCLICK, self.SingDitty) While readabily counts, in this case it is pretty readable already. Actions speak loader than words. In this case action(as with QT) is an event(in wxPython). My actual code would only(realisticly or sanely) extend this event once per subclass if at all... ...Unless there happens to be some crazy need for more(multiple) event methods to fire off when 1 event happens. Especially for a class bound intended for a top level window such as a frame or dialog. Anyway, the small snippet just shows that this can be done, but the actual question you replied to you left unanswered. It is about the trailing underscores. Now would KillBlueMonsterA vs KillBlueMonsterB vs KillBlueMonster_ be any more descriptive than OnLeftDClick_ which describes the event happening itself and the code that extends it by 1, in this case the call order. I could see the underscore as an extension thereof. ...so maybe OnLeftDClick_Extension_Description_ might be better... but why the trailing underscores? Maybe others that do this normally can chime in as to why they for example would put the underscores on the end, if it isn't a common convention. Maybe it is like I see it, as an extextion of some special meaning or reason therof, but isn't always obvious as most like the name not only desciptive, but short also. -- https://mail.python.org/mailman/listinfo/python-list
Re: PEP8 79 char max
Well as for my opinion, it is more closer to the truth than others because... Experience: 1. I know Python and have read the PEP8. 2. I have knowledge of/worked with the Printing Trades. 3. Grandfather owned/operated own Printshop for 40+yrs. Which I also worked in at one point. If you are still using equipment that requires 79, then chances are you have/will already gone out of business or are keeping/using said equipment for nostalgic purposes. As far as math goes. 10 is a nice round number. So multiples of 10 are prefer. 80 being my personal choice for editing. Zen says: Simple is better than complex. Use a round number. Integer math is easier than float math for the majority of the population. Time yourself, not the interpreter with these three questions: In the face of ambiguity, refuse the temptation to guess. If it helps get out the old school pen and paper. Question1: 80/8 Question2: 79/8 Question3: How many chars does you calculator(real or virtual) support? Zen says: Special cases aren't special enough to break the rules. PEP8 isn't a rule. Rules are defined by the equipment/device developers. Ask yourself... How often do you actually use these 79char devices? Of course it is understandable for something small that can fit in your pocket might have less. For Example a smartphone. Zen says: Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. PEP8 would have been better to define various numbers for realworld types of equipment/devices based on average general type of equipment/device specs. Closing Zen: If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Yep, that's my nuts and bolts on the issue. Walk into you local Printshop and ask them about this stuff. Then on your way out the door, ask for a business card and see how many chars are on that also. Beware: You might actually learn something about advertising while you are there also. :) -- https://mail.python.org/mailman/listinfo/python-list
Re: PEP8 79 char max
On Thursday, September 5, 2013 8:47:01 PM UTC-5, Terry Reedy wrote: > On 9/5/2013 6:21 PM, Metallicow wrote: > > > > > > If you are still using equipment that requires 79, then chances are you > > have/will already gone out of business or are keeping/using said equipment > > for nostalgic purposes. > > > > > > As far as math goes. 10 is a nice round number. > > > > 79 chars + 1 cursor (or \n) == 80, the nice round number. > > > > Anyway, it is just a guideline. Ignore it if you wish. > > > > -- > > Terry Jan Reedy Well, what I interpret as the PEP8 79 is chars visible minus the '\n' or '\r\n'(which would be 2; 81) line enders. This is not stated in PEP8. PEP8 needs a bit of revision anyway, In my opinion... According to real-world standards for equipment/devices. linking to a table/list of affected devices/minNumbers should be the norm. or ... from codingguidelines import PEPStandards ... or something similar(Official PEP Zen Guidelines) -- https://mail.python.org/mailman/listinfo/python-list
Re: PEP8 79 char max
On Thursday, September 5, 2013 10:40:46 PM UTC-5, Steven D'Aprano wrote: > Thanks for the comments, and welcome, but I really don't have a clue what > the relevance of most of them are. Real-world Experience. > > If you are still using equipment that requires 79, then chances are you > > have/will already gone out of business or are keeping/using said > > equipment for nostalgic purposes. > > The point is not that there is *equipment* that requires 79 characters > per line, but that *reading text* is better with a maximum line length > closer to 79 characters than (say) 140 characters. I've just randomly > picked up a magazine (less than 50 characters per line) and two books (60 > and 82 characters per line respectively). The argument I am suggesting is 79 vs 80. > The exact max line length picked is not, in and of itself, critical. PEP > > 8 could have picked 60 characters, or 72, or 77, or 82. 79 characters > (plus newline) happens to be a better choice than (say) 77 or 82 for > historical reasons: some *old* computer equipment was limited to 79 > characters (plus newline), and consequently some *new* computer software > expects the same convention to be held. I propose 80 for Zen: Simplicity. > In a sense, it's a bit like the old urban legend about the width of the > Space Shuttle booster rockets being determined by the width of ancient > Roman chariots. Haha. *Gets a Laugh* > http://www.snopes.com/history/american/gauge.asp > > While the precise details are wrong, the general claim is more or less > true for boring and unremarkable reasons. Ok. > > As far as math goes. 10 is a nice round number. So multiples of 10 are > > prefer. 80 being my personal choice for editing. > That gives you 80 visible characters plus newline = 81 characters in > total. Quick, what's 81/7? We are focusing on end-users, which might be simple minded. Simple is better than complex. > > Zen says: Simple is better than complex. Use a round number. Integer > > math is easier than float math for the majority of the population. Time > > yourself, not the interpreter with these three questions: In the face of > > ambiguity, refuse the temptation to guess. If it helps get out the old > > school pen and paper. Question1: 80/8 > > Question2: 79/8 > I don't see the point of this. Why divide by 8? What is this supposed to > demonstrate? Divide by any simple number is 0 simple enouch...? > Also, you're tossing around koans from a Zen that are irrelevant. 79 or > 80, both are equally simple. Where is the ambiguity? The reader might be > forgiven for thinking you're trying to dazzle them and pull the wool over > their eyes by tossing out references to the Zen that sound good but have > no relevance to the question being discussed. No., 79 and 80 are not equally simple. 79 is odd, and 80 is even. > > > Question3: How many chars does you calculator(real or virtual) support? > Seven. Are you suggesting that we should limit our code to a maximum of Ok. Mine displays ten. This question was to get most people off their duff and grab a piece of old-school tech. Might be solar in nature. > seven characters per line? If not, I don't see the point of your question. See above answer. > > Zen says: Special cases aren't special enough to break the rules. PEP8 > > isn't a rule. Rules are defined by the equipment/device developers. > PEP 8 certainly is a collection of rules. They are mandatory for new code > added to the standard library, and optional but recommended for third > party libraries. What are the official rules, then... None...? > > Ask yourself... How often do you actually use these 79char devices? > My brain is better at reading lines with maximum line length of 79 > characters than 140 characters. How often do I use my brain? At least > once a day. > [...] Ok. I prefer 80 remember. Simple. base 10. > > Zen says: > > Although practicality beats purity. > > Errors should never pass silently. > > Unless explicitly silenced. > And yet, a bird in the hand saves nine, and the early bird bells the cat. if python.notDefined(): cats != birds != cats > > PEP8 would have been better to define various numbers for realworld > > types of equipment/devices based on average general type of > > equipment/device specs. > No it would not. That would be silly. Well... Why Not? What do you use? > > Closing Zen: > > If the implementation is hard to explain, it's a bad idea. If the > > implementation is easy to explain, it may be a good idea. > The implementation is easy to explain: stop typing before you reach 79 > characters, and start a new line of code. I believe Guido once worked for google, why doesn't the software reflect your preferences. Ask google, or him, not me. > > Yep, that's my nuts and bolts on the issue. Walk into you local > > Printshop and ask them about this stuff. Then on your way out the door, > > ask for a business card and see how many chars are on that also. Beware: > > You might actually learn somethi
Re: PEP8 79 char max
On Thursday, September 5, 2013 11:01:31 PM UTC-5, Steven D'Aprano wrote: > And that's especially badly thought out. How is an import that occurs > when the code is *run* supposed to make a difference to the way the code > is *written*? Proofreading. Or maybe call it pre typesetting. -- https://mail.python.org/mailman/listinfo/python-list
Re: PEP8 79 char max
RailRoadTieWidth = 79.1234567890 >>> 79 = 'Width Of A Horse"s Ass' File "", line 1 SyntaxError: can't assign to literal >>>RailRoadTieWidth.attribute ("American", "Steam") >>>79.attribute = ("Roman", "Chariot") File "", line 1 79.attribute = ("Roman", "Chariot") ^ SyntaxError: invalid syntax Excuse me if this may be improper in you native language, butt... If the interpreter didn't have a sense of humor, I believe most people wouldn't use python. Most often it will return an answer, that is concise, but with a bit of flair. -- https://mail.python.org/mailman/listinfo/python-list
Re: PEP8 79 char max
On Thursday, September 5, 2013 11:01:31 PM UTC-5, Steven D'Aprano wrote: > On Thu, 05 Sep 2013 19:59:34 -0700, Metallicow wrote: > > PEP8 needs a bit of revision anyway, In my opinion... According to > > real-world standards for equipment/devices. linking to a table/list of > > affected devices/minNumbers should be the norm. or > > I don't believe you have thought this through, or in any detail. The > first problem is, what "real-world standards" are you talking about? What > sort of devices are you referring to? How is this supposed to work in > practice? If I write a Python module, which device am I supposed to pick? http://en.wikipedia.org/wiki/Revision Why even define a number? I causes people to argue about it. It is a variable. I meant a "Reference" Table of equipment/devices. Most Auto shop have a "Cross-Reference book". Also Johnny Cash built a vehicle from 30 years or so different years parts(or I know people who do/can). Reference PEP8 standard to: A Technical manual per say. If not make it simple. A multiple of 10, 80 being the closest int and also errors on 79 devices. Which then said device should be added to the reference manual. Or 70. Also the pro/cons of this argument should be added to a "Quick-Reference". Sorry if my opinion was not clear, the first time I posted. As I have been answered before, you CANNOT edit posts here. But you could with python... -- https://mail.python.org/mailman/listinfo/python-list
Re: PEP8 79 char max
Google(will) Search This Message: Industry Standards, PEP8, Whitespace, Print, Printing, Opinion' I could add more... For example: Pantone color wheel. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python GUI?
On Wednesday, September 11, 2013 3:55:59 PM UTC-5, Eamonn Rea wrote: > There are a few known GUI toolkits out there, and the main ones from what I > can tell are: > > > > Tkinter -- Simple to use, but limited > > PyQT -- You have a GUI designer, so I'm not going to count that > > PyGTK -- Gnome officially back this I think > > wxPython -- Very nice, very professional, approved by Python creator, but > alas hard to get started with > > > > So, what are your personal preferences and why? Why use X over Y? > > > > I, personally, really like wxPython, but I also really like Tkinter. I've > messed with PyGTK, but I'd choose wxPython over it. > > > > Have you got anything to say on what one I should be using(excluding PyQT > because it has a D&D designer >:( )? Is Tkinter really dead? Should I stick > with wxPython? > > > > It's might be similar to the "What language to use" argument, or the "What > background to code on" argument(I prefer darker backgrounds xD Please don't > argue about this though!), in the sense that there is *no* answer, just > preference. > I prefer wx over qt for these reasons. Robin works for qt now. *Funny isn't it...* Basically, To change qt(PySide) you need to pretty much need to be employed by qt, not the case with wx(is not a *For profit*, but you can donate.). In my opinion, in the long run(foreseeing from this point forward) wx will win, because anybody can create a popular fork. And if it is good enough, it might get accepted into the standard dist also. As far as "mature", well, the previous statement shows that he can make money doing it also and enjoy doing what he does in his spare time. I believe Guido has the privilege of spending half of his time "At work and getting paid for it." on python. And Project Phoenix(Py2/3) is still on the way. We'll revisit this question next year. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python GUI?
Sorry about that, nokia is/was. qt was developed(IIRC) for phones. Someone made money. And a lot of it. wx is a more or less a "free" project. I don't use a phone anymore. If I had a touch screen phone and was a developer, I still wouldn't use one. I have my many reasons why... -- https://mail.python.org/mailman/listinfo/python-list
Animated PNG Vs Gif: 120fr 3D Python Powered Logo
Discussion: Dear Guido and friends, Noticed this is gaining alot more support lately. http://www.kickstarter.com/projects/374397522/apngasm-foss-animated-png-tools-and-apng-standardi After testing my gif and apng Animated 3D Python Powered Logos... The difference is real obvious at first. apng wins with speed(gif is limited to say 1/10sec and apng can do at least 1/80sec) and transparency/color quality(tested on windows ATM) Mozilla based browsers, Opera, Chrome(extension), Xnview and some other popular apps have integrated rendering apng functionality so far... I wouldn't tend to think that the top browser devs were wrong in their choice. It would be nice to receive the Guido *nod of approval*... attached samples are under PSF License or your better suggestion, BDFL. Hopefully there will be a libpng implementation and pyAPNG stuff(s) worked on also soon. Attachments: Animated Python Powered Logo - 120 frames 1. gif format 2. apng format(if it doesn't animate in your browser, then apng is not supported yet) If you like what you see, then consider supporting the devs working on this and help make it a standard or start devving yourselves. @pyDEVs: Any news on this yet...? Python Samples Downloads available: Animated Python Powered Logo - 120 frames 1 gif & 1 apng samples in download. http://www.4shared.com/archive/MzoW-0Kt/AnimatedPythonPoweredLogoGifVs.html I can't seem to attach a file in this group, thus the waiting DL. Apparently, i am not qualified enough or something here(at least on this group)..., but then again if every python fanatic that posts spam here did the same, then the world would turn into eggs. Your welcome. Python is the Best! Comments, complaints, spam, eggs, etc., welcome here also. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python was designed (was Re: Multi-threading in Python vs Java)
Python is the Best! -- https://mail.python.org/mailman/listinfo/python-list
Re: Python was designed (was Re: Multi-threading in Python vs Java)
Are you suggesting Advertising is the Best language there is? # After many years, I agree not, but what to may... def If I do Something do, you not react(): IsMySyntaxNotCorrect() CanINotCorrectMyGrammaticalMistakesAndSeekAcceptance(): # The most arguable language is arguably the most important to discuss. # Everyone is of the same basic mindset here. # 16 years of reading everyone elses words hasn't changed my view. # I make it real, and sometime I don't like it either. # Actions speak loader than comments. language = python benefits = failures failures = newTerminology newTerminology = newIdeas newIdeas = benefits Sometimes when the whole world doesn't complain about your newTerminology, they are trying to say let it live, but more often they say "leave it alone". And Vise Versa. But more often they complain about the readability. Or the Indenation. Or the style of a personal poem. Or how the next person should learn it best. I read a indented book first, then I read a un indented book. Sir. go figure nowpost() -- https://mail.python.org/mailman/listinfo/python-list
Re: Animated PNG Vs Gif: 120fr 3D Python Powered Logo
Here is links to the apng/gif on ImageShack uploaded with the "Do Not Resize" option. Checked/Views fine with default Firefox/Opera browsers. Animated 3D Python Powered Logo apng - 120frames 1/60 sec http://img34.imageshack.us/img34/4717/f4l4.png gif - 120frames about 1/10sec or as fast as it can go... http://img35.imageshack.us/img35/4231/j29.gif -- https://mail.python.org/mailman/listinfo/python-list
Re: Animated PNG Vs Gif: 120fr 3D Python Powered Logo
On Tuesday, October 22, 2013 2:56:33 AM UTC-5, Ian wrote: > This is not entirely true. The minimum specifiable delay for a frame > in an animated gif (other than 0, which just means "as fast as > possible") is 0.01 second, which is the setting in the gif linked > above. However, most browsers that encounter this will automatically > increase the delay to 0.1 second. This is done for compatibility with > old versions of Netscape. According to [1], Firefox, Opera and Chrome > will accurately display delays as small as 0.02 seconds. Safari and > IE will accurately display delays as small as 0.06 seconds. > > Here is an alternate version of the above gif that displays the > animation at 50 fps in the first three browsers listed above: > http://i216.photobucket.com/albums/cc41/Peristarkawan/j29-2.gif > > And here it is at 17 fps with 2/3 of the frames removed, for the > benefit of IE and Safari: > http://i216.photobucket.com/albums/cc41/Peristarkawan/j29-6.gif > > [1] > http://nullsleep.tumblr.com/post/16524517190/animated-gif-minimum-frame-delay-browser-compatibility Thanks, I was having a bit of trouble trying to figure it out exactly myself in blender by eye-sight. Interesting Test link. When I originally rendered the animation it was transparent background, but when giffed it looked rather sick with gifs limited transparency and colors specs, so I rerendered and modded the text back into it on white which is what the other PSF logos have. After looking at Firefox's spinning fox APNG on transparent, I think I will rerender the images again with transparency for the apng, so background color can be easily changed. It seems the delays are not altered on the apngs also, which is a good thing. Maybe there is an option with the browsers to disable gif 0 delay mangling...? So What did you use to increase the speed of the gif? ...Errm Program or whatever used to mod it? I made the gif with gimp, since I find importing/exporting as layers a bit easier than using imageready. -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
Well, I'm not going to post my whole module as I get little testing on mac, but I will let you in on a little secret: Use a GUI, such as wxPython or QT or other, then create a basic fullscreen frame that is invisible and copy its DC to the clipboard. Not exactly a hack(might be edgy), but it works. Writing the gui/logic code will be up to you. here is a basic wx example f = wxFrame(None, -1) f.Show(True) f.SetTransparent(0) # Bind your hotkeys to capture the screen. Also, not sure ATM... but I recall someone wrote a cross platform screenshot implementation IIRC that replaces PIL's ImageGrab module, I think it is pyscreenshot or something similar. You might want to look into that. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python was designed (was Re: Multi-threading in Python vs Java)
On Monday, October 21, 2013 9:29:34 PM UTC-5, Steven D'Aprano wrote: > On Mon, 21 Oct 2013 01:43:52 -0700, Peter Cacioppi wrote: > > Challenge: give some examples of things which you can do in Python, but > cannot do *at all* in C, C++, C#, Java? Ummm... hmmm let me try here... string = 'Python is the Best!' if string: try: string = int(string) except Exception as exc: integer = str(integer) else: print('Typecasting Maybe...') I get more comments on "Typecasting" from those who don't know how to use a press more than anything, than I get from the typesetter. #... maybe she's ignoring me... Am I right? -- https://mail.python.org/mailman/listinfo/python-list
Re: Maintaining a backported module
On Thursday, October 24, 2013 12:09:55 AM UTC-5, Ben Finney wrote: > A useful library for this purpose is ‘six’ (as in “3 × 2”) > http://pythonhosted.org/six/>. You can use its features to do > things that are useful or better in Python 3, but which need special > implementation to work on Python 2; and the same code will just work on > both versions. +1 for stdev Steven. Thanks for the extra legs. Hope all goes well with introductions... I'm sure it will. :) Good Job. -- https://mail.python.org/mailman/listinfo/python-list
Re: Animated PNG Vs Gif: 120fr 3D Python Powered Logo
On Tuesday, October 22, 2013 4:15:05 PM UTC-5, Ian wrote: > I used a freeware called Photoscape to open the gif, change the > delays, and resave it. Thanks, I have used the program before and recall some aspects of it, but as far as gif goes I try to not deal with them much because of the headaches involved with making them. So Animation technology has advanced in general(Blender, ImageReady, GIMP), so it seems a slightly offbrand from the standards app shines though for once, for a such a thing as an outdated format. gif. Cheers. As a graphic artist myself, some free softwares you might like to try. Most are all still active. * Pixel Image Editor * TwistedBrush Open Studio * Deep Paint * MyPaint * Artweaver * AndreaMosaic * Sumo Paint Pro (Adobe Online) Anywho... Here is the official art link for the Animated Python Logo APNG. http://fav.me/d6rdza2 I'll whip up a pack of gifs when I get the time... here in a few... todo. -- https://mail.python.org/mailman/listinfo/python-list
Re: Maintaining a backported module
On Thursday, October 24, 2013 12:46:51 AM UTC-5, Metallicow wrote: > +1 for stdev Steven. Thanks for the extra legs. > Hope all goes well with introductions... I'm sure it will. > :) Good Job. Well, what I am trying to get at is whether it is better as... stddev or stdev...? 6(3standard abc) vs 5(2nonstandard abc) How many people are going to have to change their code... Is alphabetsoup ABC better than oppsImissedAspoonfull(AC)? As far as readability and standard naming conventions are concerned? -- https://mail.python.org/mailman/listinfo/python-list
Re: RELEASED: Python 2.6.9 final
On Wednesday, October 30, 2013 10:19:48 AM UTC-5, Skip Montanaro wrote: > > Thanks Barry for all the hard work. > > Ditto. Wish I still had my Guido van Rossum World Tour t-shirt! > > Skip try: BlackT() # http://www.python.org/~guido/images/IMG_2192.jpg except Exception as pocketT: EmbroiderOnPocketT(tColor=(0, 0, 0), pocketObj="PythonLogo") -- https://mail.python.org/mailman/listinfo/python-list
Re: RELEASED: Python 2.6.9 final
On Thursday, October 31, 2013 1:05:13 AM UTC-5, Metallicow wrote: > On Wednesday, October 30, 2013 10:19:48 AM UTC-5, Skip Montanaro wrote: > > > Thanks Barry for all the hard work. > > > > Ditto. Wish I still had my Guido van Rossum World Tour t-shirt! > > > > Skip > > try: > BlackT() # http://www.python.org/~guido/images/IMG_2192.jpg > except Exception as pocketT: > EmbroiderOnPocketT(tColor=(0, 0, 0), pocketObj="PythonLogo") Thanks Barry for all the help to the community. If you ever need a T-shirt or Hoodie recognising your time put in..., Consider https://github.com/Embroidermodder/Embroidermodder Python on the way?.?.? for everyone... *we'll look at 2.6 as an available supported lib branch* http://embroidermodder.github.io/news0.html Thanks again Barry for your hard work. -- https://mail.python.org/mailman/listinfo/python-list
MCOW package
I finally uploaded my wx/lib/mcow package. It has many widgets and mixins and probably more to come. It has been extensively tested on Windows and at least tested on a linux flavor. It would be nice if I could get some mac testing also. :) https://github.com/Metallicow/MCOW -- https://mail.python.org/mailman/listinfo/python-list
MCOW package
I finally uploaded my wx/lib/mcow package. It has many widgets and mixins and probably more to come. It has been extensively tested on Windows and at least tested on a linux flavor. It would be nice if I could get some mac testing also. :) https://github.com/Metallicow/MCOW -- https://mail.python.org/mailman/listinfo/python-list
Re: MCOW package
On Sunday, April 30, 2017 at 10:47:44 PM UTC-5, Steve D'Aprano wrote: > On Mon, 1 May 2017 01:01 pm, Metallicow wrote: > > > I finally uploaded my wx/lib/mcow package. > > It has many widgets and mixins and probably more to come. > > Congratulations! What does it do? > > > > > -- > Steve > Emoji: a small, fuzzy, indistinct picture used to replace a clear and > perfectly comprehensible word. It is a wx/lib/mcow package of widgets and mixins for wxPython. ShapedBitmapButtons/ThreeWaySplitter/Animations/SmartHighlighting/etc... -- https://mail.python.org/mailman/listinfo/python-list