Downloaded script doesn't work?


I am completely new to Python and would like to request assistance please.

I am attempting to run an open-source script which is designed to download transaction details from wallets on the Algorand cryptocurrency blockchain.

Instructions on how to use the script are contained within the script itself. The download site also includes this instruction;

“Simply update the wallet variable with the wallet address(es) you’re interested in, and then run the script.”

It is not clear to me where I should insert my own wallet address. The script already contains two sample wallet addresses, so I thought that substituting one of these with my own address might work, but it does not. In fact, even when I leave the script unmolested, it will not download information from the sample wallet addresses. When I click on the script and choose to open it with Python 3 (which is installed on my Windows 10 system) the only result is that my monitor screen flickers for a moment, as if something is happening, but no download occurs.

I attempted to copy the script into this post, but I received an error message from the site stating that new users cannot put more than two links into a post. I can therefore only refer anyone who might be able to help to the download site for the script;

I would be very grateful if someone could tell me how to make the script work. Any advice would be appreciated.

Thank you.

The wallet address are there as examples. As it says in the comment above it, “they are here to demo the code only”. You should put your wallet address(es) there, replacing what’s there.

If you’re running the script by double-clicking on it, then it should open in a window, do its work, and then close.

At the top are some imports when it, well, import some modules. Some of them are part of the standard library, so you’ll already have them, but you might not have pandas, requests or numpy as they’re not
part of the standard library.

It sounds like it’s a case of you doubling-clicking on it, the window opens, it can’t find a module, it prints an error message, it quits, the window closes, all in less than a second!

You need to install Pandas.

Assuming you’re on Windows:

  • Open a Command Prompt window
  • Type: py -m pip install pandas
1 Like

This is not a recommended way to attempt running Python scripts unless you know they have been designed for it. The problem is that Python scripts normally are intended to work by displaying messages in a terminal window; when you ask Windows to open a file with some command-line program (such as python.exe), it will create a new terminal window for that program and then automatically clean it up when the program ends.

If something goes wrong immediately when the script runs (in particular, an uncaught exception), generally this will cause the script to abort, which causes Python to quit (because it has no more work to do), which causes the window to disappear (because it has no more reason to exist, from Windows’ perspective). This means that you will not get a chance to read any error message.

Instead, use a cmd window to run the script.

My guess is that the problem occurred because this script tries to use the Pandas third-party library, but you do not have it installed. If you see the error message, this should make itself clear.

1 Like

Thanks, guys; very helpful comments.

I have installed Pandas and Requests (Numpy was installed when I installed Pandas). Pandas, Requests and Numpy are now listed as installed modules in Python, and the executables are located in directories which are listed in sys.path.

However, when I run the script from a command prompt I still receive an error message;
“SyntaxError: unexpected character after line continuation character”

Presumably this means what it says; there is an error in the script?

Any advice would be appreciated.

A line continuation character is a backslash (\).

As an example, here’s the same code with and without said:

for x \
        in range(100):


for x in range(100):

So, just look for the backslash and you should be able to see where the error is.

In fact, I simply remove those from any code and then let my IDE sort out the formatting.

A common and hard to see error is spaces after the backslash. You could
try not using the line continuation; I certainly try to avoid it.

If you’ve genuinely got something long, note that Python expressions in
brackets can span multiple lines. So you can write:

 for i in (1, 2, 3,
           4, 5, 6):

or similar and not worry about the backslash at all.

It should show you more than this: it should be copying down a portion of the code where the error was detected, and saying what line number it’s on, and using ^ symbols to underline the “unexpected characters” in question. This is all useful information which you can use to find the problem more quickly.

My thanks to everyone for your help.

I have double-checked: unfortunately the error message is as I indicated. There are no additional clues to the problem.

I have investigated the backslashes in the code, but have been unable to identify any errors. Removing all backslashes didn’t assist.

Unfortunately I do not currently have sufficient knowledge to solve the issue, and cannot afford the time at the moment to study the matter further. I will therefore seek an alternative means to download the transactions.

Thank you again to everyone for your assistance.