Learning Python

Started by Pfaber11, April 30, 2019, 14:13:49

Previous topic - Next topic

plenatus


Pfaber11

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 .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

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 .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

MikeHart

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?

MikeHart

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.






Pfaber11

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 .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

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.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

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 .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

MikeHart


Pfaber11

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 .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

LineOf7s

There is absolutely sound.  Try harder.
"Life's biggest obstacles are your greatest opportunities to excel"

Pfaber11

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.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

#27
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
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

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.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

plenatus

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/  :))