|
You mean after all these years of writing code this is not the correct way. There goes my career
|
|
|
|
|
Far too complex for QA, can you provide a summary?
veni bibi saltavi
|
|
|
|
|
It seems the people I've worked with summoned the dark lord Cthulu instead...
I've yet to find code that reminds me of fairy dust
|
|
|
|
|
|
Hi,
I have been looking into Python recently as it seems a lot of the jobs I am looking at require it or another scripting language for hacking out quick tests. I have never really looked or used scripting languages for anything. There seems to be a hold out for Python 2 and no brackets over Python 3 and lots of brackets. I am trying to use the serial ports in it and am finding it odd to get the serial ports I downloaded PySerial yesterday and managed to brake Python 3. Reinstalled today and it appears to know about serial ports (I can set up Baud rate, Stopbits and the like) but can't write to it. Go to various web sites such as StackOverFlow and get confused more, goto Pythons home page 404 meets me! I surrender... >
|
|
|
|
|
First, Python 2 is much more popular plus there can be add on compatibility problems with Python 3 which may be the issue.
Python 2 creates ASCII strings by default but Python 3 creates Unicode by default so use <stringname).encode("ascii").
|
|
|
|
|
Ah, like I said I am new to 'easy' coding. Does PySerial work with Python3? in your opinion which is the best CP like place for Python, I do not wish to anger the Hamsters for asking programming questions.
Thanks for that I have fiddled around and got
my_str = "hello world"
bytes = my_str.encode("ascii")
print(my_str)
It don't blow up anymore!
Cheers Glenn
|
|
|
|
|
Q&A is the general place. Also a new Python geek has just started answering them, and appears to really know what he's doing.
|
|
|
|
|
Thanks, I can ask the question in Q&A, its just that I hovered over the Quick Answers and the Discussions tab and couldn't see Python.
|
|
|
|
|
glennPattonBackInThePUB wrote: couldn't see Python. Hiding in the grass of course.
If you open a Q&A you will notice that the editor does include a code block type for Python.
|
|
|
|
|
I expect it's a good first language for newbs (as BASIC and Pascal were back in the day), but I doubt it's industrial-strength (also like BASIC and Pascal).
My current employer has recently out-sourced something and the contractors are planning on using Python.
This is a process I have already implemented in C# and one of my many concerns is how suitable Python is to the problem domain (lexxing/parsing thousands of very large text files).
|
|
|
|
|
A friend of mine is an ICT or Computer Studies teacher and is using Python and won't hear a word against it. BASIC was view as a poor language but then VB happened and it's everywhere!
|
|
|
|
|
And MIT uses it to teach the basics of programming to non-CS students who might just need to write something simple.
I have no first-hand experience with it, but what I've seen doesn't interest me.
It's probably the right tools for some things I don't do.
|
|
|
|
|
PIEBALDconsult wrote: it's industrial-strength
There are critical application out there running in VB6.0. For real.
|
|
|
|
|
That doesn't mean it's industrial strength.
|
|
|
|
|
No, it only means that anything is possible.
|
|
|
|
|
|
Hi,
Python is quite widely adopted by some certain types of industries, such as banking, trading, modeling & cloud as the preferred language because it's :
1. It's integrated deeply with the GNU/Linux ecosystem for more than 12 years now and has shipped with the 2.x interpreter. What's Powershell to Windows, python is to Linux in general. In fact the whole installation environment from disk, packet management, startup processes, virtual machine management, etc, have been written up in python.
2. Because of this python has library support for most to everything imaginable, including 3 different xml parser engines, json, regular expressions, excel, word, image formats, all database servers, etc. Most modules drop into the native library code and only expose a thin wrapper in python.
3. Because you can easily use the multiprocess module to build massive parallel task queues to process your jobs.. even across networks.
My last assignment from my employer was exactly among said lines.. We have an archive of 100GB text documents that need to be curated for proprietary add notations, converted from xml to.. csv based on specified tags and shipped to the client in excel format.
It took me 2 hours to crank a python script, test and parallelize, and about 40 hours to gallop through the content and transform it.
|
|
|
|
|
I've been learning Python on the RPi and it's pretty awesome.
New version: WinHeist Version Everyone you will ever meet knows something you don't. -Bill Nye-
|
|
|
|
|
Must admit RPi is how I got into it. It seems like the RPi does have certain things install in Python that Windows goes "huh?" to...
|
|
|
|
|
I installed PyCharm on windows but didn't use it much before getting my Pi so don't know much about it, but am not surprised.
New version: WinHeist Version Everyone you will ever meet knows something you don't. -Bill Nye-
|
|
|
|
|
Syntactic whitespace is an abomination that should've been buried when language design progressed beyond the first generation (eg COBOL or FORTRAN).
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Hear! Hear!
And enforcing code formatting style went out with pocket protectors.
|
|
|
|
|
Are you saying pocket protectors are out of fashion? Why wasn't I told?
veni bibi saltavi
|
|
|
|
|
Except for banging out scripts, I'm not really enamored with any interpreted language, and in particular duck-typed interpreted languages like Python or Ruby (to the point where I'm deleting Ruby from my resume, even if it leaves holes, because I am so sick of Indian recruiters calling me to see if I'm available for RoR work.)
Technically, Python is a "strong typed dynamic" language, in that a variable retains its type until you reassign the variable to a different type. Still, doesn't float my boat.
Where I work, some hotshot came waltzing in and implemented the server using Django, which is written in Python. Well, whatever, I guess. Wouldn't have been my choice.
Marc
|
|
|
|