473,550 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Forum

Python programming language - Ask questions about python interpreter, control flow, data structures, modules errors, classes, standard library, gui, databases, unit testing, object oriented, structured programming and more.
1
1,659
thread by: KrishnamoorthyM | last post Jan 22 '13 by: dwblas
How to Skip The Enter Key in using python on redhat linux?
1
1,490
thread by: Kakar | last post Jan 28 '13 by: bvdet
I am very new to python, and i have lots of questions to ask. But for now, can any of u please tell me, how to make an executable python program?
2
2,159
thread by: nicstel | last post Jan 28 '13 by: nicstel
Hi, I have created a script to move some files(pdf) from a directory to another one, but when the file that I want to move is in use it automaticaly copy the file to the new destination. I don't want to copy the file. There is a way to not move and copy the file when is in use? here is part of my script. for DefaultUserName in...
1
2,299
thread by: vinnygod | last post Jan 31 '13 by: bvdet
say the user inputs 2 strings aaaabcddd aaabbccdd i need to figure out how to compare each charecter and the ones that dont match would be uppercased. aaaAbcDdd aaaBbcCdd
4
1,770
thread by: kaf3773 | last post Feb 2 '13 by: bvdet
Hi I am trying to write a python script that executes a command to screen scrub results below I will appreciate it very much if you can help me with a python script that can pick the percentage USAGE in the second column based on the supplied queue number in the first column Thanks in advance. import re content = """NUMBER of Queues = 5
1
1,531
gesqo
thread by: gesqo | last post Feb 2 '13 by: bvdet
I have a large text file. Several chunks of it are delimited by a pair of small strings: "...zczjczjsstr1pqcqdiocpqsstr2ufusvsdvnvvsstr1nnfnenefenzzezfzefsstr2ydgyrger..." How could I loop over the text file and delete what appears repeatedly between sstr1 and sstr2? The result should be: "...zczjczjufusvsdvnvvydgyrger...".
3
3,030
thread by: xxHana | last post Feb 3 '13 by: bvdet
Hi, I have a problem with implementing a for loop for my program. I don't understand how to correctly make a for loop in asking the player to play again after getting the number right. The options should be yes as 1 and no as 2. I have this so far...: def playgame(): import random num = random.randint(1,10) guess = 0 ...
2
3,026
thread by: od11kd | last post Feb 4 '13 by: od11kd
Hey guys! So I am trying to do a program, and for the most part I have it down except for 1 part of it. Basically, I want my function to continue to prompt a user to enter an integer number between 1 and 100 inclusive, until the user enters a invalid integer. I have the program here: def assign2PartB(): x = 0
0
2,129
thread by: kaf3773 | last post Feb 4 '13 by: kaf3773
I am trying to use pexpect to telnet to a device and then subsequently telnet from that device to another device and then output the result of a command on the second device but i am unable to. Here is the script i wrote and the error i am getting I will appreciate help very much. Thanks import pexpect child = pexpect.spawn('telnet...
1
2,129
thread by: Gugyu | last post Feb 6 '13 by: Rabbit
I have a table AVI with the following relevant structure: POLY_NUM key LKP SITE1 SITE2 SITE3 Y2BH I have a lookup table SILKP with: LKP
1
1,890
thread by: haridas | last post Feb 7 '13 by: bvdet
I'm handling BER encoded Call Data Records (CDR). from GPRS Tunneling protocol. In which I got one field's value with `'\r\n'` in it. `'\xa0\x06\x80\x04\r\n\xc4\x086'` -- This is the encoded string or `bytearray` which causing the issue. It has all the TLV information required for the tag a0, and its length is 06. There is an inner tag 80 and...
1
2,058
thread by: srajendram | last post Feb 13 '13 by: bvdet
cant assign to a literal error shows up. what am i doing wrong here please varA=5, varB='a' if type(varA) == str or type(varB) == str: print('string involved') elif varA > varB: print('bigger') elif varA == varB: print('equal') else: # If none of the above conditions are true,
1
2,936
thread by: dbfreak | last post Feb 17 '13 by: dwblas
Hello, im going out of my mind trying to solve this, im new at python and trying to code an alarm system with a raspberry pi. the alarm threads stops waiting for alarm2 threads raw_input, how can i solve this? Thanks in advance code below: import time from threading import Thread from pyrowl import Pyrowl from datetime import datetime
2
2,120
thread by: cantor | last post Feb 17 '13 by: dwblas
Hi, I'm fairly new to python, and I keep getting an error 'return outside function'. I've looked around, and tried reformatting, redoing the indenting, and I still get the same error. Can anyone help me? def syllableCount( someString ): for syllSet in myDict: for element in syllSet: if (element == 0 or element == 1):...
1
1,976
thread by: df5943a | last post Feb 22 '13 by: bvdet
I want to write a code that will give me this >>> drawLeftTriangle(5,'A') A AA AAA AAAA AAAAA can anyone help me
1
1,838
thread by: hardsree123 | last post Feb 22 '13 by: bvdet
i have a code in python its an algorithm that takes input in this form python <python_file_name> <log_file_name> <max_nodes for each queue> <log_file_name> <max_nodes for each queue>these things i have to pass through a webpage. which method should i use .. i am having a doubt
1
1,736
thread by: Beastman | last post Feb 25 '13 by: bvdet
i am trying to create a simple database with inputs of friends name and age but the lasts variable its not defined apparently import pickle class aFriend: def __init__(self, name , age): self.name = name self.age = age self.namePlusAge = def addFriend(self, friend, age): self.namePlusAge = age
6
4,386
Bazooka9T
thread by: Bazooka9T | last post Feb 27 '13 by: Bazooka9T
Hey group, I am new on here, and also to Python. I have been setting myself various tasks to try to learn more about this language and have a small query. I set myself a "Cash Machine" task, and although I am still yet to add multiples of 10, overdraft etc.... I keep getting a negative value as a result which is literally "bugging" me *sticks...
2
4,295
thread by: s34n23 | last post Feb 28 '13 by: s34n23
How would I make it that if I opened pickAFile, that if cancel is pressed in the pickAFile() dialogue box, I want to ask the user if it was a mistake. If it was a mistake, open the pickAFile() dialogue again, and repeat until it is either not a mistake, or a picture file was selected. Thanks so much in advance! I have this down, it's not...
1
2,743
thread by: sudan20089 | last post Feb 28 '13 by: bvdet
How can i create gui in python using pyopengl? Or simply i want to create textbox in python using pyopengl which takes the value entered in text box and the calculation can be conducted. please help me to get through it (p.s. not using thread)
0
1,177
thread by: sherly1389 | last post Mar 4 '13 by: sherly1389
Hello, I am getting error as 'Segmentation fault (core dumped) ' when I am trying to use measage queue from flow graph of gnu radio companion. code: abc.connect(self.watcher, Qt.SIGNAL("new_plot_data(PyQt_PyObject, PyQt_PyObject)"),abc.plot_data) Please let me know how to get rid of it.
1
1,375
thread by: LaurieD | last post Mar 4 '13 by: bvdet
Good afternoon, all, I am new to python and I have a problem that requires a user to input starting/ending file numbers, and the suffix of the files to rename. The output will show the newly renamed file as 'rename bak/file(number).doc(or eml or JPEG) old_file(number).doc(oreml or JPEG). I keep going round in circles, any nudge in the right...
0
1,464
thread by: Madi | last post Mar 5 '13 by: Madi
Hi, i was looking for a way to call a java method from a python file, and i found that the "jPype" allows us to do that so i have installed it (on linux) and when looking for exemples on how to use it, i found this one in the net the java file is: #A.java class A 02 { 03 public A() 04 { 05 super();
1
2,264
thread by: otto531 | last post Mar 8 '13 by: dwblas
I need to take two files and print the top most frequent words they have in common as well as their combined(sum) frequencies. def mostFrequent(word,frequency,n): my_list = zip(word,frequency) #combine the two lists my_list.sort(key=lambda x:x,reverse=True) #sort by freq words,freqs = zip(*my_list) #take the top n entries and split...
1
1,484
thread by: broception | last post Mar 12 '13 by: bvdet
I'm trying to get the user to enter what shift they worked, if they enter first shift then the pay rate would be 12.30, if they enter second shift pay rate is 14, and so on. What I have so far: firstShift=12.30 secondShift=14.20 thirdShift=15.30 tax = .28 otMultiplier = .5 def main():

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.