Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Code won't run | No terminal error | Help if possible?

Hello, bit of a weird issue. I have written some code in Sublime text 3 and when trying to run in terminal it displays something for literally a micro second and stops running.

Here is a preview of the code:

htt ps://gyazo.com/97d4d389c53085163b4ba1acb612a42e

Edit: I would really appreciate some help - I have a deadline :(
Could you show me a screenshot of the error you are getting?
No error. The code seems to run, do nothing then stop
So your terminal looks like the example below after running?

user@host~$ python test.py
user@host~$
Yes. Looks exactly like that.

Exactly: python test.py testerrors.xls output.txt 1.6
Could you try to put a print command before checkData() and in both for loops?
Scrap that issue seemed to resolve it. New one now!

Terminal output:

Traceback (most recent call last):
File "test.py", line 43, in <module>
handleCommandlineArgs()
File "test.py", line 23, in handleCommandlineArgs
checkData()
File "test.py", line 32, in checkData
numtoalpha = dict(zip(range(0, 26), string.ascii_lowecase))
AttributeError: 'module' object has no attribute 'ascii_lowecase'
You spelt lower_case wrong. Replace it with string.ascii_lowercase


Hope everyone has a wonderful day!
I has a typo. It should say string.asci_lowercase 🙂
Thank you very much guys I do appriceate it


Last quick question. Do you have any idea why my prints are not printing out in the statement. You can see it is saying '2.0, 2.0, 2.0' etc. However it should be saying 'hello 2.0, hello 2.0'

ht tps://gyazo.com/addd53a39a3b13cf1982ad51d38690b3
ht tps://gyazo.com/4cf0cf0e9189df191fc486bed3f19201
From what I can see is that if the column is 1 then it will print out something like:
hello
Found: 2.0
Since they're in different print statements. Otherwise, it will just print:
Found: 2.0


Hope everyone has a wonderful day!
You really, really should not be using globals like that. Global variables should not be initialized in functions.
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by MilkMar 13, 2022 03:46 PM 4 133 Mar 13, 2022 03:46 PM
Last Post: #Kat
[C#] by CrakxprooJun 21, 2018 01:25 PM 7 235 Jun 21, 2018 01:25 PM
Last Post: Electron
[Python] by DrollBeack18100Feb 17, 2018 02:06 AM 6 263 Feb 17, 2018 02:06 AM
Last Post: DrollBeack18100