July 19, 2019, 01:32:11 AM

Author Topic: Learning Python  (Read 2135 times)

Offline c0d3r9

  • Full Member
  • ***
  • Posts: 121
Re: Learning Python
« Reply #15 on: May 10, 2019, 09:14:21 PM »
Laptop: Win10@64bit - i3 2x2Ghz - 8GB Ram - 1TB HDD
Desktop: Win10@64bit - AMD Ryzen 5 2400G - MSI B450 Tomahawk - 8GB Ram - 240GB SSD

Offline Pfaber11

  • Full Member
  • ***
  • Posts: 191
Re: Learning Python
« Reply #16 on: May 10, 2019, 10:14:30 PM »
Thanks for the reply got it working now . Did it using pyinstaller in the end . Got it to compile to a single exe file but still have to include my media with the exe file in the same folder . As I do with AGK2 . Did try py2exe but pyinstaller seems easier and it compresses it all into a single exe without all the dll  files showing . It's pretty tidy. Only written a couple of short pieces of code so far but know enough to think this is for me . I haven't used or declared any classes yet . so far my programs are running ok without it but I guess there will come a time when it becomes necessary . I think it acts as a container for some procedures or something like that according to what I've read. It'll probably make more sense a little way down the track. We'll see . At least I've got some compiled code and it's working as it should . I think the next thing to do is dive in and write a game and work it out as I go along .

Offline Pfaber11

  • Full Member
  • ***
  • Posts: 191
Re: Learning Python
« Reply #17 on: May 10, 2019, 10:24:14 PM »
By the way I'm making notes of everything I do so kinda writing my own user manual as I go along . At least by doing that With a quick flick through the pages I can jog my memory so don't have to worry about forgetting anything. I think in a few months I won't be an expert but I will be able to build games the way I like them .

Offline MikeHart

  • Hero Member
  • *****
  • Posts: 588
  • Cerberus-X Dev Team
    • Cerberus X
Re: Learning Python
« Reply #18 on: May 11, 2019, 06:57:44 AM »
I am using pyinstaller too. Was super easy to integrate it into the ide. As an ide i use PyCharm. Nothing beats that.


 Btw, you mentioned somewhere that you hope that your code runs faster when it is compiled. Python is always interpreted. For making code sections faster i am interfacing with Cypthon. Which method
do you use?

Offline MikeHart

  • Hero Member
  • *****
  • Posts: 588
  • Cerberus-X Dev Team
    • Cerberus X
Re: Learning Python
« Reply #19 on: May 11, 2019, 07:04:18 AM »
What the py to exe tools do is to create a bundle that will be extracted at start. Depending on how big and how many files you have, it can take time. PyInstaller can also pack everything into one exe. I choose not to as for my app it is more important to start fast.






Offline Pfaber11

  • Full Member
  • ***
  • Posts: 191
Re: Learning Python
« Reply #20 on: May 11, 2019, 07:27:42 AM »
Hi mike I'm using wing personal 7 . Nice and simple . Didn't realise they take longer to start if packaged into one file . Seems to work fine though. Really starting to get into it now. I no longer find it intimidating . I'm using pygame with python 3.7.3   at the moment . I read last night that you can produce APK files to run on Android but will have to look more closely into that to see how it's done . If I get stuck on anything I'll give you a shout .

Offline Pfaber11

  • Full Member
  • ***
  • Posts: 191
Re: Learning Python
« Reply #21 on: May 11, 2019, 07:35:53 AM »
I did try pycharm first but found it a tad too complicated . Wing personal 7 is simpler . Did try wing 101 as well but for some reason I didn't like it it was very simple . I intend to build myself a nice portfolio of all my python apps on the internet and hopefully I'll get some good programs created . There's so much free stuff on the internet for python it's unbelievable . Have a nice morning.

Offline Pfaber11

  • Full Member
  • ***
  • Posts: 191
