someone knows how to launch an app in mac??

import os

class LaunchApp:
   
   def launch(self):
      os.startfile("/Applications/QuickTime Player.app")

s = LaunchApp()
s.launch()

this code works on windows and

os.system('gnome-open ' + /path)

on linux

but in mac, it returns this error "AttributeError: 'module' object has no attribute 'startfile'"

no one replied, thanks :) got it

os.system("open " + appName)
commented: Lol Sorry and ty +0

1.
#include <stdio.h>
2.

3.
void main()
4.
{
5.
//Define the arrays for angle and sine
6.
int a[25];
7.
double s[25];
8.

9.
//Grab the filename
10.
char* name = new char[];
11.
printf("Load Sine Values\nFile Name: ");
12.
gets(name);
13.

14.
//Create the file pointer and open it
15.
FILE* in = fopen(name,"rt");
16.

17.
//Read from the file
18.
int n = 0;
19.
while(fscanf(in, "%i%lf", &a[n], &s[n]) == 2) n++;
20.

21.
//Display Proof
22.
printf("\nLoaded %i entries from %s\n", n, name);
23.
printf("---------------------------------------\n");
24.
for(int k=0; k<n; k++)
25.
{
26.
printf("%5i%12.6f\n", a[k], s[k]);
27.
}
28.

29.
//Close the file
30.
fclose(in);
31.

32.
printf("Press Any Key to Continue...");
33.
char temp[1];
34.
gets(temp);
35.
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.