SRL Archive - General

uses or python


rj

2012-12-18 23:15:18

What uses does python have? I read its for web based stuff and if it is cba to learn it

riwu

2012-12-18 23:30:52

It can be used for automating complex tasks too. There are several modules in-built/created by other users that could be use for several things including most of what Simba can do.

Dgby714

2012-12-18 23:46:22

It is a full fledged programming language. It can basically be used to do anything..

Echo_

2012-12-25 23:27:48

Python is an interpreted language that can be used for web based projects (using Django) as well as many other types of projects. One of its main drawbacks is that it's kinda slow, so if speed is of high importance to the project your writing you may want to either write the speed-dependent pieces in C and call them from Python (using ctypes), or use a different programming language entirely.

DannyRS

2012-12-25 23:30:36

From: Echo_
Python is an interpreted language that can be used for web based projects (using Django) as well as many other types of projects. One of its main drawbacks is that it's kinda slow, so if speed is of high importance to the project your writing you may want to either write the speed-dependent pieces in C and call them from Python (using ctypes), or use a different programming language entirely.


Just out of interest, a question to everybody here, whats the "fastest" language you've used / experienced?

riwu

2012-12-26 00:04:16

From: DannyRS
Just out of interest, a question to everybody here, whats the "fastest" language you've used / experienced?

Possibly ASM? Although obviously it would be crazy to code in that for most purposes. C is probably the most feasible fastest language.

Depends on the compiler and runtime environment though.
The most important factor still lies in the programmer's ability to optimize his codes.

Echo_

2012-12-26 16:58:42

The fastest languages I've used are C and Common LISP, I've never written ASM :p

weequ

2012-12-26 19:01:17

Doesn't people who want high speed basically write the program in a language that compiles to machine code and then use assembly language to optimize parts of the machine code that are critical speedwise?

masterBB

2012-12-26 19:10:31

Yes. Also practically no one writes programs in asm. It would take too much time. In simba there is still a piece of asm, which was an attempt to speed up sqr iirc.

slacky

2013-02-13 22:57:22

From: Echo_
Python is an interpreted language that can be used for web based projects (using Django) as well as many other types of projects. One of its main drawbacks is that it's kinda slow, so if speed is of high importance to the project your writing you may want to either write the speed-dependent pieces in C and call them from Python (using ctypes), or use a different programming language entirely.

This reminds me of a quote, that went something like this: There are no bad languages, only bad algorithms.
- But ofcourse it's just another quote… :P

It's without a doubt remarkable what you can achieve with python in so few lines. When you ever need more speed you could just use a JIT-compiler (PyPy), or introduse static typing (Cython), you could also use ctypes to extend your script with C any existing libs (or write on your self). Any thies solutions will give you ~C-speed.
- PyPy is simply an Python-interpreter which will grant you speed much closer to C, it supports most of the major libs (EG: django).

CPython also has a big standard library, and a large ecosystem built around it, this will simplifiy learning, and developing a lot.

That being said… I'm currently on a old laptop from 2006, got a Core duo T-series (if I remember correctly…). The time i used to calculate PI (with a simple algo) is pretty decent:


As a matter of fact, I've written that program (IDE) (the one in the pic) in Python. I use it to make "bots" (for games (IE: RS) and what ever…) just like you guys use Simba :)

There's little you can't do in Python. I've made very good color aimbot, advanced macros using ANN or GA, realtime face- and objectrecognition algos (with the help of OpenCV)… And more so.
Many of my projects requires speed, a lot of speed… I conqure speed limitations when needed by using eather Pypy, cython or writing C-modules.

rj

2013-02-13 23:00:06

Is python similar to pascal?

slacky

2013-02-13 23:08:54

From: rjj95
Is python similar to pascal?

No it is not. It's a good glip between am two, but not to large..
'most all programming languages are similar in a way, so it's not really hard to catch any syntax if one is familiar with programming.

Here is an example of a ProjectRS06 (runescape) macro written for the program shown above (no antiban or anything "special", as it's a Private server):
Python bot, and wikipedia - this shows you the syntax, and you may cosider the similarity your self.

Recursive

2013-02-14 03:43:50

Haskell /MIPS processor

Echo_

2013-02-14 21:40:55

From: warpie
and it being (one of) the fastest interpreted languages.


WUT?
Python is slower than almost every interpreted language used today (it's faster than Ruby). There's plenty of benchmarks comparing Python's speed to other languages like Perl and Lua that prove this.

slacky

2013-02-17 09:43:09

From: Echo_
WUT?
Python is slower than almost every interpreted language used today (it's faster than Ruby). There's plenty of benchmarks comparing Python's speed to other languages like Perl and Lua that prove this.
1990 called, they want their perl-script back :P

Python got a few different interpreters, you're aiming on CPython (or any slower Py-interpreter).
- PyPy can almost grant you C-speed, and in a few cases i've seen C-speed. Just a little slower than Cython, but much simpler.
- Cython (write a python extention, still Python, but with the (alternative) to trow some types at it).. Cython will yield similar speed to C, but that's because it compiles down to C.

Even though this might cover my statement I will indeed remove it.

Echo_

2013-02-17 19:42:12

From: warpie
1990 called, they want their perl-script back :P

Python got a few different interpreters, you're aiming on CPython (or any slower Py-interpreter).
- PyPy can almost grant you C-speed, and in a few cases i've seen C-speed. Just a little slower than Cython, but much simpler.
- Cython (write a python extention, still Python, but with the (alternative) to trow some types at it).. Cython will grant you speed very close to C.

Even though this might cover my statement I will indeed remove it.


Perl may be old, but a programmer can accomplish anything done in Python with it (CPAN ;));

And I am aware of alternative Python interpreters, but they aren't the official implementation.