Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am a python beginner and I am a little experienced in OO-programming in Java and PHP and also fucntional programming in R . Thus, my question is considering the general usage of python scripts in everyday use-cases.
I want to "learn" how to think/approach a problem that I do experience when facing a situation with my software where a "script" could help me out or improve something.
For instance, I've heard friends talking about their self-made python scripts to evenly mute the audio of movies to avoid loud outliers in explosive scenes, etc. Another example, in my case righ tnow, is to filter out certain pictures with no GPS-time meta information for the timezone in order to sort these fotos in accordance with the others.
I really want to get the essence and recipe based on the aforementioned examples to better integrate Python in my everyday life and get an intuitive feeling for it. (i.e. how would a simple script look like that takes a picture, filters out its meta data, and does something -> where do I have to run the script so I can call the function with these .JPG files as its arguments?).
I would also be glad if some of you could recommend some practical tutorials or literature.
Thank you in advance :)
P.S. I know it is not a concrete question but rather it is intended to get a glimpse on a wide field of usage and thinking - but I want to get this essential take away that motivates me and shows me the direction.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
For background, I am somewhat of a self-taught Python developer with only some formal training with a few CS courses in school.
In my job right now, I am working on a Python program that will automatically parse information from a very large text file (thousands of lines) that's a output result of a simulation software. I would like to be doing test driven development (TDD) but I am having a hard time understanding how to write proper unit tests.
My trouble is, the output of some of my functions (units) are massive data structures that are parsed versions of the text file. I could go through and create those outputs manually and then test but it would take a lot of time. The whole point of a parser is to save time and create structured outputs. Only testing I've been doing so far is trial and error manually which is also cumbersome.
So my question is, are there more intuitive ways to create tests for parsers?
Thank you in advance for any help!
Usually parsers are tested using a regression testing system. You create sample input sets and verify that the output is correct. Then you put the input and output in libraries. Each time you modify the code, you run the regression test system over the library to see if anything changes.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a general question concerning "publishing" python code and referencing it later in my own PhD thesis. I hope someone can provide helpful thoughts about it.
My plan:
During my PhD time I have written several code snippets for time-frequency analysis. These are not large code projects, but snippets that provide functionalities, which are not included in the general scipy.signal package. In approximately 6 month I will hand in the thesis, so now I am thinking about what stuff to include in the thesis. If I include these snippets in my thesis I somehow thought it would be "cooler" to have them already "published" in any form instead of just putting the code in the appendix of the thesis. By doing so I might be able to write something like this in my thesis: The code for analysing the data_x_y is also available at ...
I would like to find the easiest way to accomplish this.
Thanks for any comments!
Publish the code on Github. You can optionally create a Python package, and publish that to PyPI.
Once it's on GitHub, you can get a free DOI for it using Zenodo. This will create a permanent record (including source code), and makes your code easily citable (both by yourself and others).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I was very impressed by the policy based design described in Modern C++ Design by Andrei Alexandrescu and tried it successfully in some light weight programs. Now I have to write a real world system in Python and I think that approach would be very useful here. However, I can't find a single example of this approach in Python. Is it not recommended in Python or are there better alternatives? Can someone point me to an example of policy based design in Python? My aim is to develop an auctioning system and I want to be able to choose the auction strategy - English, Dutch, Silent, etc - at run time.
Since Python and Ruby are so similar, I guess an example in Ruby will also do.
My aim is to develop an auctioning system and I want to be able to choose the auction strategy - English, Dutch, Silent, etc - at run time.
You could just use strategy pattern (also known as the policy pattern) to accomplish exactly this.
You could also use mixins to provide the strategy instead of composition.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have spent the last six months learning python as a way to automate my working environment. So far I have automated data extraction and report downloading from various web-based sources through the use of webcrawlers, interacted with excel files, created visual representations of data through matplotlib, and removed almost all the monotony from bank reconciliation.
I now come to a new task which takes up a large amount of my daily workload. We use an accounts program called Sage 50 Accounts. I effectively want to begin to learn how to manipulate the data contained within this program so that my daily thought patterns can be put into Python code.
Because this hasn't been done, there's no pre-made API. So my question is:
When wishing to interact with a new program through Python, how does a programmer begin such an inquiry?
Please accept that this question is only vague and general because I'm incredibly new to such a task.
SData is Sage's general data access API layer and should suit your purposes.
Otherwise you might need to invest in or obtain a Sage Development SDK.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Want to write a typing test application (GUI, windows). Is simple terms. app shows text, user types text, user gets typing speed result. Example of an online one
Is python an ok language to use with such a project? Note that some people can type upto 200 word/minute . thats a lot of keys per second. Can python keep up? I ask this coz I have heard that python being interpreted in somewhat slower than C++
and I have always wanted to learn (go beyond the getting started tutorial) python, so if performance isn't an issue I would go with python.
If python isn't suitable, kindly suggest some other language. I am kind of ok in php and know a bit of C#. C I am not good at.
Thanks
Allow me to state this rather into the blue: Python is well up to the task of handling 200 words / minute input. Plus it's a nice language for rapid prototyping.
In short, yes, python is an acceptable choice. The application you are creating does not appear to be doing anything incredibly intensive, and even if it was, that doesn't mean python would be a poor choice. It is used in tons of reliable apps with great performance.