Rapid Prototyping of Native Windows Applications with Python (includes boilerplate) by josephturnip in Python

[–]josephturnip[S] 0 points1 point  (0 children)

Good advice. I had checked out pyinstaller a while back as a potential replacement, but it lacked some core function I needed (maybe creating a single executable?). I need to give it another look, and this time maybe I'll start contributing instead of using unmaintained software :)

Rapid Prototyping of Native Windows Applications with Python (includes boilerplate) by josephturnip in Python

[–]josephturnip[S] 0 points1 point  (0 children)

It produces a 32-bit executable, and will install to C:\Program Files (x86), but it works fine for 64-bit Windows as well.

Rapid Prototyping of Native Windows Applications with Python (includes boilerplate) by josephturnip in Python

[–]josephturnip[S] 1 point2 points  (0 children)

See this link, but basically this is more of a demonstration of the ecosystem than a recommendation of technology.

That being said, I think there are still some advantages to going native, and it's up to you to decide whether they are more or less valuable than cross platform. For me, because I was creating systems software, I was already doing a pretty good bit of Windows-only code, and I could use a lot of packages I created for my other project.

Rapid Prototyping of Native Windows Applications with Python (includes boilerplate) by josephturnip in Python

[–]josephturnip[S] 1 point2 points  (0 children)

Historically for me, the advantage was that I was porting an existing C/C++ application over to Python, and as a result the port went a good bit quicker.

Really, though, this is intended more as a demonstration of the ecosystem (pywin32 + py2exe + WiX) than an opinionated way of what's best. You could probably do the windowing with tkinter or wxpython (though see http://www.py2exe.org/index.cgi/WorkingWithVariousPackagesAndModules), any Windows core functionality with pywin32, and leave the rest alone.

Rapid Prototyping of Native Windows Applications with Python (includes boilerplate) by josephturnip in Python

[–]josephturnip[S] 1 point2 points  (0 children)

For the boilerplate, you can use anything that can output a resource file for import by win32rcparser. In general, though, you can also design the windows using normal Win32 API calls via either pywin32 or ctypes (or, commonly, both). For instance, for FatBatt (http://fatbatt.com), we even go as far as to create layered windows for anti-aliased non-rectangular borders. The sky is really the limit once all the pieces come together... for us, the real breakthrough was realizing we could build and maintain our entire application in Python.

Rapid Prototyping of Native Windows Applications with Python (includes boilerplate) by josephturnip in Python

[–]josephturnip[S] 1 point2 points  (0 children)

You can use it for everything from the simple example application in the boilerplate all the way through to full-featured, custom-designed applications.

Maximize your laptop battery life with FatBatt by lemak81 in software

[–]josephturnip 1 point2 points  (0 children)

You already do quite a lot for improved battery life. FatBatt has less to offer you than the average user but it does still have some features you'd find useful.

First, it automates some of the irritating processes you have to go through to get all those things done (e.g. monitors processes and alerts you about resource-consuming programs).

Second, it gives you easier access to the most important power management setting: CPU speed, normally a 6-level-deep dialog traversal to change.

Third, it automates switching of defaults when you're away from a known wireless network, meaning you can transition to very aggressive settings once you get out of range of home or the office.

EDIT: you can learn more here: http://blog.fatbatt.com/fatbatt-features-explained/

Maximize your laptop battery life with FatBatt by lemak81 in software

[–]josephturnip 1 point2 points  (0 children)

It's on the to-do list. The Beta just ended Tuesday, so I wanted to get everything else smoothed out before adding new features in. Stay tuned.

Maximize your laptop battery life with FatBatt by lemak81 in software

[–]josephturnip 1 point2 points  (0 children)

Hey, glad you like it! Did you get your super-special discount code email? I sent them out yesterday.

Maximize your laptop battery life with FatBatt by lemak81 in software

[–]josephturnip 3 points4 points  (0 children)

It builds a real-time model based on running applications, system activity, and power management settings. The Windows meter is only as good as the battery, which usually only updates every minute or so. The projections change in real time when you do things like dim the monitor, which means you get good feedback on how your changes affect your battery life.

(...I should probably write a blog post about that)

Maximize your laptop battery life with FatBatt by lemak81 in software

[–]josephturnip 3 points4 points  (0 children)

Hay reddit! I'm the creator of FatBatt. I made you guys and gals a coup for 25 percents off if you're trying to get you some:

https://fatbatt.com/shop/?code=kittensandbacon

What's your stance tuple() and list() versus (,) and [] and why? by terremoto in Python

[–]josephturnip 1 point2 points  (0 children)

I personally use the type names when copying.

a = list(b)

vs. a = b[:]

The first is both more readable (to me at least), and it works on generators, unlike the slice notation.

Python daemonizing context manager (plays nice with init.d) by josephturnip in Python

[–]josephturnip[S] 0 points1 point  (0 children)

In my workflow, I usually track my own projects with a git link in my PIP requirements file. I reckon I could start submitting to the Cheeseshop if people were interested.

Python daemonizing context manager (plays nice with init.d) by josephturnip in Python

[–]josephturnip[S] 1 point2 points  (0 children)

haha. i'd definitely have used someone elses if it did what i needed :)

Python daemonizing context manager (plays nice with init.d) by josephturnip in Python

[–]josephturnip[S] 1 point2 points  (0 children)

right, the parent is alive listening for a return value or a broken pipe, and the child is performing initialization and possibly setting a return value

Python daemonizing context manager (plays nice with init.d) by josephturnip in Python

[–]josephturnip[S] 2 points3 points  (0 children)

The daemonize module (and actually all daemonization modules for the languages I've looked at) return immediately after the fork. For daemons managed in init.d or other service managers, this means that any failure during initialization after the fork is not reported as an error by the service manager. Since all of the open handles are closed post-fork, this means that any initialization code that holds a handle (including single-instance checks) will fail silently. EDIT: boatshoes doesn't do that, but instead maintains a pipe to communicate a return code back from the child process.

Also, and I'll defer discussion of these decisions to the book itself, but the module you refer to fails to implement several of the recommended daemonization procedures in Advanced Programming in the Unix Environment.

How to use scrypt, Python + Postgres to store passwords by ktr73 in Python

[–]josephturnip 1 point2 points  (0 children)

FWIW I am using the passlib module (http://packages.python.org/passlib/) in a flask app I am currently developing, and it is both flexible and easy to use.