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 4 years ago.
Improve this question
What datastructures should a junior python developer study first?
UPDATE:
I mean common datastructures, not python list, dict and tuple...
The best reference for learning python is the python standard library itself. As for data structures, if you want to go deeper than the standard python type, you can study the collections module. Have a look at the docs and see how it is implemented.
For instance with IPython, you can access the documentation of any object or module by appending "?" and the code by appending "??" (without the quotes).
To go beyond the standard library you can explore PyPI which is the Python package Index, a repository of community contributed Python modules.
Pick packages with high weights and not marked alpha if possible.
For instance, on data structures you have :
http://pypi.python.org/pypi/data-structures/0.1.2
http://pypi.python.org/pypi/structures/0.5
I think that looking at real code is the best to learn real programming.
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 7 months ago.
Improve this question
I'm Working on a program that takes in text from the user and then implements functionalities in the backend, kind of like an interpreter, I have the parser working amazingly in python but some of the backend capabilities I feel would do great on c. I have looked into CPython but I don't seem to understand how to do it if it's even possible at all. I'm just a beginner, if someone could guide that will be very helpful.
CPython is just an implementation of Python in the C programming language. If you want to incorporate C code, you can write extension modules documented here.
Check out this StackOverflow post as well.
Alternatively, write a C program, compile it, and then call it via the subprocess module documented here.
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 5 years ago.
Improve this question
I never went too far into NetLogo, and being a novice in Python I started looking into the turtle module, aiming towards ABM. I have seen some simple implementations of the turtle module (turtledemo and YouTube) but none were comparable to NetLogo library's examples. I went over (once) the mesa tutorials and it seemed interesting but, as it says, more advanced stuff require Javascript. I've also read that NetLogo is fast to pick up.
Considering the above, and adding your own experience, could NetLogo be a better choice than Python? Could you estimate how hard each path would be? Do you have any other suggestions?
I teach ABM. I used to use Python for my course,
using a module that provides some NetLogo-like functionality:
https://raw.githubusercontent.com/alan-isaac/econpy/master/abm/gridworld/gridworld.py
I gave that up. Although Python is a great language for
teaching programming, NetLogo is a much better language for
teaching ABM. (Both started out as teaching languages,
very roughly speaking, and became much more.) It is very
easy to get started with NetLogo. It's builtin facilities
also support very sophisticated model building. These facilities
can be extended when needed.
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 would be greatfull if you could tell me how one can translate a code from Java to python.
Should one do it manually ? is there any tool to convert it automatically?
If you want to translate java code to python you have to translate it manually. Automatic conversion generally does not have the appropriate quality. It looks like there are some tools out e.g. java2python but the author states
The generated Python code is not guaranteed to run, nor is guaranteed to be syntactically valid Python.
Converting a library to another programming language is never an easy task.
If you simply want to use a java library in a application that you want to write in python you could give jython a try.
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 9 years ago.
Improve this question
I want to turn an existing python-based implementation (a data analysis tool on a stream of events) into a storm topology.
During the research phase my team and I used python pandas a lot to develop a prototype of our tool and found it to be very helpful in terms of programmer productivity. Now we want to create a storm topology that does the same thing and aim to reuse our existing python modules as bolts or at least make an informed decision about whether it is a good idea performance-wise to do so.
Any restrictions on using a python script depending on external libs as a Storm Bolt on a cluster? Also, does anybody have a feeling for what the performance penalty will be for using an interpreted and non-JVM language like Python instead of Java for our bolts? The pandas library itself is designed with high-performance in mind.
Thanks
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 5 years ago.
Improve this question
I have a huge C file (~100k lines) which I need to be able to parse. Mainly I need to be able to get details about individual fields of every structure (like field name and type for every field in the structure) from its definition. Is there a good(open source, which i can use in my code) way to do this already? Or should I write my own parser for this. If I have to write my own, can anyone suggest a good place to start? I have never worked with python before.
Thanks
Take a look at this link for an extensive list of parsing tools available for Python. Specifically, for parsing c code, try the pycparser
The right way to do this is almost certainly to interface with the front-end of an existing compiler, such as gcc, then work with the intermediate representation, rather than attempting to create your own parser, in any language.
However, pycparser, as suggested by Dhara might well be a good substitute, and definitely better than any attempt to roll your own.