Re: How do *you* use Python in non-GUI work?
On Sun, 18 May 2008 18:20:22 -0400, John Salerno [EMAIL PROTECTED] 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! :) 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 -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On May 18, 7:25 pm, John Salerno [EMAIL PROTECTED] wrote: On Sun, 18 May 2008 16:17:55 -0700 (PDT) Mensanator [EMAIL PROTECTED] wrote: I see no need for GUI in any of these applications. Yeah, I try to find little projects to write in Python that don't involve a GUI. It's quicker, for one thing, and I also find that there is much more of a focus on the actual problem rather than wasting time trying to get a button positioned just right. :) Even back when I was using Windows 3.1 and 95, I enjoyed doing stuff in DOS because it made me feel like I was actually getting work done. :) I do mostly Internet protocol server/proxy-side applications. One of the fun things about those kinds of programs is that you get away from the whole user interface design concept, because you normally don't have to do any kind of user interface (neither command-line-based, GUI- based, web-based, nor anything), since you're not designing something to serve an end user, but to work as a lonely daemon and serve some kind of Internet service. So I think that'd be a good alternative for you. 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. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On May 19, 12:20 am, John Salerno [EMAIL PROTECTED] 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. - Programs creating C and VHDL source files - Scipy scripts generating charts Jan Wicijowski -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
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.50121034 t1=18.50121034 title=/ label t=24.34844390 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.50121034 t1=18.50121034 title=There are nine million bicycles in Beijing,/ label t=24.34844390 t1=24.34844390 title=Thatapos;s a fact,/ label t=27.12436227 t1=27.12436227 title=Itapos;s a thing we canapos;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. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On May 18, 5:20 pm, John Salerno [EMAIL PROTECTED] 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. Most of my non-GUI stuff is login scripts and registry editing. I also have some scripts that can install various programs silently, such as Adobe Reader or Firefox. This is for work purposes as we have a specific set of applications that need to be installed on each machine. Mike -- http://mail.python.org/mailman/listinfo/python-list
Re: 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! :) web apps, command line utilities, and of course libraries. Wow, really? I would have never guessed that anyone is doing command line utilities and libraries as examples of projects that don't need a GUI. Just kidding :) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On Sun, May 18, 2008 at 6:20 PM, John Salerno [EMAIL PROTECTED] 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 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. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On Sun, 18 May 2008 23:08:11 -0700 (PDT) [EMAIL PROTECTED] 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! :) -- http://mail.python.org/mailman/listinfo/python-list
Re: 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! :) web apps manage/format/write cv convert jpg to gif start/stop/manage parallel runs on a PC cluster etc :) Actually, I've never written anything with a GUI (unless you count web apps). Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On May 18, 5:20�pm, John Salerno [EMAIL PROTECTED] 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. Odd, I've been using Python since ver 2.2 and I've NEVER needed a GUI. I do things like (looking at the last 6 months of my Python directory): - how to scrape movie receipt data from IMDB and insert them into an MS-Access database - how to scrape .jpgs from a web page (simple file transfer, no display needed) - how to do a Cartesian Product in SQLlite3 - how to creat a polynomial from a sequence of numbers using Newton's Forward Differences method - how to calculate the date of Easter - how to construct arbitrary length cycles in the Collatz Conjecture - how to find the Ultimate Cycle (also in Collatz Conjecture) - efficient cycle detection comparing Brent's and Sedgewick's cycle detection algorithms - finding the cycles of 3n+C systems - partioning W marbles into D ordered bins with the constraint that each bin contain a minimum of 1 - partioning W marbles into D ordered bins with the constraint that each bin contain a minimum of 1 and that no bin exceeds M - a Python Cartesian Product that in addition to Permutaions with Replacement, also gives the subsets Permutations without Replacement, Combinations with Replacement and Combinations without Replacement - demonstrating the fallacy of Peter Scorer's proof of the Collatz Conjecture - demonstrating the fallacy of Alan Tyte's proof of the Collatz Conjecture - demonstrating the fallacy of Ken Conrow's proof of the Collatz Conjecture - how to identify which members of the infinite solutions to a given Sequnce Vector of a 3n+C system are located on the trivial graph component - developing a novel factoring algorithm based on the Collatz Conjecture I see no need for GUI in any of these applications. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On May 19, 12:20 am, John Salerno [EMAIL PROTECTED] 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! :) 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). Today, it is expected that programs should have a GUI. The majority do not even know how to use a program that does not have one. As a result, programs have become poorer at interacting with other, and become bloated and grown monolithic. Today's programs are monolithic beasts spanning tens or hundreds of megabytes, where the bulk of the code duplicates functionality found in every other program. I prefer that a program has no GUI if it does not need user interaction beyond what can be easily accomplished from the command line. Sometimes I think gui becomes overwhelming, and obfuscates the real functionality in the program. When I write program's for others people, a GUI is usually expected. But when I get requests for adding new functionality to such a program, it tends to be for unimportant GUI stuff rather than real functionality to the program. 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. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On Sun, 18 May 2008 16:17:55 -0700 (PDT) Mensanator [EMAIL PROTECTED] wrote: I see no need for GUI in any of these applications. Yeah, I try to find little projects to write in Python that don't involve a GUI. It's quicker, for one thing, and I also find that there is much more of a focus on the actual problem rather than wasting time trying to get a button positioned just right. :) Even back when I was using Windows 3.1 and 95, I enjoyed doing stuff in DOS because it made me feel like I was actually getting work done. :) -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On May 18, 7:25�pm, John Salerno [EMAIL PROTECTED] wrote: On Sun, 18 May 2008 16:17:55 -0700 (PDT) Mensanator [EMAIL PROTECTED] wrote: I see no need for GUI in any of these applications. Yeah, I try to find little projects to write in Python that don't involve a GUI. It's quicker, for one thing, and I also find that there is much more of a focus on the actual problem rather than wasting time trying to get a button positioned just right. :) Even back when I was using Windows 3.1 and 95, I enjoyed doing stuff in DOS because it made me feel like I was actually getting work done. :) I see Python as the successor to Turbo Pascal - the DOS version before Borland fucked it up by making it a GUI IDE. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On May 19, 6:20 am, John Salerno [EMAIL PROTECTED] 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. Hi I work fulltime developing in python and have done so for more than 5 years now, and I would say 99.8% of the time I have not built anything with a GUI (Unless you consider a web page as a GUI ;-) Much of my work is web based (zope backend stuff), test frameworks for windows build environments that need to compare the output of 1000's of images from rendering pipelines. Lots of data integration and manipulation utilities as part of processing pipelines. All sorts of stuff that just doesn't use a GUI. T -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
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. - web server/blog/wiki. This doesn't have a gui if you don't consider HTML pages a gui - various scripts to help me during software deployment and testing (for instance log file analyzers, automated web clients) - network communications library that tries hard to just get out of your way ;-) - file processing scripts to do more sophisticated stuff than basic search/replace - most recent script is a little tool that downloads the latest version of some World-Of-Warcraft addon, extracts it to the game folder after deleting the old one first, and then copies a backup to a network drive. I just doubleclick the .py file and it dumps the results in a console window that closes after a few seconds. Who needs a gui for that? Also, I often find myself opening a Python prompt to just execute simple tasks that I see other people needing big tools or even online services for: - base-64 encoding/decoding - md5/sha hashing - simple string or regular expression operations - simple math - unicode decoding/encoding - etc etc. --irmen de jong -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
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. here is some non-text stuff that I have done within the last two or three years 1. controlling and parsing thousands of label files several times per day, that are used by the factory to drive the printers that make product safety labels - code was easily approved by UL and CSA. 2. real-time control of platform in EMC lab for radiated emissions testing. 3. hi-speed data acquisition of 3 to 20 parameters during simulated abnormal operating conditions to demonstrate product compliance with product safety standards. 4. monitoring of several server logs, also sends email to me if it finds something it does not like. 5. parallel monitor/control systems for several greenhouses. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On Mon, 19 May 2008 08:20:22 +1000, John Salerno [EMAIL PROTECTED] 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 - 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 -- http://mail.python.org/mailman/listinfo/python-list
Re: How do *you* use Python in non-GUI work?
On May 19, 7:52 am, Kam-Hung Soh [EMAIL PROTECTED] wrote: On Mon, 19 May 2008 08:20:22 +1000, John Salerno [EMAIL PROTECTED] 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 - 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/ -- http://mail.python.org/mailman/listinfo/python-list