Python Forum
dynamic object creation using python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dynamic object creation using python
#1
I have the following requirement
1. Create several geometric objects such as square, triangle, circle etc.
2. Need to create a drop down menu that displays number 1 to 10 corresponding to each of the objects
3. Now depending upon user selection, the screen shall display corresponding numbers of the objects. For example
if the user selects 3 triangles and 2 squares, then corresponding objects shall appear on screen.

please suggest method to do so
Reply
#2
Sounds like you should start with basic python tutorial,
I'd suggest:
Think like a computer scientist
or perhaps:
Python Course
Reply
#3
I have used Visual basic earlier and getting used to python. Pointed direction would be highly useful for the said requirement.
Reply
#4
I would write a program that draws a circle. Then I would change the program to draw 3 circles using identical code except for changing 1 to 3. Then I would write a program that draws 3 circles and 4 triangles. Then I would write a program that draws N number of all the different shapes you need to draw. Then I would write a program where I have a button for each shape, and when I press the button it draws one of that shape. Then I would write a program that replaces the buttons with drop down menus that let me select how many of that shape to draw. Then I am done.

How can you draw a circle? Have you received any instruction on how to do that?
Reply
#5
"Think like a computer scientist" is one of my favorites. If that link is to the first edition which explains Python2, this link is second edition, Python3 https://greenteapress.com/wp/think-python-2e/
Reply
#6
Old joke: Think like a computer scientist:

Quote:Wife says to her computer scientist husband:

Go to the grocer and get a loaf of bread, and if they have eggs, get six.

Hubby comes home with six loaves of bread!
Reply
#7
Ok. I have got the right resource to get started. Thank you. I also have a requirement to create similar UI which shall have impressive look as displayed in webpage https://vcvrack.com/Rack. Could anybody provide pointers for development
Reply
#8
You can use website templates which save a tremendous amount of time.
There are many sites available to either buy or get them free.
One of the simplest to incorporate into your site is bootstrap.
Flask or Django are the two most popular web frameworks, but there are also
web2py, bottle and probably others.
Just search for 'website templates' and you'll get a huge list.
I use Flask which I think allows more flexibility.
You can build your own, but using a template is recommended. it's a huge time saver, and your website will look great
Gribouillis likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  python update binary object (override delivered Object properties) pierre38 4 1,711 May-19-2022, 07:52 AM
Last Post: pierre38
  Dynamic File Name to a shared folder with open command in python sjcsvatt 9 5,879 Jan-07-2022, 04:55 PM
Last Post: bowlofred
  Dynamic Printing With Python Terminal MrTim 2 2,824 Jul-06-2021, 04:00 PM
Last Post: MrTim
  Is there a library for recursive object creation using config objects johsmi96 0 1,823 May-03-2021, 08:09 PM
Last Post: johsmi96
  Use dynamic variable from parallel running python script Sicksym 0 1,823 May-15-2020, 02:52 PM
Last Post: Sicksym
  python 2D array creation and print issue developerbrain 5 2,758 May-15-2019, 01:38 PM
Last Post: developerbrain
  Creation of Dynamic HTML by substituting Database values Sandy777 1 2,103 Apr-18-2019, 07:17 AM
Last Post: buran
  Socket creation speed difference Python 2.7 / Python 3.7 PiAil 1 2,425 Feb-13-2019, 01:55 PM
Last Post: PiAil
  python rrdtool graph creation issue anna 0 4,404 Sep-10-2018, 11:10 AM
Last Post: anna
  Code review for S3 object creation beherap 0 2,115 Mar-29-2018, 01:31 PM
Last Post: beherap

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020