Python Forum
Need to fix SyntaxError in cycle try
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need to fix SyntaxError in cycle try
#12
Speeding up loops is not your problem. Your main problem is you don't know Python very well and you are trying to use it in a way it is not meant to be used. You are using Python like it is C++ and disappointed that it does not act like C++. If you want a language to act like C++ maybe you should use C++?

You can do what you want to do using Python, but you can't really do it the way you are trying. Larz gives you good advice and you just decide to ignore it because it doesn't fit with you view. Sorry, but Python was not written for you. If you want to use Python you have to change your ways to fit better with what Python provides. One thing that Python is particularly bad at is loops. Some loops can be sped up, but many cannot. Quite often people trying to speed up their code using something like numba and see no benefit or even worse results. Like Python, these tools are meant to be used in a certain way, and if you don't follow their rules, they don't work.
Reply


Messages In This Thread
RE: Need to fix SyntaxError in cycle try - by deanhystad - Mar-25-2022, 06:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Writing a cycle to find the nearest point from the array Tysrusko 0 269 May-10-2024, 11:49 AM
Last Post: Tysrusko
  Trying to cycle through a list of charcters pooky2483 12 4,819 Sep-28-2020, 06:55 AM
Last Post: pooky2483
  <while> cycle is not interrupted when using the <random>module ShityCoder 3 2,331 Sep-04-2020, 04:05 PM
Last Post: ShityCoder
  Cycle of numpy variables Zero01 0 1,634 Jul-31-2020, 11:58 AM
Last Post: Zero01
  stop cycle while windows11 1 2,127 May-16-2020, 03:17 PM
Last Post: deanhystad
  Occurrences using FOR and IF cycle P86 2 2,644 Jul-29-2019, 04:37 PM
Last Post: ThomasL
  pool map cycle skorost5 5 4,021 Apr-07-2019, 09:21 AM
Last Post: skorost5
  lifetime cycle counter Ixxxxxx 0 2,582 Mar-07-2018, 07:26 PM
Last Post: Ixxxxxx

Forum Jump:

User Panel Messages

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