473,729 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

subprocess problem on Windows in IDLE and PythonWin

Python 2.4 on Windows XP
In the python command-line the following works fine:
from subprocess import *
p = Popen('dir', stdout=PIPE)
From within IDLE or PythonWin I get the following exception:


Traceback (most recent call last):
File "<pyshell#1 3>", line 1, in -toplevel-
p = Popen('dir', stdout=PIPE)
File "c:\python24\li b\subprocess.py ", line 545, in __init__
(p2cread, p2cwrite,
File "c:\python24\li b\subprocess.py ", line 605, in _get_handles
p2cread = self._make_inhe ritable(p2cread )
File "c:\python24\li b\subprocess.py ", line 646, in _make_inheritab le
DUPLICATE_SAME_ ACCESS)
TypeError: an integer is required

Note it works fine on Linux also. I tested it with p = Popen('ls', stdout=PIPE)

.... and had no trouble.

Jul 18 '05 #1
0 1224

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

Similar topics

1
3716
by: Rami A. Kishek | last post by:
Please help! Very strange installation problem. First, let me say I successfully installed and use Python 2.2.3 and 2.3 from the EXE binaries on a win ME machine. That machine previously had 1.5.2, and now I have access to all 3 versions. When I tried to do the same on an older machine, however, running Win98 SE (and having had Python 1.5.2 previously installed there), the installation doesn't work: Obvious problems: * IDLE...
10
3822
by: Kylotan | last post by:
Is there a practical way to use Pychecker in Windows? It doesn't work under IDLE. (In fact, it seems to end up breaking everything, and every subsequent statement and expression I execute gets ignored.) Running it from the Python interpreter in DOS means everything scrolls off the screen. Ideally I'd like to redirect it to a file, or be able to use it in IDLE. -- Ben Sizer
3
1940
by: Tuure Laurinolli | last post by:
Some time ago I was playing with the idea of using an actual IDE to write my python code. I first played with IDLE, but noticed that it was kind of limited and for some reason it worked extremely slowly when started from a shortcut on desktop(not so when started from shortcut in start menu). Then I tried Pythonwin and noticed that it didn't provide any indentation help at all - to my surprise. I discarded the idea of using it, but for...
5
1708
by: StepH | last post by:
Hi, I'm new to Python. I'm working under XP, and I've alot of prob. (not with the langage itself, but with the tools): I've install Pyhton 2.4 in C:\Python24, using the .msi windows installer. Then, I've install "PythonWin" (the last build-203). I'll try to summerize my prob.:
1
1970
by: Bo Peng | last post by:
Dear list, I am using rpy, a python module to control statistical package R from python. Running the following commands >>> from rpy import * >>> r.plot(0) will pass command 'plot' to R and run it. I notice that the R-plot will not refresh (a window is created but the figure is not drawn) until the
3
12753
by: madpython | last post by:
playing with subprocess.Popen on Windows I stumbled into the following problem: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) IDLE 1.1.3 >>> import subprocess >>> p1=subprocess.Popen("c:\\asd.bat") #works OK >>> p2=subprocess.Popen("c:\\asd.bat",stdout=subprocess.PIPE)
20
7796
by: W. Watson | last post by:
I downloaded python-2.5.msi and installed it. I believe its editor is IDE. I understand there's a Win editor called pythonwin. I believe it's in the download pywin32-210.win32-py2.5.exe, but I'm not sure if this exe file has just the editor or all of Python. Comments? If not how do I get the PythonWin editor by itself? BTW, one of the features I did not like of IDE is the limited file Print command. It puts everything in 16pt type, and...
2
14159
by: Llessur16 | last post by:
I recently installed Python 2.5 for windows XP. It seemed to be working great. I was writing a simple program, and had tested it a couple times. When I was nearly done I tried to run it, and a box came up and it said "IDLE Subprocess Error" at the top and then "Socket Error: Conection refused". Right after that a second box popped up which the title said "Subprocess Startup Error" it said underneath "IDLE's subprocess didn't make connection....
4
3613
by: sterling | last post by:
I'm curious as to why the difference between IDLE and pythonWin when using win32com. opening an excel file, i've attempted to grab the chart information out of the file. commands like co = ChartObjects(1) works in pythonWin but doesn't work in IDLE. however, on both co = chartobjects(1) works just fine.
0
9427
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9202
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9148
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8151
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.