You are not logged in.

#1 2018-04-30 23:06:30

jbenge1
Member
From: Az
Registered: 2018-04-09
Posts: 151

[SOLVED]Python3 Differing output between machines

I am a TA at my University and I have been grading projects the past few days and I've run into a weird issue with python in that it replaces numbers the letters 'b' and 'm'. For example running the students code I should be ending up with something that looks like a guitar tab

example expected output

e | ---3------------
B | ---------4------
G | ---------------7
D | ------------1---
A | ------2--------
E | 1--------------

but instead I end up with

e | ---b------------
B | ---------m------
G | ---------------b
D | ------------b---
A | ------m--------
E | b--------------

It happens on all the student code and on my other machines it works fine and as expected. I can't (due to privacy issues) post any student code but if it helps I can roughly walk you through it if need be. I am wondering why this would be happening though.

Last edited by jbenge1 (2018-05-02 18:08:05)


"Dr. Madden, why don't the natural numbers include 0?" -me
"....... Take a philosophy course" -Dr. Madden

Offline

#2 2018-04-30 23:35:37

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,721

Re: [SOLVED]Python3 Differing output between machines

Not much to go on.  Are the locales set properly?  Is something changing the character encoding?
Is the code depending upon a dictionary?  Does the code make assumptions about the order of entries in a dictionary?
Why not use pdb and breakpoint the code at the instruction that is printing the offending character and take a look at the data structures?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2018-05-01 00:51:01

NoSuck
Member
Registered: 2015-03-04
Posts: 157
Website

Re: [SOLVED]Python3 Differing output between machines

I'm more concerned with the size and shape of these guitar players' hands.

Offline

#4 2018-05-01 15:07:05

Alber
Member
From: Spain - España
Registered: 2011-11-11
Posts: 227

Re: [SOLVED]Python3 Differing output between machines

Following the ewaller's ideas:
  Could be how the editor encode the file?
  Could be trying to run Python 2?
    # -*- coding: utf-8 -*-

It is curious that odd numbers are 'b' and the even 'm'.


Because not all of us are native English speakers, try no to use slang or abbreviations, thank you.

Offline

#5 2018-05-01 23:32:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: [SOLVED]Python3 Differing output between machines

jbenge1 wrote:

I can't (due to privacy issues) post any student code...

Can you replicate any part of the problem with your own similar code that you could share?

Or can you at least give the single line of code that actually prints the output?  Are format strings used?  If so, which one of the many variations?  Is a dict of variables and/or the local variables interpolated into a format string?

Last edited by Trilby (2018-05-01 23:34:42)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2018-05-02 20:04:27

headkase
Member
Registered: 2011-12-06
Posts: 2,004

Re: [SOLVED]Python3 Differing output between machines

OP, you have your thread marked "solved" but there is no given solution in it.

See the: Code of Conduct, specifically: Life is a two-way street when giving and receiving help.

Offline

Board footer

Powered by FluxBB