Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Coders/software monkeys - I need help understanding how to compile / run a program again

shiv

John
Administrator
Founder
Member
Joined
Dec 1, 2020
Messages
13,743
So I haven't done much programming lately. And I am really trying to understand some fundamentals again.

I want to write something in Python. I understand how to write the software. What I can't remember (or never really understood) was how to compile and run something outside of something like visual studio (I've done a lot of matlab, but that is completely different)

Talking Windows: Let's say I have a python script sitting in a folder. To start with: Do I need some kind of compiler to "build" an executable? I need an ELI5 version
 

tiderollsonu

A man from Nantucket
Founder
Joined
Jan 9, 2021
Messages
5,890
Scheduled task will run a script for you, I do this on some python scripts that pull wireless statistics for a client. Control panel/Administrative tools/scheduled tasks then create a basic task and point it at the python script you need to run.
 

shiv

John
Administrator
Founder
Member
Joined
Dec 1, 2020
Messages
13,743
Scheduled task will run a script for you, I do this on some python scripts that pull wireless statistics for a client. Control panel/Administrative tools/scheduled tasks then create a basic task and point it at the python script you need to run.
So I read that python is a "compiled language" which I guess means I don't need a compiler.

I don't need anything scheduled, just something that I can run when I want to
 

shiv

John
Administrator
Founder
Member
Joined
Dec 1, 2020
Messages
13,743
This is what I am trying to do:


I have data that is packaged in an hdf5 format, but I can't get access to it from where I am right now. So First off, I need to be able to create an h5data structure that I can operate on
 

shiv

John
Administrator
Founder
Member
Joined
Dec 1, 2020
Messages
13,743
So in notepad++ I created a text file and did what this guy said:


1643207964126.png
I then saved the text file as file.py so it would be recognized as a python file

Ok wonderful, but now what do I do to run it
 

shiv

John
Administrator
Founder
Member
Joined
Dec 1, 2020
Messages
13,743
I was able to build an h5 file. I basically copied what that other dude did.

1643210499872.png

Then I went to the anacando prompt executable, navigated to the right folder that contained my filed, and then typed "python h5test.py'

Now I need to figure out how to read into the h5 file
 

Hoppo

Elite
Founder
Joined
Jan 12, 2021
Messages
896
So I haven't done much programming lately. And I am really trying to understand some fundamentals again.

I want to write something in Python. I understand how to write the software. What I can't remember (or never really understood) was how to compile and run something outside of something like visual studio (I've done a lot of matlab, but that is completely different)

Talking Windows: Let's say I have a python script sitting in a folder. To start with: Do I need some kind of compiler to "build" an executable? I need an ELI5 version
You can just run it as an argument to a python command.

ex: python foo.py
 

Hoppo

Elite
Founder
Joined
Jan 12, 2021
Messages
896
I was able to build an h5 file. I basically copied what that other dude did.

View attachment 74396

Then I went to the anacando prompt executable, navigated to the right folder that contained my filed, and then typed "python h5test.py'

Now I need to figure out how to read into the h5 file
Ah you need to install the python dependencies. You can start by running “pip install [packagename]” for each package you are referencing (from a command line in your source tree directory). If you want to automatically do it, you can put your dependency package names into a requirements file.

Disclaimer: python is not my primary coding language, but I have written several pieces of software with it. Just realize my practices may not be best practices.
 

Hoppo

Elite
Founder
Joined
Jan 12, 2021
Messages
896
My bad I misunderstood what you were asking I think. The h5 file is a data file? Seems like the code is reading the file already, unless your path is invalid. But I see you are creating a dataset but doing nothing with it. (What I call the Bridge to Nowhere Antipattern 😂)
 

shiv

John
Administrator
Founder
Member
Joined
Dec 1, 2020
Messages
13,743
Ah you need to install the python dependencies. You can start by running “pip install [packagename]” for each package you are referencing (from a command line in your source tree directory). If you want to automatically do it, you can put your dependency package names into a requirements file.

Disclaimer: python is not my primary coding language, but I have written several pieces of software with it. Just realize my practices may not be best practices.
Well this was one of my problems for sure. I fixed it by installing anaconda which already had all the libraries.
 

shiv

John
Administrator
Founder
Member
Joined
Dec 1, 2020
Messages
13,743
My bad I misunderstood what you were asking I think. The h5 file is a data file? Seems like the code is reading the file already, unless your path is invalid. But I see you are creating a dataset but doing nothing with it. (What I call the Bridge to Nowhere Antipattern 😂)
You are right, my goal was to take an h5 file and output it as a csv. I needed a sample h5 because I didn't have access to it from my current pc.

But now I've got this:

1643216324044.png

and I have been successful in my original problem, but now I have to scale this too much much larger complex data sets.
 

Hoppo

Elite
Founder
Joined
Jan 12, 2021
Messages
896
You are right, my goal was to take an h5 file and output it as a csv. I needed a sample h5 because I didn't have access to it from my current pc.

But now I've got this:

View attachment 74401

and I have been successful in my original problem, but now I have to scale this too much much larger complex data sets.
When you say scale, what specifically is the problem you’re looking to overcome?
 

PowerMEGA

God Fearing Patriot
Founder
Joined
Jan 9, 2021
Messages
641
Download Visual Studio Code, and get the extensions you want (Python, etc). Code is the best environment to write and debug PowerShell too.

You could also get the Visual Studio 2022 Community edition and install the Python modules for it too. I don't program in Python, but I do have both of those apps installed. I thought it would be nice to play around with Python some time.
 
Top Bottom