• Python

    From Digital Noise@VERT to DOVE-Net.Programming on Thursday, September 07, 2006 20:37:16
    Hmmm...

    How shall I phrase this...I have a project, not official, but if I can
    get it done would make my work life IMMENSELY simpler, that I think I
    can do best in Python, for a number of reasons:

    1) IT Dept doesn't object to Python being installed on my PC (big one!)
    2) According to everything I've read, it's really easy to learn (big two!)
    3) It's a simple program for helping me parse and search LARGE text files.

    Essentially the deal is this: Every month (EVERY MONTH) I get a text
    file that has been processed by our mainframe billing system that contains...information, that is uniquely identified by several different fields - some can be duplicates, but there is ALWAYS one unique identifier.

    Almost every month I have to go searching in these files to locate
    information - either by one of those aforementioned identifiers, or by date/time information, etc. I can (and have been) use Notepad to do
    this, but it's time consuming and prone to errors.

    What I want to do is this:

    1) Build a program that will import and either:
    a) Natively understand the files or
    b) Import, then convert the files
    2) Allow me to search the files by any of the fields.
    3) Upon finding records that match #2; return the entire row, and just
    that row.

    Now my question: Is Python even a good choice for this?

    I know that Perl has been used to do things like this before, but Perl
    is not acceptable to the IT department. I'm sure I could ask our
    Database Programmer to build this in Access, but I'd rather not burden
    him (he's already like 6mths behind), plus I'd like to learn this myself.

    Any thoughts?

    DN

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Deuce@VERT/SYNCNIX to Digital Noise on Thursday, September 07, 2006 20:35:00
    Re: Python
    By: Digital Noise to DOVE-Net.Programming on Thu Sep 07 2006 08:37 pm

    1) Build a program that will import and either:
    a) Natively understand the files or
    b) Import, then convert the files
    2) Allow me to search the files by any of the fields.
    3) Upon finding records that match #2; return the entire row, and just
    that row.

    Sounds like you want awk.

    ---
    Wheeble.

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Angus McLeod@VERT/ANJO to Digital Noise on Thursday, September 07, 2006 23:52:00
    Re: Python
    By: Digital Noise to DOVE-Net.Programming on Thu Sep 07 2006 20:37:00

    1) IT Dept doesn't object to Python being installed on my PC (big one!)
    2) According to everything I've read, it's really easy to learn (big two!) 3) It's a simple program for helping me parse and search LARGE text files.

    Perl was built specifically for this exact type of task.

    Essentially the deal is this: Every month (EVERY MONTH) I get a text
    file that has been processed by our mainframe billing system that contains...information, that is uniquely identified by several different fields - some can be duplicates, but there is ALWAYS one unique identifier.

    I suppose you have to keep the data confidential, so we can't look at an example of the data. Does the format also have to be confidential? Or
    could you produce a ficticious dataset in the same format?

    Almost every month I have to go searching in these files to locate information - either by one of those aforementioned identifiers, or by date/time information, etc.

    Sounds like a Perl coders dream. Except you never actually said what you
    *DO* with the data once you've located it....

    1) Build a program that will import and either:
    a) Natively understand the files or
    b) Import, then convert the files
    2) Allow me to search the files by any of the fields.
    3) Upon finding records that match #2; return the entire row, and just
    that row.

    Dunno what the uniquely identifying fields look like, but you could
    probably combine #2 and #3 into a Perl one-liner, or very close to it.

    perl -ne '/pattern/ && print;';

    will do it. "pattern" can be as simple as plain-text to match or as incredibly complicated as a regular expression can get. Formatted output containing parts of the matched row are nearly as easy.

    Now my question: Is Python even a good choice for this?

    My question is why anyone would use Python for *anything*, INCLUDING a
    "Hello, world!" program.

    I know that Perl has been used to do things like this before, but Perl
    is not acceptable to the IT department.

    Well if you have a huge millstone tied around your neck, you'll find it
    much harder to swim. I'd be really interested to hear *why* your IT department has decided to ban Perl.
    ---
    Playing: "O Caritas" by "Cat Stevens"
    from the "Catch bull at four" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Hawke@VERT/HNEST to Angus McLeod on Friday, September 08, 2006 01:28:00
    Re: Python
    By: Angus McLeod to Digital Noise on Thu Sep 07 2006 23:52:00

    Well if you have a huge millstone tied around your neck, you'll find it
    much harder to swim. I'd be really interested to hear *why* your IT department has decided to ban Perl.

    If I had to guess, I'd guess that it's so that the "real programming
    tasks" can be given to a programming dept to make more expensive and
    take longer.

    ---
    þ Synchronet þ Hawke's Nest BBS
  • From Digital Noise@VERT to Angus McLeod on Friday, September 08, 2006 08:24:16
    Angus McLeod wrote:
    Re: Python
    By: Digital Noise to DOVE-Net.Programming on Thu Sep 07 2006 20:37:00

    1) IT Dept doesn't object to Python being installed on my PC (big one!)
    2) According to everything I've read, it's really easy to learn (big two!) 3) It's a simple program for helping me parse and search LARGE text files.

    Perl was built specifically for this exact type of task.

    I know :(

    Essentially the deal is this: Every month (EVERY MONTH) I get a text
    file that has been processed by our mainframe billing system that contains...information, that is uniquely identified by several different fields - some can be duplicates, but there is ALWAYS one unique identifier.

    I suppose you have to keep the data confidential, so we can't look at an example of the data. Does the format also have to be confidential? Or could you produce a ficticious dataset in the same format?

    It's PPV data - I've copied and pasted a section from the PAL (PPV Auto Loader) file below - hopefully it'll keep the format:

    =====================================================================================================================================
    TITLEID:SHOWID:BASEID:LONG DESCRIPTION : SH DESC:START DATE/TIME: LEN :
    CHNL# : RTG : SUBJ : PRICE : CNTRLR # :ORDER:INTSTI: -------:------:------:-----------------:--------:---------------:-----:-----------:-----:------:--------:------------:-----:------:
    53987 :36869 :31059 :DORM ROOM GRL UNC:DORM ROO:09/01/06 06:00 :
    059:01= 501 : : 6=6 : 0009.95: : 30: 1:
    53988 :36870 :31067 :WMN EROTC WRSTL13:WMN EROT:09/01/06 10:00 :
    089:01= 501 : : 6=6 : 0014.95: : 30: 181:
    53989 :36871 :31058 :WILD GRLS BARTNDR:WILD GRL:09/01/06 11:30 :
    059:01= 501 : : 6=6 : 0009.95: : 30: 1:

    As you can see, it's colon seperated, and does include headers on every
    page (this is the result of the PAL file being processed by the system; however, the system provides no function to search these files, hence my problem).

    Almost every month I have to go searching in these files to locate information - either by one of those aforementioned identifiers, or by date/time information, etc.

    Sounds like a Perl coders dream. Except you never actually said what you *DO* with the data once you've located it....

    I just need to locate the data because occasionally I have to change
    things manually, and I need to locate like the Title ID; or Search by
    the Date/Time, etc.

    I know that Perl has been used to do things like this before, but Perl
    is not acceptable to the IT department.

    Well if you have a huge millstone tied around your neck, you'll find it
    much harder to swim. I'd be really interested to hear *why* your IT department has decided to ban Perl.

    As I understand it, Corporate IT doesn't want it installed on any
    non-web facing machines that sit in the DMZ - why, I don't know, but...I
    guess the other practical reason is I'm trying to build something that
    anyone can use with a minimal of training (I do all of this work now,
    but it might not always be that way).

    DN

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Digital Noise@VERT to Hawke on Friday, September 08, 2006 08:25:24
    Not quite - we don't have a programming dept. There are Network
    Security issues that caused Corporate IT to make the mandate - not that
    they explained with issues those might be, since we all sit behind a firewall...

    Hawke wrote:
    Re: Python
    By: Angus McLeod to Digital Noise on Thu Sep 07 2006 23:52:00

    Well if you have a huge millstone tied around your neck, you'll find it much harder to swim. I'd be really interested to hear *why* your IT department has decided to ban Perl.

    If I had to guess, I'd guess that it's so that the "real programming
    tasks" can be given to a programming dept to make more expensive and
    take longer.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Deuce@VERT/SYNCNIX to Hawke on Friday, September 08, 2006 09:25:00
    Re: Python
    By: Hawke to Angus McLeod on Fri Sep 08 2006 01:28 am

    If I had to guess, I'd guess that it's so that the "real programming
    tasks" can be given to a programming dept to make more expensive and
    take longer.

    Still looks like you just want awk... or maybe even just grep.


    ---
    Wheeble.

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Digital Noise@VERT to Deuce on Friday, September 08, 2006 09:35:37
    Re: Python
    By: Hawke to Angus McLeod on Fri Sep 08 2006 01:28 am

    If I had to guess, I'd guess that it's so that the "real programming tasks" can be given to a programming dept to make more expensive and take longer.

    Still looks like you just want awk... or maybe even just grep.

    Is AWK available for Windows (since that's the defacto platform here), and easily usable for someone other than me later down the road?

    I'm trying to build more than a one-time use application, and one that can be utilized by others than myself without them having to learn a programming language.

    DN

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Deuce@VERT/SYNCNIX to Digital Noise on Friday, September 08, 2006 19:42:00
    Re: Re: Python
    By: Digital Noise to Deuce on Fri Sep 08 2006 09:35 am

    Still looks like you just want awk... or maybe even just grep.

    Is AWK available for Windows (since that's the defacto platform here), and easily usable for someone other than me later down the road?

    I assume it is... it was available for DOS at one point.

    I'm trying to build more than a one-time use application, and one that can be utilized by others than myself without them having to learn a
    programming language.

    awk and grep are pretty much as much application as they're ever going to get already... it's all command-line driven.

    ---
    Wheeble.

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Digital Noise@VERT to Deuce on Friday, September 08, 2006 22:36:00
    It's available as part of Cygwin, which, while an option, isn't a great
    one ('cause there's more than one step to getting it up and running).
    The only 'awk' I've found is for *nix, but I'll keep looking.

    But you're absolutely right - it's incredibly powerful, and I could
    build simple programs with interpreted files. I really would prefer
    something with a GUI that I could build, but this would definitely work
    for my personal needs.

    Deuce wrote:
    Re: Re: Python
    By: Digital Noise to Deuce on Fri Sep 08 2006 09:35 am

    Still looks like you just want awk... or maybe even just grep.

    Is AWK available for Windows (since that's the defacto platform here), and easily usable for someone other than me later down the road?

    I assume it is... it was available for DOS at one point.

    I'm trying to build more than a one-time use application, and one that can be utilized by others than myself without them having to learn a programming language.

    awk and grep are pretty much as much application as they're ever going to get already... it's all command-line driven.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Dotel@VERT/DARKNESS to Hawke on Saturday, September 09, 2006 00:00:00
    Re: Python
    By: Hawke to Angus McLeod on Fri Sep 08 2006 02:28 am

    Re: Python
    By: Angus McLeod to Digital Noise on Thu Sep 07 2006 23:52:00

    Well if you have a huge millstone tied around your neck, you'll find it much harder to swim. I'd be really interested to hear *why* your IT department has decided to ban Perl.

    If I had to guess, I'd guess that it's so that the "real programming
    tasks" can be given to a programming dept to make more expensive and
    take longer.


    Oh well thats easy to explain. You see it involved the head of the IT staff,
    a bottle of tequila, and a nice thick perl neckless across his neck. Now the memory if Perl is just too painfull for the IT manager. HE must avoid it everywhere. Try to view it from his perspective, He walks by your computer, you have what appears to be a simple perl script, But what does he see in his head. A 700 lb man wearing a leather girdle, happyface tattooed nipples, grabbing his hair and screaming "It's a sub routine not a leafblower" and
    then gives him 40oz of loving.

    So it does make sense to ban it in that contex.

    -Dotel
    Sysop of: StarDoc 134 BBS
    Linux Hybrid BBS, 45+ Doors Internet links
    Telnet or SSH2://bbs.doteltech.com

    Beware The Jaws That Bite, for they belong to my attack penguin


    ---
    þ Synchronet þ Darkness BBS - darkness.synchro.net
  • From Belly@VERT/BRAZINET to Digital Noise on Saturday, September 09, 2006 12:55:00
    Re: Re: Python
    By: Digital Noise to Angus McLeod on Fri Sep 08 2006 09:24 am

    53987 :36869 :31059 :DORM ROOM GRL UNC:DORM ROO:09/01/06 06:00 :
    059:01= 501 : : 6=6 : 0009.95: : 30: 1:
    53988 :36870 :31067 :WMN EROTC WRSTL13:WMN EROT:09/01/06 10:00 :
    089:01= 501 : : 6=6 : 0014.95: : 30: 181:
    53989 :36871 :31058 :WILD GRLS BARTNDR:WILD GRL:09/01/06 11:30 :
    059:01= 501 : : 6=6 : 0009.95: : 30: 1:

    I'll give you this: At least your sample data is entertaining. :)


    o
    (O)
    BeLLy


    ---
    þ Synchronet
  • From Mindless Automaton@VERT/ELDRITCH to Belly on Saturday, September 09, 2006 18:58:00
    Belly wrote:
    Re: Re: Python
    By: Digital Noise to Angus McLeod on Fri Sep 08 2006 09:24 am

    53987 :36869 :31059 :DORM ROOM GRL UNC:DORM ROO:09/01/06 06:00 : 059:01= 501 : : 6=6 : 0009.95: : 30: 1:
    53988 :36870 :31067 :WMN EROTC WRSTL13:WMN EROT:09/01/06 10:00 : 089:01= 501 : : 6=6 : 0014.95: : 30: 181:
    53989 :36871 :31058 :WILD GRLS BARTNDR:WILD GRL:09/01/06 11:30 : 059:01= 501 : : 6=6 : 0009.95: : 30: 1:

    I'll give you this: At least your sample data is entertaining. :)


    What do you mean sample? :o

    -Mindless Automaton
    ---
    þ Synchronet þ Eldritch Clockwork BBS
  • From Digital Noise@VERT to Belly on Saturday, September 09, 2006 17:09:32
    Re: Re: Python
    By: Belly to Digital Noise on Sat Sep 09 2006 12:55 pm

    I'll give you this: At least your sample data is entertaining. :)

    You have no idea - 99.9% of our PPV buys are adult related.

    That one file has 8 channels in in, enough data for 30/31 days worth of events 24 hrs a day. There are another 4/5 files for the Adult-only channels as well.

    DN

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Digital Noise@VERT to All on Saturday, September 09, 2006 19:19:12
    LMAO exactly.

    This is actual data from this month.

    DN

    Mindless Automaton wrote:
    Belly wrote:
    Re: Re: Python
    By: Digital Noise to Angus McLeod on Fri Sep 08 2006 09:24 am

    53987 :36869 :31059 :DORM ROOM GRL UNC:DORM ROO:09/01/06 06:00 :
    059:01= 501 : : 6=6 : 0009.95: : 30: 1:
    53988 :36870 :31067 :WMN EROTC WRSTL13:WMN EROT:09/01/06 10:00 :
    089:01= 501 : : 6=6 : 0014.95: : 30: 181:
    53989 :36871 :31058 :WILD GRLS BARTNDR:WILD GRL:09/01/06 11:30 :
    059:01= 501 : : 6=6 : 0009.95: : 30: 1:

    I'll give you this: At least your sample data is entertaining. :)


    What do you mean sample? :o

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Angus McLeod@VERT/ANJO to Deuce on Saturday, September 09, 2006 23:43:00
    Re: Python
    By: Deuce to Digital Noise on Thu Sep 07 2006 20:35:00

    1) Build a program that will import and either:
    a) Natively understand the files or
    b) Import, then convert the files
    2) Allow me to search the files by any of the fields.
    3) Upon finding records that match #2; return the entire row, and just that row.

    Sounds like you want awk.

    Well sed! :-)


    ---
    Playing: "Always have, always will" by "Ace Of Base"
    from the "Greatest hits" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Angus McLeod@VERT/ANJO to Digital Noise on Saturday, September 09, 2006 23:52:00
    Re: Re: Python
    By: Digital Noise to Angus McLeod on Fri Sep 08 2006 08:24:00

    It's PPV data - I've copied and pasted a section from the PAL (PPV Auto Loader) file below - hopefully it'll keep the format:

    ============================================================================ TITLEID:SHOWID:BASEID:LONG DESCRIPTION : SH DESC:START DATE/TIME: LEN :
    CHNL# : RTG : SUBJ : PRICE : CNTRLR # :ORDER:INTSTI: -------:------:------:-----------------:--------:---------------:-----:-----
    53987 :36869 :31059 :DORM ROOM GRL UNC:DORM ROO:09/01/06 06:00 :
    059:01= 501 : : 6=6 : 0009.95: : 30: 1:
    53988 :36870 :31067 :WMN EROTC WRSTL13:WMN EROT:09/01/06 10:00 :
    089:01= 501 : : 6=6 : 0014.95: : 30: 181:
    53989 :36871 :31058 :WILD GRLS BARTNDR:WILD GRL:09/01/06 11:30 :
    059:01= 501 : : 6=6 : 0009.95: : 30: 1:

    As you can see, it's colon seperated, and does include headers on every
    page (this is the result of the PAL file being processed by the system; however, the system provides no function to search these files, hence my problem).

    Is it safe to assume that each line of data is in the same format?

    I just need to locate the data because occasionally I have to change
    things manually, and I need to locate like the Title ID; or Search by
    the Date/Time, etc.

    So you want to find (say) all lines where TITLEID = 53988? Or maybe where START DATE = 09/01/06? And then what, manually edit them? Or have some change applied programatically?

    ---
    Playing: "C'est la vie always" by "Ace Of Base"
    from the "Greatest hits" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Angus McLeod@VERT/ANJO to Deuce on Saturday, September 09, 2006 23:56:00
    Re: Python
    By: Deuce to Hawke on Fri Sep 08 2006 09:25:00

    If I had to guess, I'd guess that it's so that the "real programming tasks" can be given to a programming dept to make more expensive and
    take longer.

    Still looks like you just want awk... or maybe even just grep.

    Yes. It would be nice to do do something like

    doit --titleid=53988

    but grep might do it.

    ---
    Playing: "Lucky love 2" by "Ace Of Base"
    from the "Greatest hits" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Angus McLeod@VERT/ANJO to Digital Noise on Sunday, September 10, 2006 00:00:00
    Re: Re: Python
    By: Digital Noise to Deuce on Fri Sep 08 2006 09:35:00

    Still looks like you just want awk... or maybe even just grep.

    Is AWK available for Windows (since that's the defacto platform here), and easily usable for someone other than me later down the road?

    You can get 'gawk' for windows.
    ---
    Playing: "Beautiful life 2" by "Ace Of Base"
    from the "Greatest hits" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Angus McLeod@VERT/ANJO to Digital Noise on Sunday, September 10, 2006 00:02:00
    Re: Re: Python
    By: Digital Noise to Deuce on Fri Sep 08 2006 22:36:00

    I really would prefer something with a GUI that I could build, but this would definitely work for my personal needs.

    You're operating within the restrictive framework of your corporate ID
    policy.
    ---
    Playing: "Beautiful life 2" by "Ace Of Base"
    from the "Greatest hits" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Angus McLeod@VERT/ANJO to Belly on Sunday, September 10, 2006 00:03:00
    Re: Re: Python
    By: Belly to Digital Noise on Sat Sep 09 2006 12:55:00

    53987 :36869 :31059 :DORM ROOM GRL UNC:DORM ROO:09/01/06 06:00 : 059:01= 501 : : 6=6 : 0009.95: : 30: 1:
    53988 :36870 :31067 :WMN EROTC WRSTL13:WMN EROT:09/01/06 10:00 : 089:01= 501 : : 6=6 : 0014.95: : 30: 181:
    53989 :36871 :31058 :WILD GRLS BARTNDR:WILD GRL:09/01/06 11:30 : 059:01= 501 : : 6=6 : 0009.95: : 30: 1:

    I'll give you this: At least your sample data is entertaining. :)

    Yeh! :-) I assumed it was not production data, but a test set selected
    for our benefit.

    ---
    Playing: "Beautiful life 2" by "Ace Of Base"
    from the "Greatest hits" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Digital Noise@VERT to Angus McLeod on Sunday, September 10, 2006 01:12:07
    See my answers:

    Angus McLeod wrote:
    Re: Re: Python
    By: Digital Noise to Angus McLeod on Fri Sep 08 2006 08:24:00

    It's PPV data - I've copied and pasted a section from the PAL (PPV Auto Loader) file below - hopefully it'll keep the format:

    ============================================================================
    TITLEID:SHOWID:BASEID:LONG DESCRIPTION : SH DESC:START DATE/TIME: LEN :
    CHNL# : RTG : SUBJ : PRICE : CNTRLR # :ORDER:INTSTI: -------:------:------:-----------------:--------:---------------:-----:-----
    53987 :36869 :31059 :DORM ROOM GRL UNC:DORM ROO:09/01/06 06:00 :
    059:01= 501 : : 6=6 : 0009.95: : 30: 1:
    53988 :36870 :31067 :WMN EROTC WRSTL13:WMN EROT:09/01/06 10:00 :
    089:01= 501 : : 6=6 : 0014.95: : 30: 181:
    53989 :36871 :31058 :WILD GRLS BARTNDR:WILD GRL:09/01/06 11:30 :
    059:01= 501 : : 6=6 : 0009.95: : 30: 1:

    As you can see, it's colon seperated, and does include headers on every page (this is the result of the PAL file being processed by the system; however, the system provides no function to search these files, hence my problem).

    Is it safe to assume that each line of data is in the same format?


    With the exception of each page header, and the final footer (summarizes totals for each title ID - Title ID's can be replicated, Show ID's
    *must* be unique (You can have multiple showings for one title)), yes.

    I just need to locate the data because occasionally I have to change things manually, and I need to locate like the Title ID; or Search by
    the Date/Time, etc.

    So you want to find (say) all lines where TITLEID = 53988? Or maybe where START DATE = 09/01/06? And then what, manually edit them? Or have some change applied programatically?

    Actually, I just want to locate the information. Any changes are
    applied through our billing system, but say I wanted to locate the Title
    ID (so I can change the event) for a specific date and time. Or all
    Title ID's with a specific date range, or any combination thereof.

    These files are the result of the processing program - no changes made
    to them will actually create any changes in the system. They're
    basically a hard copy record of the processing that was done - the
    processing being the building of the events and the assignment of Title
    and Show ID's (Controller #'s come much later).

    DN

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Digital Noise@VERT to Angus McLeod on Sunday, September 10, 2006 01:12:33
    Angus McLeod wrote:
    Re: Re: Python
    By: Belly to Digital Noise on Sat Sep 09 2006 12:55:00

    53987 :36869 :31059 :DORM ROOM GRL UNC:DORM ROO:09/01/06 06:00 : 059:01= 501 : : 6=6 : 0009.95: : 30: 1:
    53988 :36870 :31067 :WMN EROTC WRSTL13:WMN EROT:09/01/06 10:00 : 089:01= 501 : : 6=6 : 0014.95: : 30: 181:
    53989 :36871 :31058 :WILD GRLS BARTNDR:WILD GRL:09/01/06 11:30 : 059:01= 501 : : 6=6 : 0009.95: : 30: 1:

    I'll give you this: At least your sample data is entertaining. :)

    Yeh! :-) I assumed it was not production data, but a test set selected
    for our benefit.

    Sad part is that's real data :)

    DN

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Digital Noise@VERT to Angus McLeod on Sunday, September 10, 2006 01:14:30
    Angus McLeod wrote:
    Re: Python
    By: Deuce to Hawke on Fri Sep 08 2006 09:25:00

    If I had to guess, I'd guess that it's so that the "real programming tasks" can be given to a programming dept to make more expensive and take longer.

    Still looks like you just want awk... or maybe even just grep.

    Yes. It would be nice to do do something like

    doit --titleid=53988

    but grep might do it.

    See, I have no problems with using tools like 'gawk' or 'grep' (assuming
    there was a Windows version of 'grep') to complete this task.

    It's just that I'm not the only one that does it (I do 95.9856% of the
    time), and it's a need that extends beyond me.

    DN

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Tracker1@VERT/TRN to Digital Noise on Sunday, September 10, 2006 01:09:00
    Digital Noise wrote:
    What I want to do is this:

    1) Build a program that will import and either:
    a) Natively understand the files or
    b) Import, then convert the files
    2) Allow me to search the files by any of the fields.
    3) Upon finding records that match #2; return the entire row, and just
    that row.

    Now my question: Is Python even a good choice for this?

    Honestly, "it depends" to be honest, for a short term database use,
    depending on the level of data, something that imports it into an access database is probably your most usable format (not to start arguments, and
    this really only holds water if you are using windows, which you didn't
    mention your OS).. if you have defined searches and queries and want a
    gui interface, python is probably a decent choice...

    I know that Perl has been used to do things like this before, but Perl
    is not acceptable to the IT department. I'm sure I could ask our
    Database Programmer to build this in Access, but I'd rather not burden
    him (he's already like 6mths behind), plus I'd like to learn this myself.

    LOL, started the reply before reading this... if you want to learn something and want GUI, python is a decent choice, as would be Java, or C#/.Net the latter two would be more practical for future job use... but have fun with
    it. :)

    Any thoughts?

    see above.

    --
    Michael J. Ryan - tracker1(at)theroughnecks(dot)net - www.theroughnecks.net icq: 4935386 - AIM/AOL: azTracker1 - Y!: azTracker1 - MSN/Win: (email)

    ---
    þ Synchronet þ theroughnecks.net - you know you want it
  • From Tracker1@VERT/TRN to Angus McLeod on Sunday, September 10, 2006 01:12:00
    Angus McLeod wrote:
    Dunno what the uniquely identifying fields look like, but you could
    probably combine #2 and #3 into a Perl one-liner, or very close to it. --snip--
    My question is why anyone would use Python for *anything*, INCLUDING a "Hello, world!" program.

    See above, I don't care much for what I've seen of python, but it seems
    like a good newbie choice especially if a GUI front end is desired.

    I suggested Java or C# as a starter if this is the case though.. just my
    own opinion... for the data processing perl is probably a best bet, even
    for importing into a data store.. but as was mentioned it isn't an option.

    I know that Perl has been used to do things like this before, but Perl
    is not acceptable to the IT department.

    Well if you have a huge millstone tied around your neck, you'll find it
    much harder to swim. I'd be really interested to hear *why* your IT department has decided to ban Perl.

    Probably ignorance... just a guess..

    --
    Michael J. Ryan - tracker1(at)theroughnecks(dot)net - www.theroughnecks.net icq: 4935386 - AIM/AOL: azTracker1 - Y!: azTracker1 - MSN/Win: (email)

    ---
    þ Synchronet þ theroughnecks.net - you know you want it
  • From Belly@VERT/BRAZINET to Digital Noise on Sunday, September 10, 2006 12:39:00
    Re: Re: Python
    By: Digital Noise to Belly on Sat Sep 09 2006 06:09 pm

    You have no idea - 99.9% of our PPV buys are adult related.

    That one file has 8 channels in in, enough data for 30/31 days worth of even 24 hrs a day. There are another 4/5 files for the Adult-only channels as we

    Horny bastards, eh?


    o
    (O)
    BeLLy


    ---
    þ Synchronet
  • From Coriolanus@VERT/BEAGLE to Tracker1 on Sunday, September 10, 2006 21:27:00
    Re: Re: Python
    By: Tracker1 to Angus McLeod on Sun Sep 10 2006 01:12:00

    Angus McLeod wrote:
    Dunno what the uniquely identifying fields look like, but you could probably combine #2 and #3 into a Perl one-liner, or very close to it. --snip--
    My question is why anyone would use Python for *anything*, INCLUDING a "Hello, world!" program.

    See above, I don't care much for what I've seen of python, but it seems
    like a good newbie choice especially if a GUI front end is desired.

    I know that Perl has been used to do things like this before, but Perl
    is not acceptable to the IT department.

    Well if you have a huge millstone tied around your neck, you'll find it much harder to swim. I'd be really interested to hear *why* your IT department has decided to ban Perl.

    Probably ignorance... just a guess..

    Ignorance is right. Python is just as powerful (and dangerous) as
    Perl. The holy was between Perl and Python is mostly unfounded. Most
    anything you can do in one, you can do in the other. Sometimes, it's
    easier in Python, sometimes in Perl. Overall, the result is the same.

    Having said that, you could accomplsh what you need with any of the
    methods mentioned so far. I'm surprised no-one has said to use vim
    yet (also available for windows). ;-)

    --
    Coriolanus


    ---
    þ Synchronet þ The Wretched Beagle - beagle.synchro.net
  • From Angus McLeod@VERT/ANJO to Digital Noise on Sunday, September 10, 2006 23:44:00
    Re: Re: Python
    By: Digital Noise to Angus McLeod on Sun Sep 10 2006 01:14:00

    It would be nice to do do something like

    doit --titleid=53988

    but grep might do it.

    See, I have no problems with using tools like 'gawk' or 'grep' (assuming there was a Windows version of 'grep') to complete this task.

    Oh, you can get it alright. Go to

    http://unxutils.sourceforge.net/

    and grab the utilities and the latest updates. You will get gawk, agrep/, egrep/fgrep/grep, sed, cut, and a *mass* of others that may or may not be
    of use. You can also go to

    http://www.steve.org.uk/Software/bash/

    and get a copy of bash which should make scripting a bit easier than
    messing around writing .BATch files.
    ---
    Playing: "Easy" by "Fuel" from the "Something Like Human" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Angus McLeod@VERT/ANJO to Coriolanus on Monday, September 11, 2006 00:01:00
    Re: Re: Python
    By: Coriolanus to Tracker1 on Sun Sep 10 2006 21:27:00

    The holy was between Perl and Python is mostly unfounded.

    Let me address this "holy war" briefly: I have no time for a language
    that deliberately uses WHITESPACE as a significant syntactic element.
    That's the *DUMBEST* idea I've ever heard in in the entire world of
    Computer Science.

    ---
    Playing: "Slow" by "Fuel" from the "Something Like Human" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Deuce@VERT/SYNCNIX to Digital Noise on Sunday, September 10, 2006 13:22:00
    Re: Re: Python
    By: Digital Noise to Angus McLeod on Sun Sep 10 2006 01:14 am

    See, I have no problems with using tools like 'gawk' or 'grep' (assuming there was a Windows version of 'grep') to complete this task.

    It's just that I'm not the only one that does it (I do 95.9856% of the time), and it's a need that extends beyond me.

    Well, you can always create batch files or whatnot... but if your target luser are incapable of using the command-line, you'll needs something with super-cow powers. Probobly an Access "database" would be the quickest method.

    ---
    Wheeble.

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Deuce@VERT/SYNCNIX to Tracker1 on Sunday, September 10, 2006 13:24:00
    Re: Re: Python
    By: Tracker1 to Angus McLeod on Sun Sep 10 2006 01:12 am

    See above, I don't care much for what I've seen of python, but it seems
    like a good newbie choice especially if a GUI front end is desired.

    Hard to beat MS-Access for this... you can crank out a GUI for simple stuff like this in minutes. It's RAD stuff is the main reason it's used so often.

    ---
    Wheeble.

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Coriolanus@VERT/BEAGLE to Angus McLeod on Monday, September 11, 2006 17:39:00
    Re: Re: Python
    By: Angus McLeod to Coriolanus on Mon Sep 11 2006 00:01:00

    The holy was between Perl and Python is mostly unfounded.

    Let me address this "holy war" briefly: I have no time for a language
    that deliberately uses WHITESPACE as a significant syntactic element. That's the *DUMBEST* idea I've ever heard in in the entire world of
    Computer Science.

    I've seen a lot worse than that. It might be dumb, but it sure makes
    it less likely that you are going to write crappy code that is hard to
    read by the next poor sap that comes along.

    That's not to say that if there is a way to write crap code that is
    completely unreadable, someone will find it, no matter what the
    language imposes for formatting.

    The only thing that I have found where this can actually be a problem
    is if you have an editor that insists on handling your tabs for you.
    It is possible (and fairly easy) to get screwed up from that. That is
    probably the biggest issue I have seen with the indent/outdent model.

    Bottom line, try both. You may like one more than the other. I
    personally use both and have been happy with that. If the whitespace
    thing is too much of an issue for you, then don't use it, but don't
    piss all over it just because of that (unless you want to, of course).
    :-)

    --
    Coriolanus



    ---
    þ Synchronet þ The Wretched Beagle - beagle.synchro.net
  • From Angus McLeod@VERT/ANJO to Coriolanus on Monday, September 11, 2006 22:48:00
    Re: Re: Python
    By: Coriolanus to Angus McLeod on Mon Sep 11 2006 17:39:00

    Let me address this "holy war" briefly: I have no time for a language that deliberately uses WHITESPACE as a significant syntactic element. That's the *DUMBEST* idea I've ever heard in in the entire world of Computer Science.

    I've seen a lot worse than that. It might be dumb, but it sure makes
    it less likely that you are going to write crappy code that is hard to
    read by the next poor sap that comes along.

    So the language designers are trying to make *style* a part of the
    language definition. I will never support that. Some people like

    fn() { if () {
    } } else {
    }
    and other people prefer

    fn() if ()
    { {
    } } else
    {
    }
    while some like

    fn(){} if () {}
    else {}

    for small values of f() and simple if, and any attempt to force one or the other on the programmer is a BAD thing.
    ---
    Playing: "Tonite it shows" by "Mercury Rev"
    from the "Deserter's songs" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Tracker1@VERT/TRN to Deuce on Monday, September 11, 2006 20:40:00
    Deuce wrote:
    See above, I don't care much for what I've seen of python, but it seems
    like a good newbie choice especially if a GUI front end is desired.

    Hard to beat MS-Access for this... you can crank out a GUI for simple stuff like this in minutes. It's RAD stuff is the main reason it's used so often.

    very much agreed.. was in reference to being able to do other stuff as
    well... Access is a great tool for quick-n-dirty data work... even when connecting to an rdbms via odbc it works well...

    --
    Michael J. Ryan - tracker1(at)theroughnecks(dot)net - www.theroughnecks.net icq: 4935386 - AIM/AOL: azTracker1 - Y!: azTracker1 - MSN/Win: (email)

    ---
    þ Synchronet þ theroughnecks.net - you know you want it
  • From Deuce@VERT/SYNCNIX to Tracker1 on Tuesday, September 12, 2006 09:27:00
    Re: Re: Python
    By: Tracker1 to Deuce on Mon Sep 11 2006 08:40 pm

    Hard to beat MS-Access for this... you can crank out a GUI for simple stuff like this in minutes. It's RAD stuff is the main reason it's used so often.

    very much agreed.. was in reference to being able to do other stuff as well... Access is a great tool for quick-n-dirty data work... even when connecting to an rdbms via odbc it works well...

    It works and you can swap an interface together quickly. I would most definately not say that it works "well" though.

    However, if I want to grab som arbitrary data and sort/filter it, I'll reach for MS Access if I'm on a Win32 system.

    ---
    Wheeble.

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Artiken@VERT/ARTIKBRE to Angus McLeod on Tuesday, September 12, 2006 07:44:00
    Angus McLeod wrote:

    Re: Re: Python
    By: Coriolanus to Tracker1 on Sun Sep 10 2006 21:27:00

    The holy was between Perl and Python is mostly unfounded.

    Let me address this "holy war" briefly: I have no time for a language
    that deliberately uses WHITESPACE as a significant syntactic element. That's the *DUMBEST* idea I've ever heard in in the entire world of
    Computer Science.

    You must LOVE RPG-II. It is a great language if you like crossword
    puzzles. RPG-II code looked so much like a crossword puzzle. I did just
    enough to pass the class. And those 3270(whatever) data entry stations.
    8 inch floppies. ewww, I'm getting chills just remembering the
    antiquated stuff.

    Ok rant is over.
    So what do you think of RPG?

    After the class I wanted to take a real RPG and aim it at the IBM
    System-3 it ran on.

    Artiken

    ---
    þ Synchronet þ Artik Breeze BBS - Brookings, OR USA / artikbre.synchro.net
  • From Coriolanus@VERT/BEAGLE to Angus McLeod on Tuesday, September 12, 2006 13:41:00
    Re: Re: Python
    By: Angus McLeod to Coriolanus on Mon Sep 11 2006 22:48:00

    Let me address this "holy war" briefly: I have no time for a language that deliberately uses WHITESPACE as a significant syntactic element. That's the *DUMBEST* idea I've ever heard in in the entire world of Computer Science.

    I've seen a lot worse than that. It might be dumb, but it sure makes
    it less likely that you are going to write crappy code that is hard to read by the next poor sap that comes along.

    So the language designers are trying to make *style* a part of the
    language definition. I will never support that. Some people like

    fn() { if () {
    } } else {
    }
    and other people prefer

    fn() if ()
    { {
    } } else
    {
    }
    while some like

    fn(){} if () {}
    else {}


    And I tend to prefer:

    def fn(): if ():
    stuff stuff
    else
    more stuff


    for small values of f() and simple if, and any attempt to force one
    or the other on the programmer is a BAD thing.

    For what it's worth, this is an interesting discussion of what you can
    and can't do with Python indentation:

    http://www.secnetix.de/~olli/Python/block_indentation.hawk

    I do think Python is cleaner looking code without the extra curly
    braces, but that is my personal preference. I'm not so sure it's a
    travesty against computer science to use indent/outdent to define
    blocks of code. That is almost as arbitrary as using curly-braces to
    define the block. It is a means to an end, not something evil :-)

    --
    Coriolanus


    ---
    þ Synchronet þ The Wretched Beagle - beagle.synchro.net
  • From Corey@VERT/TSGC to Artiken on Tuesday, September 12, 2006 11:47:00
    Re: Re: Python
    By: Artiken to Angus McLeod on Tue Sep 12 2006 07:44 am

    Angus McLeod wrote:

    Re: Re: Python
    By: Coriolanus to Tracker1 on Sun Sep 10 2006 21:27:00

    The holy was between Perl and Python is mostly unfounded.

    Let me address this "holy war" briefly: I have no time for a language that deliberately uses WHITESPACE as a significant syntactic element. That's the *DUMBEST* idea I've ever heard in in the entire world of Computer Science.

    You must LOVE RPG-II. It is a great language if you like crossword
    puzzles. RPG-II code looked so much like a crossword puzzle. I did just enough to pass the class. And those 3270(whatever) data entry stations.
    8 inch floppies. ewww, I'm getting chills just remembering the
    antiquated stuff.

    Ok rant is over.
    So what do you think of RPG?

    After the class I wanted to take a real RPG and aim it at the IBM
    System-3 it ran on.

    Artiken


    my GF hated my Python, it ate her rabbit....

    This message has ended, go in peace...

    ---
    þ Synchronet þ Three Stooges Gentlemens Club - Las Vegas, Nv - tsgc.dyndns.org
  • From Deuce@VERT/SYNCNIX to Coriolanus on Tuesday, September 12, 2006 14:02:00
    Re: Re: Python
    By: Coriolanus to Angus McLeod on Tue Sep 12 2006 01:41 pm

    For what it's worth, this is an interesting discussion of what you can
    and can't do with Python indentation:

    http://www.secnetix.de/~olli/Python/block_indentation.hawk

    The only reason I hate the significant leading whitespace issue with Python is due exclusively to the tab/space war. In python you can, of course, use either one, but MIXING the two shall not be done.

    As everyone knows, tabs are for formatting.
    As everyone who has ever used proportional font s for anything knows, leading tabs are the ONLY way to line up text vertically.

    So, tabs should be used for lining up text.

    HOWEVER about 25% of the different ways that text is presented in a fixed-width font, when copied, will expand the tabs to spaces. For example, say I have PuTTY running with a connection to my home where I did some prototyping so I want to just copy/paste a couple choice code bits from there into my code at work. when using Python, I am *required* to reformat it to match the surrounding code... even if it already visually matches.

    In that last paragraph however, I purposely withheld vital information... I use four-char tabstops (thanks DM). If I used 8-char ones, it would still "work".

    Regarding the oft-quoted "It will look better" thing, the C construct:
    if (thing) {
    ...
    }
    else if (other_thing) {
    ...
    }
    else if (something_else) {
    ...
    }
    else {
    ...
    }

    Is quite a bit more readable than the correctly indented version:
    if (thing) {
    ...
    }
    else
    if(other_thing) {
    ...
    }
    else
    if (something_else) {
    ...
    }
    else {
    ...
    }

    Which I presume is what is REQUIRED by Python... unless Python includes perls hacktastic elsif thing and makes an if following an else illegal (as it is in perl)


    ---
    Wheeble.

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Belly@VERT/BRAZINET to Artiken on Tuesday, September 12, 2006 20:25:00
    Re: Re: Python
    By: Artiken to Angus McLeod on Tue Sep 12 2006 08:44 am

    You must LOVE RPG-II. It is a great language if you like crossword
    puzzles. RPG-II code looked so much like a crossword puzzle. I did just enough to pass the class. And those 3270(whatever) data entry stations.
    8 inch floppies. ewww, I'm getting chills just remembering the
    antiquated stuff.

    Ok rant is over.
    So what do you think of RPG?

    After the class I wanted to take a real RPG and aim it at the IBM
    System-3 it ran on.

    I have one IBM System-36 left at the office that hasn't been dismantled for recycling yet. You pay shipping, and you have a target :)


    o
    (O)
    BeLLy


    ---
    þ Synchronet
  • From Digital Man@VERT to Coriolanus on Tuesday, September 12, 2006 18:53:21
    Re: Re: Python
    By: Coriolanus to Angus McLeod on Tue Sep 12 2006 01:41 pm

    Re: Re: Python
    By: Angus McLeod to Coriolanus on Mon Sep 11 2006 22:48:00

    Let me address this "holy war" briefly: I have no time for a languag that deliberately uses WHITESPACE as a significant syntactic element. That's the *DUMBEST* idea I've ever heard in in the entire world of Computer Science.

    I've seen a lot worse than that. It might be dumb, but it sure makes it less likely that you are going to write crappy code that is hard to read by the next poor sap that comes along.

    So the language designers are trying to make *style* a part of the language definition. I will never support that. Some people like

    fn() { if () {
    } } else {
    }
    and other people prefer

    fn() if ()
    { {
    } } else
    {
    }
    while some like

    fn(){} if () {}
    else {}


    And I tend to prefer:

    def fn(): if ():
    stuff stuff
    else
    more stuff


    for small values of f() and simple if, and any attempt to force one
    or the other on the programmer is a BAD thing.

    For what it's worth, this is an interesting discussion of what you can
    and can't do with Python indentation:

    http://www.secnetix.de/~olli/Python/block_indentation.hawk

    I do think Python is cleaner looking code without the extra curly
    braces, but that is my personal preference. I'm not so sure it's a
    travesty against computer science to use indent/outdent to define
    blocks of code. That is almost as arbitrary as using curly-braces to
    define the block. It is a means to an end, not something evil :-)

    Well the whole spaces vs. tabs things just makes it impractical. Source files modified by different authors, editors, or computers, makes it impossible to be sure that no tabs are going to creep into the source files and confuse the parser/compiler. Just stupid design, imho.

    digital man

    Snapple "Real Fact" #104:
    There are more then 30,000 diets on public record.
    Norco, CA WX: 84.3øF, 34% humidity, 0 mph W wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Angus McLeod@VERT/ANJO to Artiken on Tuesday, September 12, 2006 15:40:00
    Re: Re: Python
    By: Artiken to Angus McLeod on Tue Sep 12 2006 07:44:00

    Let me address this "holy war" briefly: I have no time for a language that deliberately uses WHITESPACE as a significant syntactic element. That's the *DUMBEST* idea I've ever heard in in the entire world of Computer Science.

    You must LOVE RPG-II. It is a great language if you like crossword
    puzzles. RPG-II code looked so much like a crossword puzzle.

    I used RPG on System/3X for nearly 20 years. I know it well.

    Ok rant is over.
    So what do you think of RPG?

    It sucks worse than Python!
    ---
    Playing: "Androgyny" by "Garbage" from the "beautifulgarbage" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Angus McLeod@VERT/ANJO to Coriolanus on Tuesday, September 12, 2006 16:02:00
    Re: Re: Python
    By: Coriolanus to Angus McLeod on Tue Sep 12 2006 13:41:00

    And I tend to prefer:

    def fn(): if ():
    stuff stuff
    else
    more stuff

    I tend to prefer having a choice.

    For what it's worth, this is an interesting discussion of what you can
    and can't do with Python indentation:

    http://www.secnetix.de/~olli/Python/block_indentation.hawk

    Interesting, but the basic premise is that I *should* like syntactic whitespace because it's GOOD for me. Twoddle!

    I do think Python is cleaner looking code without the extra curly
    braces, but that is my personal preference.

    Ok, so you don't like the use off braces for block-scoping the source.
    Fair enough. There are a host of other options, such as:

    if (foo) if (foo)
    (block) begin
    else (block)
    (block) end
    end_if; /* or 'fi' */ else
    begin
    (block)
    end;

    But to tell you the truth, sometimes I like

    while (condition) do block done ;

    and sometimes I like

    while (condition) { block } ;

    and sometimes I like

    while (condition) block end_while ;

    but indentation don't work for me. Look at this code:

    if foo:
    if bar:
    do_red();
    else:
    do_blue();

    that else: clause is a single TAB character away from disaster.

    I'm not so sure it's a travesty against computer science to use indent/outdent to define blocks of code. That is almost as arbitrary as using curly-braces to define the block. It is a means to an end, not something evil :-)

    It's nearly as bad as Microsoft's habit of re-justifying and
    re-capitalizing code fragments, as in VBA, and so forth. It is possible
    to make something worse. I've seen compilers that required keywords to be
    in a special emphasis (like BOLD or /italic/) or even in a special colour.

    I once used an Algol-68 compiler that required the keywords be underlined! The keywords had to be typed as follows:

    IF = I, Backspace, Underscore, F, Backspace, Underscore.
    or IF = I, F, Backspace, Backspace, Underscore, Underscore.

    I did some work on the parser for that compiler and let me tell you, the lexical scanner was an absolute trip!





    ---
    Playing: "Breaking up the girl " by "Garbage"
    from the "beautifulgarbage" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Coriolanus@VERT/BEAGLE to Deuce on Tuesday, September 12, 2006 20:13:00
    Re: Re: Python
    By: Deuce to Coriolanus on Tue Sep 12 2006 14:02:00

    and can't do with Python indentation:

    http://www.secnetix.de/~olli/Python/block_indentation.hawk

    The only reason I hate the significant leading whitespace issue with
    Python is due exclusively to the tab/space war. In python you can,
    of course, use either one, but MIXING the two shall not be done.

    As everyone knows, tabs are for formatting. As everyone who has
    ever used proportional font s for anything knows, leading tabs are
    the ONLY way to line up text vertically.

    So, tabs should be used for lining up text.

    HOWEVER about 25% of the different ways that text is presented in a fixed-width font, when copied, will expand the tabs to spaces. For
    example, say I have PuTTY running with a connection to my home where
    I did some prototyping so I want to just copy/paste a couple choice
    code bits from there into my code at work. when using Python, I am *required* to reformat it to match the surrounding code... even if
    it already visually matches.

    Mixed tabs/spaces is ugly for just about every language, but it _does_
    have the more potent runtime side-effects in python, while other
    languages will just _look_ worse in this situation. One is an
    execution issue, the other is a visual issue when trying to decypher
    code with odd indents. I am personally in the habit of using spaces
    only for ALL code that I write for just those reasons. I have had too
    many incidents where mixed whitespace has caused weird debugging
    issues.

    Python does have the runtime flag -t and -tt to help generate a
    warning or error if mixed tabs/spaces confuse it. Admittedly, I have
    never used it since all my code is spaces only.

    In that last paragraph however, I purposely withheld vital
    information... I use four-char tabstops (thanks DM). If I used
    8-char ones, it would still "work".

    Me too :-)

    Regarding the oft-quoted "It will look better" thing, the C
    construct:
    if (thing) {
    ...
    }
    else if (other_thing) {
    ...
    }
    else if (something_else) {
    ...
    }
    else {
    ...
    }

    Is quite a bit more readable than the correctly indented version:
    if (thing) {
    ...
    }
    else
    if(other_thing) {
    ...
    }
    else
    if (something_else) {
    ...
    }
    else {
    ...
    }

    Which I presume is what is REQUIRED by Python... unless Python
    includes perls hacktastic elsif thing and makes an if following an
    else illegal (as it is in perl)

    Not at all. Python has elif, hack or not, you decide :-)

    if (thing) {
    ...
    }
    else if (other_thing) {
    ...
    }
    else if (something_else) {
    ...
    }
    else {
    ...
    }

    becomes

    if (thing):
    ...
    elif (other_thing):
    ...
    elif (something_else):
    ...
    else:
    ...

    --
    Coriolanus


    ---
    þ Synchronet þ The Wretched Beagle - beagle.synchro.net
  • From Digital Man@VERT to Deuce on Tuesday, September 12, 2006 18:56:45
    Re: Re: Python
    By: Deuce to Coriolanus on Tue Sep 12 2006 02:02 pm

    Re: Re: Python
    By: Coriolanus to Angus McLeod on Tue Sep 12 2006 01:41 pm

    For what it's worth, this is an interesting discussion of what you can and can't do with Python indentation:

    http://www.secnetix.de/~olli/Python/block_indentation.hawk

    The only reason I hate the significant leading whitespace issue with Python due exclusively to the tab/space war. In python you can, of course, use eit one, but MIXING the two shall not be done.

    As everyone knows, tabs are for formatting.
    As everyone who has ever used proportional font s for anything knows, leadin tabs are the ONLY way to line up text vertically.

    So, tabs should be used for lining up text.

    HOWEVER about 25% of the different ways that text is presented in a fixed-wi font, when copied, will expand the tabs to spaces. For example, say I have PuTTY running with a connection to my home where I did some prototyping so I want to just copy/paste a couple choice code bits from there into my code at work. when using Python, I am *required* to reformat it to match the surrounding code... even if it already visually matches.

    In that last paragraph however, I purposely withheld vital information... I four-char tabstops (thanks DM). If I used 8-char ones, it would still "work

    Regarding the oft-quoted "It will look better" thing, the C construct:
    if (thing) {
    ...
    }
    else if (other_thing) {
    ...
    }
    else if (something_else) {
    ...
    }
    else {
    ...
    }

    Is quite a bit more readable than the correctly indented version:
    if (thing) {
    ...
    }
    else
    if(other_thing) {
    ...
    }
    else
    if (something_else) {
    ...
    }
    else {
    ...
    }

    Which I presume is what is REQUIRED by Python... unless Python includes perl hacktastic elsif thing and makes an if following an else illegal (as it is i perl)

    I don't think Python supports the curly braces, so it'd be:

    if (thing)
    ...
    else
    if(other_thing)
    ...
    else
    if(something_else)
    ....

    But since I don't really know Python, I'm just guessing. :-)

    digital man

    Snapple "Real Fact" #65:
    A one-day weather forecast requires about 10 billion math calculations.
    Norco, CA WX: 84.3øF, 34% humidity, 0 mph W wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Deuce@VERT/SYNCNIX to Coriolanus on Tuesday, September 12, 2006 20:35:00
    Re: Re: Python
    By: Coriolanus to Deuce on Tue Sep 12 2006 08:13 pm

    Which I presume is what is REQUIRED by Python... unless Python
    includes perls hacktastic elsif thing and makes an if following an
    else illegal (as it is in perl)

    if (thing):
    ...
    elif (other_thing):
    ...
    elif (something_else):
    ...
    else:
    ...

    So, is an if following an else a syntax error (as in perl)?


    ---
    Wheeble.

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Angus McLeod@VERT/ANJO to Digital Man on Tuesday, September 12, 2006 23:45:00
    Re: Re: Python
    By: Digital Man to Coriolanus on Tue Sep 12 2006 18:53:00

    Well the whole spaces vs. tabs things just makes it impractical. Source file modified by different authors, editors, or computers, makes it impossible to sure that no tabs are going to creep into the source files and confuse the parser/compiler. Just stupid design, imho.

    The worst thing is when you have some nicely tab-indented code on your
    screen. You cut'n'paste a fragment, but the process converts all tabs to spaces in the pasted section. *BLAMO!* Your program justb exploded.


    ---
    Playing: "The prisoner" by "Iron Maiden"
    from "The Number of the Beast" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Coriolanus@VERT/BEAGLE to Angus McLeod on Tuesday, September 12, 2006 22:05:00
    Re: Re: Python
    By: Angus McLeod to Coriolanus on Tue Sep 12 2006 16:02:00

    Ok, so you don't like the use off braces for block-scoping the source.
    Fair enough. There are a host of other options, such as:

    if (foo) if (foo)
    (block) begin
    else (block)
    (block) end
    end_if; /* or 'fi' */ else
    begin
    (block)
    end;

    Ok, now that's just silly. I would rather have {} than use begin/end.
    That is a lot of extraneous typing with no good purpose. I never said
    I don't like braces, I was just pointing out the minimal typing to
    generate readable code.

    But to tell you the truth, sometimes I like

    while (condition) do block done ;

    and sometimes I like

    while (condition) { block } ;

    and sometimes I like

    while (condition) block end_while ;

    All of these are almost identical in structure with Python, too.

    but indentation don't work for me. Look at this code:

    if foo:
    if bar:
    do_red();
    else:
    do_blue();

    that else: clause is a single TAB character away from disaster.

    Fair enough, but at least it will be a _readable_ bug ;-)

    I once used an Algol-68 compiler that required the keywords be underlined! The keywords had to be typed as follows:

    IF = I, Backspace, Underscore, F, Backspace, Underscore.
    or IF = I, F, Backspace, Backspace, Underscore, Underscore.

    I did some work on the parser for that compiler and let me tell you, the lexical scanner was an absolute trip!

    I don't even know what to say to that. Ugh!

    --
    Coriolanus


    ---
    þ Synchronet þ The Wretched Beagle - beagle.synchro.net
  • From Angus McLeod@VERT/ANJO to Coriolanus on Wednesday, September 13, 2006 08:19:00
    Re: Re: Python
    By: Coriolanus to Angus McLeod on Tue Sep 12 2006 22:05:00

    if (foo) if (foo)
    (block) begin
    else (block)
    (block) end
    end_if; /* or 'fi' */ else
    begin
    (block)
    end;

    Ok, now that's just silly. I would rather have {} than use begin/end.
    That is a lot of extraneous typing with no good purpose.

    So would I. But begin/end is how it's done in Pascal, so it isn't like it would never work.

    I was just pointing out the minimal typing to generate readable code.

    Hey, I like perl! :-) I'd probably have liked APL if it hadn't required
    a special keyboard <shudder!>

    but indentation don't work for me. Look at this code:

    if foo:
    if bar:
    do_red();
    else:
    do_blue();

    that else: clause is a single TAB character away from disaster.

    Fair enough, but at least it will be a _readable_ bug ;-)

    Thing is, a missing TAB like shown in this example here:

    if (foo) { if (foo) {
    if (bar) { if (bar) {
    do_red(); do_red();
    } else { } else {
    do_blue(); do_blue();
    } }
    } }

    doesn't cause the spaceship to crash. And if one of the braces goes
    missing instead of a TAB, you don't get a silent logic-bug. You get a
    program that won't run and a compiler that popints you directly to the problem.

    I once used an Algol-68 compiler that required the keywords be underlined! The keywords had to be typed as follows:

    IF = I, Backspace, Underscore, F, Backspace, Underscore.
    or IF = I, F, Backspace, Backspace, Underscore, Underscore.

    I did some work on the parser for that compiler and let me tell you, the lexical scanner was an absolute trip!

    I don't even know what to say to that. Ugh!

    Just had a quick look at the Algol 68 Wikipedia page, and it lists the
    very environment I used. Algol 68R under GEORGE 3 in an ICL 1900 series mainframe. :-) I also note there is an GNU version called ALgol 68G, and
    I'm pleased to learn about it because now I know to keep far away from it!
    ---
    Playing: "Flowers In The Window" by "Travis"
    from "The Invisible Band" album
    þ Synchronet þ Programatically generated on The ANJO BBS
  • From Mortifis@VERT/EMPTYKEG to All on Sunday, December 09, 2018 13:40:34
    Anyone into Python? I have a few questions relating to nested loops

    Thanks

    ---
    þ Synchronet þ The Empty Keg BBS emptykeg.synchro.net:82 Lake Echo NS Canada
  • From Nightfox@VERT/DIGDIST to Mortifis on Sunday, December 09, 2018 18:11:39
    Re: Python
    By: Mortifis to All on Sun Dec 09 2018 01:40 pm

    Anyone into Python? I have a few questions relating to nested loops

    I've done a bit of Python for work.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Minex@VERT/TDOD to Mortifis on Sunday, December 09, 2018 15:19:24
    Re: Python
    By: Mortifis to All on Sun Dec 09 2018 01:40 pm

    Anyone into Python? I have a few questions relating to nested loops

    Ask away. I'm curious what your question is.

    The Dawn of Demise BBS (tdod.org)

    ---
    þ Synchronet þ The Dawn of Demise (tdod.org:5000)
  • From Mortifis@VERT/EMPTYKEG to Nightfox on Monday, December 10, 2018 10:35:13
    Re: Python
    By: Mortifis to All on Sun Dec 09 2018 01:40 pm

    Anyone into Python? I have a few questions relating to nested loops

    I've done a bit of Python for work.

    Seems Python is very finicky about use of proper indentation :/ I am (trying) to code some random light sequences for use with my Raspberry Pi, mostly works, however, when I try to set a while ... for ... try while ... blah blah blah it complains about indentation. when I remove the first x = 0 ... while x < cycle: x = x + 1 it seems to work correctly.

    here is my spaghetti code:

    #!/usr/bin/python
    import RPi.GPIO as GPIO
    import time
    import random
    import mutagen.mp3
    import sys

    GPIO.setmode(GPIO.BCM)
    GPIO.setwarnings(False)

    # init list with pin numbers
    seq0 = [2, 3, 4, 17, 27, 22, 10, 9] # RPI GPIO PINS
    seq1 = [3, 17, 22, 9]
    seq2 = [2, 4, 27, 10]
    seq3 = [2, 9, 3, 10, 4, 22, 17, 27, 27, 17, 22, 4, 10, 3, 9, 2]

    from random import randint
    rand = random.randint(0, 3)

    mP3 = sys.argv[1]

    from mutagen.mp3 import MP3
    audio = MP3(mP3)
    cycle = int(audio.info.length)
    print ' Playing ', mP3, ' for ', cycle, 'seconds'

    if mP3 == "letitgo.mp3":
    rand = 1 # speeds timing up
    SleepTimeS = 0.2
    SleepTimeL = 0.1
    else:
    SleepTimeS = 1.2 # normal speed
    SleepTimeL = 0.2

    if rand == 0: seq = seq0
    if rand == 1: seq = seq1
    if rand == 2: seq = seq2
    if rand == 3: seq = seq3

    x = 0
    while x < cycle:
    x = x + 1

    for i in seq:
    GPIO.setup(i, GPIO.OUT)
    GPIO.output(i, GPIO.HIGH)

    # main loop

    try:
    while True:

    for i in seq:
    GPIO.output(i, GPIO.LOW)
    time.sleep(SleepTimeS);
    GPIO.output(i, GPIO.HIGH)
    time.sleep(SleepTimeS);
    GPIO.output(i, GPIO.LOW)
    time.sleep(SleepTimeS);
    GPIO.output(i, GPIO.HIGH)
    time.sleep(SleepTimeL);

    except KeyboardInterrupt:
    print " Quit"

    GPIO.cleanup()

    ---
    þ Synchronet þ The Empty Keg BBS emptykeg.synchro.net:82 Lake Echo NS Canada
  • From Mortifis@VERT/EMPTYKEG to Minex on Monday, December 10, 2018 11:37:55
    Re: Python
    By: Mortifis to All on Sun Dec 09 2018 01:40 pm

    Anyone into Python? I have a few questions relating to nested loops

    Ask away. I'm curious what your question is.

    My question is about indentation and nested loops ... seems at times I get syntax error as well (x += 1) . I can paste the code if you are a good reader :-P the code I pasted to Nightfox works except that it does loop through the while x < cycle: as a main counter.

    What is need is a counter so that the GPIO pins blink only for the length of an mp3 then automagically shutdown when the song is over

    In the code I pasted to Nightfox the lights blink until ^C is hit

    ---
    þ Synchronet þ The Empty Keg BBS emptykeg.synchro.net:82 Lake Echo NS Canada
  • From echicken@VERT/ECBBS to Mortifis on Monday, December 10, 2018 11:12:41
    Re: Re: Python
    By: Mortifis to Minex on Mon Dec 10 2018 11:37:55

    What is need is a counter so that the GPIO pins blink only for the length of an mp3 then automagically shutdown when the song is over

    What value does audio.info.length represent? Duration of the song in seconds / milliseconds / something else? File size?

    I doubt if a counter is the right way to go. Seems like you could store the start time prior to entering the loop, and then make your While condition something like 'current_time - start_time < song_duration', so that the loop breaks once that amount of time has passed.

    In the code I pasted to Nightfox the lights blink until ^C is hit

    As expected, I assume.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Mortifis@VERT/EMPTYKEG to Nightfox on Monday, December 10, 2018 12:16:31
    Re: Python
    By: Mortifis to All on Sun Dec 09 2018 01:40 pm

    Anyone into Python? I have a few questions relating to nested loops

    I've done a bit of Python for work.

    I appreciate you looking in this for me, I think I figured out the correct loop usage I need, python is soooo F$%&'n finicky -;P:

    #!/usr/bin/python
    import RPi.GPIO as GPIO
    import time
    import random
    import mutagen.mp3
    import sys

    GPIO.setmode(GPIO.BCM)
    GPIO.setwarnings(False)

    # init list with pin numbers
    seq0 = [2, 3, 4, 17, 27, 22, 10, 9] # RPI GPIO PINS
    seq1 = [3, 17, 22, 9]
    seq2 = [2, 4, 27, 10]
    seq3 = [2, 9, 3, 10, 4, 22, 17, 27, 27, 17, 22, 4, 10, 3, 9, 2]

    from random import randint
    rand = random.randint(0, 3)

    mP3 = sys.argv[1]

    from mutagen.mp3 import MP3
    audio = MP3(mP3)
    cycle = int(audio.info.length)
    print ' Playing ', mP3, ' for ', cycle, 'seconds'

    if mP3 == "letitgo.mp3":
    rand = 1 # speeds timing up
    SleepTimeS = 0.2
    SleepTimeL = 0.1
    else:
    SleepTimeS = 1.2 # normal speed
    SleepTimeL = 0.2

    if rand == 0: seq = seq0
    if rand == 1: seq = seq1
    if rand == 2: seq = seq2
    if rand == 3: seq = seq3

    x = 0
    while x < cycle:
    x = x + 1

    for i in seq:
    GPIO.setup(i, GPIO.OUT)
    GPIO.output(i, GPIO.HIGH)

    # main loop

    try:
    while True and x < cycle:

    for i in seq:
    GPIO.output(i, GPIO.LOW)
    time.sleep(SleepTimeS);
    GPIO.output(i, GPIO.HIGH)
    time.sleep(SleepTimeS);
    GPIO.output(i, GPIO.LOW)
    time.sleep(SleepTimeS);
    GPIO.output(i, GPIO.HIGH)
    time.sleep(SleepTimeL);
    # 4 seconds to cycle loop
    x = int(x + ((SleepTimeS + SleepTimeL) * 3))

    except KeyboardInterrupt:
    print " Quit"

    GPIO.cleanup()

    ---
    þ Synchronet þ The Empty Keg BBS emptykeg.synchro.net:82 Lake Echo NS Canada
  • From Mortifis@VERT/EMPTYKEG to echicken on Monday, December 10, 2018 15:13:06
    Re: Re: Python
    By: Mortifis to Minex on Mon Dec 10 2018 11:37:55

    What is need is a counter so that the GPIO pins blink only for the length of an mp3 then automagically shutdown when the song is over

    What value does audio.info.length represent? Duration of the song in seconds / milliseconds / something else? File size?

    yes, audo.info.length is the time of the mp3 in seconds, int(audio.info.length) makes it a whole number


    I doubt if a counter is the right way to go. Seems like you could store the start time prior to entering the loop, and then make your While condition something like 'current_time - start_time < song_duration', so that the loop breaks once that amount of time has passed.

    isn't that just a counter of sorts as well? I discover the error of my ways, I was putting an unnecessary while: ahead of everything, the easy-for-me solution to self-terminate when the song finished playing was

    mP3 = sys.argv[1]

    from mutagen.mp3 import MP3
    audio = MP3(mP3)
    cycle = int(audio.info.length)

    x = 0

    for i in seq:
    GPIO.setup(i, GPIO.OUT)
    GPIO.output(i, GPIO.HIGH)
    seq.reverse()

    try:
    while True and x < cycle:

    for i in seq:
    GPIO.output(i, GPIO.LOW)
    time.sleep(SleepTimeS);
    GPIO.output(i, GPIO.HIGH)
    time.sleep(SleepTimeS);
    GPIO.output(i, GPIO.LOW)
    time.sleep(SleepTimeS);
    GPIO.output(i, GPIO.HIGH)
    time.sleep(SleepTimeL);
    # 4 seconds to cycle loop
    x = int(x + ((SleepTimeS + SleepTimeL) * 3.5))

    ---
    þ Synchronet þ The Empty Keg BBS emptykeg.synchro.net:82 Lake Echo NS Canada
  • From echicken@VERT/ECBBS to Mortifis on Monday, December 10, 2018 15:32:43
    Re: Re: Python
    By: Mortifis to echicken on Mon Dec 10 2018 15:13:06

    isn't that just a counter of sorts as well?

    Sure, as much as any clock is a counter incrementing with the passage of time. I don't mean that "using a counter" is inherently bad, just that there's a more straightforward approach that also lets you ditch a magic number.

    Doesn't matter, you'll achieve the same result in the end.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Nightfox@VERT/DIGDIST to Mortifis on Monday, December 10, 2018 19:13:08
    Re: Re: Python
    By: Mortifis to Nightfox on Mon Dec 10 2018 12:16 pm

    I appreciate you looking in this for me, I think I figured out the correct loop usage I need, python is soooo F$%&'n finicky -;P:

    Good to hear you may have figured it out.

    Yeah, Python has strict rules about indentation. Instead of using curly braces to mark blocks of code like other languages, all the lines in a block of code in Python must be indented the same way (same number of spaces or tabs).

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Mortifis@VERT/EMPTYKEG to echicken on Tuesday, December 11, 2018 10:59:11
    Re: Re: Python
    By: Mortifis to echicken on Mon Dec 10 2018 15:13:06

    isn't that just a counter of sorts as well?

    Sure, as much as any clock is a counter incrementing with
    the passage of
    time. I don't mean that "using a counter" is inherently
    bad, just that
    there's a more straightforward approach that also lets you
    ditch a magic
    number.

    Doesn't matter, you'll achieve the same result in the end.

    I prefer straightforward approaches, I just started looking
    at Python and am not very familiar with the structure and
    functions.

    ---
    þ Synchronet þ The Empty Keg BBS emptykeg.synchro.net:82 Lake Echo NS Canada
  • From Mortifis@VERT/EMPTYKEG to Nightfox on Tuesday, December 11, 2018 11:01:11
    Re: Re: Python
    By: Mortifis to Nightfox on Mon Dec 10 2018 12:16 pm

    I appreciate you looking in this for me, I think I
    figured out the
    correct loop usage I need, python is soooo F$%&'n
    finicky -;P:

    Good to hear you may have figured it out.

    Yeah, Python has strict rules about indentation. Instead
    of using curly
    braces to mark blocks of code like other languages, all the
    lines in a block
    of code in Python must be indented the same way (same
    number of spaces or
    tabs).

    So much for being a lazy spaghetti coder with python lol

    ---
    þ Synchronet þ The Empty Keg BBS emptykeg.synchro.net:82 Lake Echo NS Canada
  • From Kirkman@VERT/GUARDIAN to Nightfox on Tuesday, December 11, 2018 21:26:40
    Re: Re: Python
    By: Nightfox to Mortifis on Mon Dec 10 2018 07:13 pm

    Yeah, Python has strict rules about indentation. Instead of using curly braces to mark blocks of code like other languages, all the lines in a block of code in Python must be indented the same way (same number of spaces or tabs).

    This is something I love about Python, personally.

    Make sure you don't mix spaces and tabs for indentation in your code, or Python will likely complain.

    --Josh

    ////--------------------------------------------------
    BiC -=- http://breakintochat.com -=- bbs wiki and blog

    ---
    þ Synchronet
  • From Nightfox@VERT/DIGDIST to Kirkman on Friday, December 14, 2018 17:30:46
    Re: Re: Python
    By: Kirkman to Nightfox on Tue Dec 11 2018 09:26 pm

    This is something I love about Python, personally.

    Make sure you don't mix spaces and tabs for indentation in your code, or Python will likely complain.

    I like that it helps keep code consistent, but one downside that bugs me is that text editors often assume you want to continue your indented code block in Python, and Python doesn't use curly braces, which text editors often use with other languages to know when you're done with a code block. In other languages, text editors can even know you're done with a one-line block of code without curly braces since that's how other programming languages work.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Mortifis@VERT/EMPTYKEG to Nightfox on Saturday, December 15, 2018 11:44:34
    Re: Re: Python
    By: Kirkman to Nightfox on Tue Dec 11 2018 09:26 pm

    This is something I love about Python, personally.

    Make sure you don't mix spaces and tabs for indentation in your code, or Python will likely complain.

    I like that it helps keep code consistent, but one downside that bugs me is that text editors often assume you want to continue your indented code block in Python, and Python doesn't use curly braces, which text editors often use with other languages to know when you're done with a code block. In other languages, text editors can even know you're done with a one-line block of code without curly braces since that's how other programming languages work.

    I keep running into unexpected indent or unexpected unindent when using nested loops and such, which is obviously my lack of understanding of Python. Another problem I keep running into is, for example, x = x + 1 or x += 1 ... syntax error. I won't paste my troubled code but Python is definitely a finicky language

    ---
    þ Synchronet þ The Empty Keg BBS emptykeg.synchro.net:82 Lake Echo NS Canada
  • From Fireball@VERT/FBEX to Mortifis on Monday, January 28, 2019 23:40:12
    I keep running into unexpected indent or unexpected unindent when using nested loops and such, which is obviously my lack of understanding of Python. Another problem I keep running into is, for example, x = x + 1 or x += 1 ... syntax error. I won't paste my troubled code but Python is definitely a finicky language

    I don't know what you're using for an editor, but it's not working for you. NotePad++, Visual Studio Code, PyCharm, and Sublime Text will all help with syntax, formatting, and beautification. You will most likely need to install plugins to make them work with python code, but a good editor always helps.

    Fireball

    ---
    þ Synchronet þ My Brand-New BBS