473,898 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do *you* use Python in non-GUI work?

Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This could be any little scripts you write for your own benefit, or what you do at work, if you feel like talking about that! :)

Thanks.
Jun 27 '08
19 2796
On May 19, 7:52 am, "Kam-Hung Soh" <kamhung....@gm ail.comwrote:
On Mon, 19 May 2008 08:20:22 +1000, John Salerno

<johnj...@NOSPA Mgmail.comwrote :
Hey all. Just thought I'd ask a general question for my own interest.
Every time I think of something I might do in Python, it usually
involves creating a GUI interface, so I was wondering what kind of work
you all do with Python that does *not* involve any GUI work. This could
be any little scripts you write for your own benefit, or what you do at
work, if you feel like talking about that! :)
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list

- Enhancing existing products by scripting new features.
- Interface between databases, Excel and text files.
- Convert data between flat files and XML.
- Manage files for build processes.
- Automating processes (e.g. checkout, builds, FTP).

Wish I had some reasons to make a GUI application in Python.

--
Kam-Hung Soh <a href="http://kamhungsoh.com/blog">Software Salariman</a>
I also haven't used GUI in python yet. I basically write web crawlers/
spiders in Python where GUI is not essential.

regards,
Subeen
http://love-python.blogspot.com/
Jun 27 '08 #11
John Salerno a écrit :
Hey all. Just thought I'd ask a general question for my own interest.
Every time I think of something I might do in Python, it usually
involves creating a GUI interface, so I was wondering what kind of
work you all do with Python that does *not* involve any GUI work.
This could be any little scripts you write for your own benefit, or
what you do at work, if you feel like talking about that! :)
web apps, command line utilities, and of course libraries.

Jun 27 '08 #12
On May 19, 12:20*am, John Salerno <johnj...@NOSPA Mgmail.comwrote :
Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This could be any little scripts you write for your own benefit, or what you do at work, if you feel like talking about that! :)

Thanks.
- Programs creating C and VHDL source files
- Scipy scripts generating charts

Jan Wicijowski
Jun 27 '08 #13
John Salerno wrote:
Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This could be any little scripts you write for your own benefit, or what you do at work, if you feel like talking about that! :)

Thanks.
The vast majority of my Python work is Non-GUI.

As an example, this weekend, I wrote a script to help
in making a 'Lyrics' track in an audacity file, which
is (more-or-less) an XML variety.

In audacity, I created 'markers' in the file (as
the song played) at the start of each line. The result
was 'blank' markers at the correct times:

<labeltrack name="Lyrics" numlabels="25">

<label t="18.5012103 4" t1="18.50121034 " title=""/>

<label t="24.3484439 0" t1="24.34844390 " title=""/>

<!-- Etc -->

</labeltrackl>
My Python script took a text file, and inserted the words, as well
as a title for the whole song.
<labeltrack name="Lyrics" numlabels="26">
<label t="0.25" t1="0.25" title="Katie Melua. 'Nine million
bicycles in Beijing' "/>
<label t="18.5012103 4" t1="18.50121034 " title="There are nine
million bicycles in Beijing,"/>
<label t="24.3484439 0" t1="24.34844390 " title="That&apo s;s a fact,"/>
<label t="27.1243622 7" t1="27.12436227 " title="It&apos; s a thing we
can&apos;t deny,"/>
<!-- Etc -->

</labeltrackl>
(The script used FourSuite)

You can do this in FourSuite itself, but it can be error-prone if
you miss out one.

I can this in 'Scite' a text editor which puts your input in one window,
and the output in another. Scite is a text editor that comes free with
Ruby, by the way.
Jun 27 '08 #14
On Sun, May 18, 2008 at 6:20 PM, John Salerno <jo******@nospa mgmail.comwrote :
Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This could be any little scripts you write for your own benefit, or what you do at work, if you feel like talking about that! :)

Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
I write a lot of job control and process monitoring scripts in Linux.
Stuff that forks and execs processes, and then monitors procfs and
sysfs to collect periodic data. I actually wouldn't mind doing a GUI
for it, but pretty much all of the data display I need from it I can
do by taking the data files and running them through gnuplot. (That,
and I'm too lazy to figure out how to rewrite my telemetry plotter
from Java to Python.)

I guess I also write some data conversion programs, mostly the sort of
thing where I have a bunch of data that I didn't think far enough in
advance how I needed to be able to display it, so I just write
something to convert it to where I need it. Incidentally, I used to
do that all in Java too, until other people in my research group
started making fun of me for it and also for not really knowing a
scripting language.
Jun 27 '08 #15
John Salerno wrote:
Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This could be any little scripts you write for your own benefit, or what you do at work, if you feel like talking about that! :)

Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
If I look at the answers and
if I skip the web designs, which in my opinion are almost pure GUI ;-) ,
it would be interesting to know,
which of the mentioned applications of non-GUI programs
are used by others than the programmer him/herself.

