Re: Help with choosing between Python VS. PureBasic

I would like to point out that SoundRTS was written in Python, so post 14's statement is not true.
I even have proof:

# from soundrts/SoundRTS/clientmain.py:
from lib import log
from version import VERSION_FOR_BUG_REPORTS
from paths import CLIENT_LOG_PATH
log.set_version(VERSION_FOR_BUG_REPORTS)
log.add_secure_file_handler(CLIENT_LOG_PATH, "w")
log.add_http_handler("http://jlpo.free.fr/soundrts/metaserver")
log.add_console_handler()

import locale
try:
    locale.setlocale(locale.LC_ALL, '')
except:
    from lib.log import warning
    warning("couldn't set locale")

import os
import pickle
import sys
import time
import urllib

from clientmedia import voice, init_media, close_media
from clientmenu import Menu, input_string, END_LOOP
from clientserver import connect_and_play, start_server_and_connect
from clientversion import revision_checker
import config
from constants import MAIN_METASERVER_URL
from definitions import style
from game import TrainingGame, ReplayGame, reload_all
from lib.log import exception
from multimaps import worlds_multi
from msgs import nb2msg
from package import get_packages, get_all_packages_paths
from paths import REPLAYS_PATH, SAVE_PATH
import res
from singlemaps import campaigns
import stats
from version import compatibility_version


_ds = open("cfg/default_servers.txt").readlines()
_ds = [_x.split() for _x in _ds]
DEFAULT_SERVERS = [" ".join(["0"] + _x[:1] + [compatibility_version()] + _x[1:]) for _x in _ds]
SERVERS_LIST_HEADER = "SERVERS_LIST"
SERVERS_LIST_URL = MAIN_METASERVER_URL + "servers.php?header=%s&include_ports=1" % SERVERS_LIST_HEADER


class Application(object):

    def choose_server_ip_in_a_list(self):
        servers_list = None
        try:
            f = urllib.urlopen(SERVERS_LIST_URL)
            if f.read(len(SERVERS_LIST_HEADER)) == SERVERS_LIST_HEADER:
                servers_list = f.readlines()
        except:
            pass
        if servers_list is None:
            voice.alert([1029]) # hostile sound
            warning("couldn't get the servers list from the metaserver"
                    " => using the default servers list")
            servers_list = DEFAULT_SERVERS
        nb = 0
        menu = Menu()
        for s in servers_list:
            try:
                ip, version, login, port = s.split()[1:]
                # ignore the first parameter (time)
            except:
                warning("line not recognized from the metaserver: %s", s)
                continue
            nb += 1
            if version == compatibility_version():
                menu.append([login, 4073, login], (connect_and_play, ip, port))
        menu.title = nb2msg(len(menu.choices)) + [4078] + nb2msg(nb) + [4079]
        menu.append([4075, 4076], None)
        menu.run()

#...

So there you go. A game written in Python.
@Genroa, the only reason Python is slow is because the people who write the programs that you use don't know how to optimize their code. If they called the right module, and compiled their script into a .pyo file, the interpreter would be much faster. Alternatively, they could use cx_freeze, written in Python, to compile it to a win32 .EXE executable which would make it even faster.

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : severestormsteve1 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : dhruv via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : severestormsteve1 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : dhruv via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Genroa via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : dhruv via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : severestormsteve1 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Genroa via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Genroa via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : dhruv via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : dhruv via Audiogames-reflector

Reply via email to