Re: Learning Python
« Reply #22 on: May 11, 2019, 09:23:02 AM »
Hi all been looking at running python apps cross platform and saw something called Briefcase on the Beeware site . It claims to transfer a .py app into a  apk file which runs natively on Android .  Think it does the same for ios too. Not sure how it handles the touch screen etc but will find out in due coarse . Just had a look at the python forum and posted and got told off by a mod . never mind .
A bit of snobbery going on I believe. I prefer this forum to any of the others anyway. I'm off Have a nice morning .

Offline MikeHart

  • Hero Member
  • *****
  • Posts: 588
  • Cerberus-X Dev Team
    • Cerberus X
Re: Learning Python
« Reply #23 on: May 11, 2019, 02:07:41 PM »

Offline Pfaber11

  • Full Member
  • ***
  • Posts: 191
Re: Learning Python
« Reply #24 on: May 11, 2019, 03:00:36 PM »
Had a look unfortunately there was no sound . Done a lot of research today. Will be starting my first project very shortly . Everything is in place . Think it's gonna be a 2d space shooter or something to that effect to get the ball rolling and cut my teeth on using pygame and after I've done that I'll start on Panda3d  and see how that goes .  I've been taking notes on things like putting graphics on the screen, drawing , sound and collisions . just stuff to jog my memory and steer me in the right direction. Did the same thing with AGK2 in the beginning and it helped enormously.  A bit like my own quick start guide with everything I need in it. Quite a bit anyway.  I'm running python 3.7.3 which I got from python.org  I think it's cpython but don't really know.
I'm glad now I didn't invest in AGK studio when I got all the python stuff for free . Apart from the 77p I spent on 4 books . Which I probably will read at some point .

Offline LineOf7s

  • Jr. Member
  • **
  • Posts: 58
    • LineOf7s Entertainment
Re: Learning Python
« Reply #25 on: May 12, 2019, 12:29:14 AM »
There is absolutely sound.  Try harder.

Offline Pfaber11

  • Full Member
  • ***
  • Posts: 191
Re: Learning Python
« Reply #26 on: May 12, 2019, 01:13:07 PM »
I just tried again but was too late . I've just been getting the sound up and running in my little program . Took me all morning neglected to initialize the mixer. Oh well won't forget that again in a hurry.

Offline Pfaber11

  • Full Member
  • ***
  • Posts: 191
Re: Learning Python
« Reply #27 on: May 12, 2019, 01:15:12 PM »
Hi line of 7s what's your language . Are you learning or learnt python?
I'm taking a break from it for a couple of hours . Then it's time to get my graphics moving  . After that I should be in the position to try a simple game . emphasis on simple . Haven't worked out how to put text on the screen either so maybe I'll tackle that first. Coffee time . Ding Ding

Offline Pfaber11

  • Full Member
  • ***
  • Posts: 191
Re: Learning Python
« Reply #28 on: May 12, 2019, 08:29:40 PM »
Well I've kinda ground to a holt just deleted my days work . What I was wondering is there a special way of organising a python program . Finding it a bit difficult with no goto or gosub or return . I do understand procedures and how to call them sort of . Don't really get classes and if someone could explain this to me and where to create them I would be most grateful.

Offline c0d3r9

  • Full Member
  • ***
  • Posts: 121
Re: Learning Python
« Reply #29 on: May 12, 2019, 09:24:54 PM »
As your native language is english i only can say read books and google.
Python is not an hard to learn language and it seems that you have many problems with simple language things.
Read ebooks, tutorials, and source codes....

but in short:  https://www.w3schools.com/python/python_classes.asp and https://docs.python.org/3/tutorial/classes.html and very important http://www.giyf.com/  :))
Laptop: Win10@64bit - i3 2x2Ghz - 8GB Ram - 1TB HDD
Desktop: Win10@64bit - AMD Ryzen 5 2400G - MSI B450 Tomahawk - 8GB Ram - 240GB SSD