cheers,
Stef
Jun 27 '08 #16
sturlamolden wrote:
Back in the 'old days' of Unix, programs tended not to be small, could
only do one thing, and did it well. They had no gui, and all
interaction came from command line options. The programs were invoked
from the command line, and input and output were piped from one
program to another (input on stdin, output on stdout).
And of course Python is perfect in this area. A great example is found
here:
<snip>
To answer your question: I only add GUIs when I have to. But because
it seems that people are becoming computer illiterate, incapable of
using a keyboard, and only comfortable with a certain point-and-click
input device, it tends to be most of the time now.
Python is excellent for gluing together components with a GUI. This
preserves the modularity, diversity, functionality, and the ability to
strings things together, but allows a nice easy way to interact with it.
A great example is a GUI to drive ffmpeg or any number of transcoding
pipelines. Command line switches are powerful but confusion, and well
beyond my memory. Yet I prefer transcoders to work this way because I
can string them together in different ways. Using wxPython or GTK or
PyQT is ideal for bringing these tools together in a useful way. The
perfect example of how a GUI should function.
Jun 27 '08 #17
Michael Torrie wrote:
And of course Python is perfect in this area. A great example is found
here:
ahem, http://www.dabeaz.com/generators/Generators.pdf
Jun 27 '08 #18
On Sun, 18 May 2008 23:08:11 -0700 (PDT)
s0****@gmail.co m wrote:
Every now and then, however, I do build some interface (mostly GUI),
such as a monitor, notification mechanism, etc. But I never feel like
I'm losing focus on the actual problem; maybe because I develop the
core program first and the think about a possible and optional
interface. Maybe a good suggestion is to put the GUI stuff on another
module or package, and make interface functions or methods to handle
the needed GUI controls, so that the GUI stuff shows up as little as
possible in the core part of the program.
I certainly don't *not* like GUI programming. In fact, learning wxPython was really fun and interesting and I enjoy GUI stuff. And after learning about XRC (putting the GUI component in a separate XML file, away from the program logic) that helped me learn how to keep things separate as well. I even wrote a tutorial on how to use XRC with wxPython! :)
Jun 27 '08 #19
On Sun, 18 May 2008 18:20:22 -0400, John Salerno
<jo******@NOSPA Mgmail.comwrote :
>Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This could be any little scripts you write for your own benefit, or what you do at work, if you feel like talking about that! :)
You might get a keyboard with an Enter key, btw. Anyway:

I'm a math professor, not a programmer.
I use Python probably every day to do
all sorts of things, for example:

(i) Calculating grades. (Ok, this could be done in
Excel. But if you know Python anyway you don't need
to figure out how to do various things in Excel.
Quick: In Excel how do you take all the quiz
scores, drop the lowest _two_ of them and average
the rest? Stumps people sometimes - if you're
doing it by hand in Python it's no problem, you
just do it.)

(ii) Every semester I get a lot of emails asking
about grades. Used to be tedious typing the same
replies over and over, looking up the relevant
numbers. A littls Python script takes the student's
name, looks up the numbers and generates a reply
automatically, including a summary of the scores
and an explanation of how the grade was calculated.)

(iii) Taking various data from various places and making
it into HTML to post on the department web site.
(Please don't look - a lot of that stuff is currently
broken due to improvements on the server introduced
by other faculty. These things happen when nobody's
in charge so things get done by whoever's willing
to do them...)

(iv) Say I want to display the following system
of equations on a quiz:

3x + 2y + z = 3
x - z = 1.

Writing TeX to get the variables to line
up properly can be tedious. A little Python
thingie takes lists of variable names and
coefficients and automatically produces
TeX that displays the equations exactly right.

I could go on and on - I use computers for a lot
of things, and any time I want to do something
but it's not obvious how to do it in the relevant
big program Python gets pulled out to do the job.

A meta-example: I'm about to publish a book on
[never mind, the topic is still secret.] Python
has been incredibly useful in writing that book,
in many different ways. For example:

(v) Making modifications to the text itself. For
example, the other day I finally figured out how
to make a certain aspect of the thing look right.
So I wanted to replace every "$$[w]\qed" in the
text (where [w] denotes any amount of white space)
with "\QED$$". Took about a minute to make a Python
script to go through the entire book and make the
change.

(vi) There are a lot of figures. Some fairly
complicated, illustrating fairly complicated
mathematical things. The figures are eps files
that were generated by Python scripts. The simple
ones could just have easily been done in Adobe
Illustrator or Corel Whatever, but there's no
way you're going to use a mouse-based program
like that to draw the complicated figures and
have everything in exactly the right place.
I have Python do the calculations and then
write the corresponding eps file, done.

