473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Opening/Running files through python

Hey guys, hope you can help me here.

I am running in windows and I am trying to open a file via python. I
want the file (a text file) to open up in the users default text
editor. I'm not wanting to read a file, I just want to open it. Is
there a way?

Thanks in advance.
Jan 17 '08 #1
1 1042
Ionis wrote:
Hey guys, hope you can help me here.

I am running in windows and I am trying to open a file via python. I
want the file (a text file) to open up in the users default text
editor. I'm not wanting to read a file, I just want to open it. Is
there a way?
<code>
import os
os.startfile ("blah.txt")
</code>
Jan 17 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rolfe | last post by:
Hi, I struggled, and got mod_python running on Apache/Win2k. Follow these instructions verbatim and you shouldn't have any trouble. These instructions are based on...
5
by: Shalen chhabra | last post by:
Hey, Can anyone give me a snippet for running a python program over all the files in the directory. For ex: I have ten files in a directory and I want to run a python program against all of...
7
by: balgach | last post by:
Greetings all, I have a group of rather large files (by group i mean close to 2x10^7 files, each 12-15megs) now i need information which is stored in just the last 512 bytes of each file. i...
7
by: iclinux | last post by:
Environment: WinXP SP2 + Python 2.4.2, with SOAPpy-0.11.6.zip, fpconst-0.7.2.zip, and PyXML-0.8.4.win32-py2.4.exe installed. Problem: I'm reading DiveIntoPython these days. When running code...
1
by: Westbrook, Christopher L (WESTBCL04) | last post by:
I am having some trouble, and I can't figure out why. I'm trying to use the simple keylogger project from source forge, and then create a web interface to open the resulting files, so people from...
1
by: Tony Mullen | last post by:
Hello, I have several problems. I have installed 2.5.1 on Windows XP. I had a previous installation of Python 2.4 which, in trying to solve the first problem I uninstalled. At present, as far...
0
by: Alexnb | last post by:
Okay, so what I want my program to do it open a file, a music file in specific, and for this we will say it is an .mp3. Well, I am using the system() command from the os class. The problem I am...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
5
by: Christopher Brewster | last post by:
I am running the same script on the same data on two different machines (the folder is synchronised with Dropbox). I get two different results. All the script does is count words in different...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.