Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Feral Integral
Jun 6, 2006

YOSPOS

Sylink posted:

I want to make a log viewer in python that will tail logs from various linux servers, I think I can handle the tailing part easily enough. But I would like to have it in GUI form.

I've seen some software made in PyQT that runs nicely but the QT Designer is totally weird to me. It only generates a template and doesn't let you make the code that actually does things within it, which is super annoying compared to using something more akin to Visual Studio.

Is there anything like the Visual Studio way of doing things in Python? I'm not deadset on Qt or anything.

I'd recommend either Glade or wxFormBuilder. Both are pretty similar in functionality, although I would say wxformbuilder is overall a bit more intuitive for someone used to Visual Studio-type GUI building.

Here's a screenshot of a GUI I made for work that utilizes the skype API to automatically add contacts for accounts (since skype is a pain in the rear end and for some reason doesn't include this feature in their business account manager thing, wtf?):



Hopefully the "object tree" structure in that image will give you a head start on how you can layout the GUI. Just remember that the first thing you have to start off with is a frame to place objects in, and you'll need at least one sizer to layout the elements of your GUI. If you check out the tabs at the bottom, you'll see that the builder automatically generates the python code you need, and alls you have to do is then import it like so:



Easy as py! :v:

Feral Integral fucked around with this message at 18:36 on Feb 19, 2013

Adbot
ADBOT LOVES YOU

Feral Integral
Jun 6, 2006

YOSPOS

I'm writing a bunch of tests at work, and I'll need to compile a small table documenting my tests. I figured it would be easiest just to document my tests in the docstring of each test, but what do you guys think the best method of pulling these out would be? I haven't used it before, but sphinx seems like it would be a good candidate. Looking at the documentation, it seems like this should be easy enough to pull off but I'm kinda lost with how to start. How do I go about creating a simple page that will have a table populated by particular items from my docstring?

Feral Integral
Jun 6, 2006

YOSPOS

Hey I'm messing around with some twisted perspective broker examples and I've come to a point where I have 3 basic pbs - one "client", one "server", and one "resource server". The "server" makes async remote calls on the resource server for itself and on behalf of the client. In this kind of situation, should I be doing a reactor.connectTCP("localhost", 8801, self.factory) type thing only once during construction of the pb object or am i supposed to be just throwing that poo poo around nilly willy (like anytime a remote method is called)?

Feral Integral
Jun 6, 2006

YOSPOS

Hey quick ipdb question: is there a way to load from a python file while in the debugger? In my case I've ipdb.set_trace()'d into my app, but now I want to load some utilty functions into the namespace. If I was in the interpreter I would just use %run or %load. What's the best way to do this?

Feral Integral
Jun 6, 2006

YOSPOS

Thermopyle posted:

I've never really investigated this, I just do something like:

Python code:
if error:
    import my_utilities
    ipdb.set_trace()

Oh, that seems...obvious. Haha thanks!

Feral Integral
Jun 6, 2006

YOSPOS

So I'm working on a project that is going to soon require me to run long-running calculation jobs which are all viewed/edited/created through a django site. Whatever is going to run the jobs will ideally be able to run multiple jobs at a time without blocking other jobs, as well as be able to give status info about running jobs when asked for it.

Is there a good python framework with lots of included bells and whistles for this kind of thing anyone might recommend, or any suggestions from people that have tackled something similar?

edit: http://python-rq.org/docs/workers/ looks p cool

Feral Integral fucked around with this message at 17:19 on Jun 6, 2016

Feral Integral
Jun 6, 2006

YOSPOS

Can somebody tell me what I'm doing wrong with this simple re?

code:
asdf = re.findall(r'^.*\[(.*)\].*$', 'asdfas[asdhfjksdaf]asdfas[sadcgfdsfg]asdfasdf')
I keep getting only the first match ['sadcgfdsfg'], rather than what I expect: ['asdhfjksdaf', 'sadcgfdsfg']

Edit:
@LochNessMonster: yep typo, fixed that

@Symbolic Butt: that did the trick, thanks!

Feral Integral fucked around with this message at 19:55 on Dec 7, 2016

Feral Integral
Jun 6, 2006

YOSPOS

Baby Babbeh posted:

I use .format() probably way more than I should, so I'm pretty hyped for f-strings. Can't wait to write the lovely, un-maintainable code ya'll are talking about.

Is the f-string thing just a shorthand for .format()?

Adbot
ADBOT LOVES YOU

Feral Integral
Jun 6, 2006

YOSPOS

poo poo wrong thread n/m

  • Locked thread