(vii) Many magical things were done with a
combination of TeX macros and Python scripts.
For example, index entries: If I say
\index{Some Theorem} in the text and it turns
out that that's on page 37 then
"Some Theorem p.37" appears in the index;
now if something gets revised so the
\index{Some Theorem} is now on page 38 then
the index entry is automatically revised to
page 38.

Or: The first page of Chapter n+1 is supposed
to be the smallest odd number larger than the
last page of Chapter n. A Python script typesets
("texs") each chapter; after typesetting Chapter
n it looks and sees what the last page is,
figures out what the first page of Chapter n+1
should be, and modifies the code for Chapter n+1
to start on the page before typesetting it.

If I wrote this tomorrow the list of examples
would be different. Just now over on
comp.text.tex I showed someone a Python solution
to a problem he had. I don't know if he's going
to use it - he _would_ need to learn a _little_
Python first. But it's what I'd use if _I_ wanted
to solve the problem! Other people suggested various
programs available that would solve his problem
for him - writing a little Python to give the
solution took less time than downloading one
of those programs would have.
>Thanks.
David C. Ullrich
Jun 27 '08 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1132
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 235 open ( +0) / 2637 closed ( +4) / 2872 total ( +4) Bugs : 768 open ( +1) / 4480 closed (+17) / 5248 total (+18) RFE : 152 open ( +1) / 131 closed ( +0) / 283 total ( +1) New / Reopened Patches ______________________
29
2476
by: Stephen Ferg | last post by:
I am a very satisfied user of Python and have been for number of years. I would never willing use another language. I wish all good things for Python, and that moves me to express some thoughts about Python's future prospects. I submit that the future expansion of Python usage is constrained by Python's lack of a CPAN-like facility, and I submit that without a CPyAN Python will never even get close to achieving the degree of...
134
6177
by: Joseph Garvin | last post by:
As someone who learned C first, when I came to Python everytime I read about a new feature it was like, "Whoa! I can do that?!" Slicing, dir(), getattr/setattr, the % operator, all of this was very different from C. I'm curious -- what is everyone's favorite trick from a non-python language? And -- why isn't it in Python? Here's my current candidate: So the other day I was looking at the language Lua. In Lua, you make a
0
1525
by: Adam Tomjack | last post by:
I'm trying to embed Python 2.3.5 into a C++ application on Windows XP. When I build my app with debug symbols and link to a debug build of Python, then my program seems to crash most (but not all) of the time. Sometimes it crashes on startup, and sometimes at exit, sometimes not at all. I haven't seen it crash with non-debug builds of my app and Python. The release build runs my Python test code just fine. When the debug build doesn't...
12
1833
by: eduardo.padoan | last post by:
I'm reading about "high order messages" in Ruby by Nat Pryce, and thinking if it could be util and if so, if it could be done in Python. Someone already tried? References: http://lambda-the-ultimate.org/node/view/1047 http://nat.truemesh.com/archives/000535.html http://nat.truemesh.com/archives/000537.html
8
1710
by: Simon Brunning | last post by:
I have a non-programming friend who wants to learn Python. It's been so long since I've been in her shoes that I don't feel qualified to judge the books aimed at people in her situation. I know of two such books: <http://www.freenetpages.co.uk/hp/alan.gauld/> <http://www.ibiblio.org/obp/thinkCSpy/> Any recommendations, or otherwise?
10
2243
by: Larry Hastings | last post by:
I'm an indie shareware Windows game developer. In indie shareware game development, download size is terribly important; conventional wisdom holds that--even today--your download should be 5MB or less. I'd like to use Python in my games. However, python24.dll is 1.86MB, and zips down to 877k. I can't afford to devote 1/6 of my download to just the scripting interpreter; I've got music, and textures, and my own crappy code to ship. ...
158
6508
by: Giovanni Bajo | last post by:
Hello, I just read this mail by Brett Cannon: http://mail.python.org/pipermail/python-dev/2006-October/069139.html where the "PSF infrastracture committee", after weeks of evaluation, recommends using a non open source tracker (called JIRA - never heard before of course) for Python itself. Does this smell "Bitkeeper fiasco" to anyone else than me? --
32
1663
by: Steve Holden | last post by:
I wondered if a straw poll could get some idea of readers' thoughts about when they will be migrating to 3.0 on, so I used the new widget on Blogger to add a poll for that. I'd appreciate if if you would go to http://holdenweb.blogspot.com/ and register your vote on your intended migration timescale.
2
3782
by: emallove | last post by:
I'm running into the below "No modules named _sha256" issue, with a python installed in a non-standard location. $ python Python 2.5.2 (r252:60911, May 20 2008, 09:46:50) on linux2 Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/ws/ompi-tools/lib/python2.5/md5.py", line 6, in <module>
0
9839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10854
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10946
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10480
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8034
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5876
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4295
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3303
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.