15,179 Topics

Member Avatar for
Member Avatar for novice20

hi all... whats the difference between os.popen and subprocess.popen?? what does shell=True in subprocess.call really mean? if os.popen is used for snmpwalk, will there be any problem such as exceeding pipe capacity? what is the capacity of the file objcet connected to pipe using os.popen?/ how much data can it …

Member Avatar for Gribouillis
0
133
Member Avatar for novice20

hi all can u pls help me regarding iterating through an integer variable within a subprocess call here is what i exactly want to do for n in range(1,16): subprocess.call(['snmpset', '-v2c', '-c arct1c', '192.168.5.157', '.1.3.6.1.4.1.18489.1.2.1.5.1.2.0', 'i ','n']) i.e., i want to iterate through snmpwalk..but its not working:( it shows 'bad …

Member Avatar for Gribouillis
0
126
Member Avatar for dustbunny000

[CODE]for i in range(len(sumprop3)): for j in range(len(x2)): if j==i: print x2[j], atomnumber[i:i+8] [/CODE] For atomnumber[i:i+8] it is printing the range ie [1,2,3,4,5,6,7,8]. I want it to print just [1,8]. How would I do this?

Member Avatar for cghtkh
0
88
Member Avatar for Python_noob!

Im honestly going to die in this class! We have a project that we need to do on adding binary numbers and I cannot manage to get past the first step...checking the users strings for 1's and 0's. If it contains anything else...the code is supposed to reject the users …

Member Avatar for TrustyTony
0
114
Member Avatar for FreezeBlink

Really, the title says it all. Is there any way to compile all the instances of a class into a list, or other such data structure?

Member Avatar for Gribouillis
0
570
Member Avatar for python_user

Hi all, Could anyone please help me with this i have a cascaded menu button and i am adding nodes in a loop like this [CODE] #Create a cascading menu button for adding attribute types AttTypemenuBar = Pmw.MenuBar(topF, hull_relief = 'raised',hull_borderwidth = 1) aname = " Select...." self.createAttTypeMenu(AttTypemenuBar, topF, typeF, …

0
137
Member Avatar for ultimatebuster

Is it possible to import a and import b, but have functions from both a and b under a different name? Example under a.py there is function jopen() under b.py there is function ropen() i want be able to call both of them from c: c.jopen() c.ropen()

Member Avatar for ultimatebuster
0
124
Member Avatar for pythonstarter

Is there an way to create matrix[a][b][c][d] in python? It seems that you can write this way in Perl but not Python? Thanks!

Member Avatar for TrustyTony
0
122
Member Avatar for arareyna

Hi! :) I have been starting this small GUI application on monitoring data sent via the serial port... I have made the necessary preparations, please see: [CODE]import wx import time import wx.gizmos as gizmos import datetime class MACE(wx.Frame): def __init__(self, parent, ID, title): wx.Frame.__init__(self, None, -1, "MACE PQ MONITORING SYSTEM", …

Member Avatar for Gribouillis
0
1K
Member Avatar for novice20

can anyone help me regarding how multiple snmp sets can be invoked in python within a for loop?

0
64
Member Avatar for pythonlearning

Hello, just find this website and feel it is great to learn Python here. I have a question when I try to read data from file and compile a dictionary from the data. The data look like this, 1 1 A A 0 1 2 A B 1 1 3 …

Member Avatar for pythonlearning
0
107
Member Avatar for _neo_

Hi. How can I get subprocess.Popen.stdout size? Before reading from Popen.stdout I want to check its size, then get bytes from it. [CODE] def execute_bash(self): wait_sec = 5 import time import subprocess wForceKill = True res = subprocess.Popen(self.command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for i in range(wait_sec): res.poll() if res.returncode != None: …

Member Avatar for _neo_
0
168
Member Avatar for ttback

I have input values of x, y, z coordinates in the following format: [-11.235865 5.866001 -4.604924] [-11.262565 5.414276 -4.842384] [-11.291885 5.418229 -4.849229] [-11.235865 5.866001 -4.604924] I want to draw polygons and succeeded with making a list of wx.point objects. But I need to plot floating point coordinates so I had …

0
54
Member Avatar for Enders_Game

hypothetical say i have [code] for i in range(20): for j in range(20): for k in range(20): [/code] How could I != all fo them without writing 20 statements i !=j !=k doesnt work obviously (I have to compare 5 words so writing a seperate for each combination would take …

Member Avatar for Gribouillis
0
86
Member Avatar for ttback

I have been trying to replicate Matlab's patch() function (reference url: [url]http://www.mathworks.com/help/techdoc/ref/patch.html[/url]) with numpy and wxpython. The ultimate goal is to replicate the functionality of following line in python: [CODE] patch(vertices(i,[1,5,9]),vertices(i,[2,6,10]),(ctotal/3))[/CODE] It is a 2D patch function which draws triangular polygons. I am familiar with using wxPython for simple GUI …

Member Avatar for ttback
0
696
Member Avatar for jimmy9pints

Hi, I set out to make a body fat calculator tonight. There are a number of things that need to be improved in the below code (any suggestions welcome) but there's one thing I am really baffled by. I get a syntax error on the last few print lines. Please …

Member Avatar for Gribouillis
0
346
Member Avatar for Ghostenshell

Trying to find an easier way to write my code. I am using the graphics.py module. I will add the graphics program as an attachment for anyone who does not have it or doesn't know what I am talking about. The first program I made is archery. Just simple circles …

Member Avatar for TrustyTony
0
2K
Member Avatar for techie929

I have to make a server in python,which will extract POST data sent from the browser. Can anyone tell how can I go about this?

Member Avatar for jcao219
0
49
Member Avatar for Gribouillis

This snippet defines a function [icode]exc_browse()[/icode] which displays the current python exception in the web browser. This can be useful to non web programmers who want a nicely displayed exception traceback (web frameworks usually include this feature). The idea of this function is to store the html code generated by …

0
245
Member Avatar for roboguy

Hi everyone, Im a python beginner so please bare with me, i have done the first few project euler but thats it, Im trying to write a script that will search all txt, htm, html files recursively through multiple directorys for a string and will then write the whole line …

Member Avatar for TrustyTony
0
252
Member Avatar for JasonQiao

Could anyone instruct me about the Python code for magic square 3*3, I got some instructions but still made no dent in program. Could anybody send me the code? O(∩_∩)O Thanks! here's the instrctions: magic3 # In recreational mathematics, a magic square of order n # is an arrangement of …

Member Avatar for Gribouillis
0
90
Member Avatar for pixelss

I'm very new to programing, anyways, i was instructed to crate a program to calculate the are of rectangle, using the input from the user ( width, lenght ) using functions here is what i have, but i'm getting a error at the end [CODE] recWidth = input ('Please enter …

Member Avatar for pixelss
0
81
Member Avatar for xhaui

I am stuck on my python lab from this week. The lab deals with strings and being able to search them, slice them, etc. The part I'm stuck on is as follows: "You will implement in Python a function matchPat. It will take two arguments, a pattern string and a …

Member Avatar for TrustyTony
0
138
Member Avatar for memory

I am new to python and numpy. When I wrote: zeros((20000,20000),int), it returned "MemoryError". Does this mean that this array exceeds python's memory limit? Is there a way to define such big an array in python? Thanks.

Member Avatar for memory
0
109
Member Avatar for kannibalkiwi

okay, i'm stuck on an assignment! (first post btw, so tell me if i'm doing anything wrong please :) ) okay, my assignment is as follows : Write some efficient and commented python code to do the following: Accept an input value between 33 and 126 and convert it to …

Member Avatar for kannibalkiwi
0
94
Member Avatar for mandoza671

Hi, I'm new to programming so please excuse any obvious questions. I have a text file with the following entries: mydescription, myword yellow, mango yellow, banana orange, orange green, pineapple green, mango pink, mango What's important is that there is no order, both the 'mydescription' field and 'myword' change randomly. …

Member Avatar for mandoza671
0
155
Member Avatar for KrazyKitsune

Is it possible for the user to input a Python snippet and run it? Like this: [code=syntax]x = raw_input("Python snippet: ") #And then run the script typed in here[/code] Also, we know how errors happen all the time. Is it possible to make it so that when errors happen because …

Member Avatar for snippsat
0
105
Member Avatar for Sirovica

Hello everyone, My high school offers courses both in Python and Lua. I have done some research on both of the languages and they both seem to be fairly nice. But, which one do you think would be more practical to learn, I know Python is more popular but is …

Member Avatar for jcao219
0
70
Member Avatar for OlyDLG

Hi! Re: [url]http://www.daniweb.com/forums/post868247.html#post868247[/url], the example provided by sneekula is helpful, but I need to return the result of the ButtonRelease-1 to main; the only way I could figure out to do this was using a global; is there a better way? Thanks again!

Member Avatar for OlyDLG
0
311
Member Avatar for python_user

Hello i have a situation where i am using Pmw.MenuBar and i am adding node as shown below [CODE]menuBar.addmenu("Select ..., 'Click to add attribute type')[/CODE] Can somebody please tell me how to dispaly the text (Select...) in some color Thankyou

Member Avatar for woooee
0
62

The End.