14,952 Topics

Member Avatar for
Member Avatar for ram619

Hi, I have a device connected to the USB port of the laptop. This device pumps data to the port which is read by the python script. As per the baudrate of the board I use folowing configuration to open the port. Serial(options.port,921600,timeout=0.2,xonxoff=0,rtscts=1) But when I analyse the collected LOG …

Member Avatar for Ewald Horn
0
2K
Member Avatar for Rebecca_2

Hi, I have an output file (.txt) from a computational chemistry program. At some point in this file, following an unknown number of iterative steps, the following table will be found: Comparison of initial and final structures : -------------------------------------------------------------------------------- Parameter Initial value Final value Difference Units Percent -------------------------------------------------------------------------------- Volume a …

Member Avatar for slate
0
247
Member Avatar for Vish0203

odd mountain is a list of odd numbers going up from 1 and then back to 1. e.g. odd_mountain of size 5 is [1,3,5,3,1] odd_mountain of size 4 is [1,3,3,1] Hint: use the list functions and a builtin function. Can anyone help me in this? all my tries are going …

Member Avatar for wshane796
0
294
Member Avatar for joseph_7

am trying to create a python code that counts words,vowels,consonats,upperand lower case letter,and the frequency which has the option like Do you want to enter the text via the keyboard? Do you want to read in the text from a file? here is how i got but idont if am …

Member Avatar for TrustyTony
0
235
Member Avatar for joseph_7

anyone good at python please can you email me Josephawino@hotmail.co.uk

Member Avatar for Dani
0
68
Member Avatar for flebber

What is the best way to implement a reusable usr confirmation? Basically so that I can embed it in other functions, so that the user will get to confirm if output is ok or whether they want to recall function or quit. So it seems it should be like. def …

Member Avatar for dashing.adamhughes
0
129
Member Avatar for Ryan_8

I appologize if this has been answered elsewhere but the terms I search for do not turn up a good fit. I am new to everything I am trying to do here and need some direction to solve this problem. I have a string that is 'variable1=5&varible2=3&variable3=27&varible4=1' I need to …

Member Avatar for snippsat
0
158
Member Avatar for RikTelner

Is software hackable no matter how perfect it is written? Let's say I will create simple OS, I will spend like 30 years on encrypting every single variable, every code string and insert quadrillions of hacking preventions. Let's say, that there are absolutely no leakings in code, variables, passwords. Is …

Member Avatar for Coloradojaguar
0
353
Member Avatar for MFS NCCCC

I need a python code that collects all even numbers separately, odd numbers separately and displaying into two separate totals. The range of numbers is 1-20 I am new to this language and I keep getting syntax errors, invalid statement errors etc.. So it would be great if you can …

Member Avatar for bryann
0
189
Member Avatar for reuben_1

can i have some advice for making a basic program, and can someone help me through python plz thx

Member Avatar for vegaseat
0
175
Member Avatar for rbyrd

Does anyone know where I can download Python source code for Graham's convex hull algorithm? C and C++ code seems to abound, but I need Python code, and specifically for Graham's method (not Jarvis or others). Thanks in advance.

Member Avatar for dashing.adamhughes
0
157
Member Avatar for ShobanaV

I am trying to make a local python application communicate with the python application in cloud(GAE). I am able to send a string from local appn to cloud appn, which invokes the post method in cloud appn and writes some message to the screen. I want to access the string …

Member Avatar for dashing.adamhughes
0
241
Member Avatar for flebber

What I am trying to do is delete the key value pairs out of a dictionary if the value is = 0. I seem not to be acheiving that so far. Python 2.7.5+ (default, Sep 19 2013, 13:48:49) [GCC 4.8.1] on linux2 Type "help", "copyright", "credits" or "license" for more …

Member Avatar for flebber
0
418
Member Avatar for matthew.l.diefenbacher

*Hello. I am not new to the wonderful site - Just lost login credentials* I am resuming work via Python and must make some installs into my Lib. I am having trouble with this - I have not used Python in 2-3 years. Many syntax errors. This is from install …

Member Avatar for HatGuy
1
316
Member Avatar for lewashby

Server #!/usr/bin/python3 import socket from time import ctime HOST = '' PORT = 21567 BUFSIZ = 1024 ADDR = (HOST, PORT) udpSerSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) udpSerSock.bind(ADDR) while(True): print('waiting for message...') data, addr = udpSerSock.recvfrom(BUFSIZ) udpSerSock.sendto(data, addr) print('...received from and returned to:', addr) udpSerSock.close() #END# Client #!/usr/bin/python3 import socket HOST = …

Member Avatar for JasonHippy
0
353
Member Avatar for Sinnocence

building my first cgi website, here is my problem. The code below works but when the condition is met it outputs both pages on the same screen however when the condition is not met it only outputs the Else: statement like its supposed too. I can't figure out why it …

Member Avatar for Sinnocence
0
237
Member Avatar for rbyrd

Is there some place where I can get a list of the "named" colors (i.e., goldenrod) available in wxpython? I'm using osx 10.6.8. Thank you.

Member Avatar for rbyrd
0
683
Member Avatar for peto29

from visual import * sec = arrow(color = color.cyan, pos = vector(0,0,0), axis = vector(0,3,0)) minu = arrow(color = color.red, pos = vector(0,0,0), axis = vector(0,2,0)) hr = arrow(color = color.magenta, pos = vector(0,0,0), axis = vector(1,0,0)) angle = 0 angle2 = 0 while True: rate(1000) angle = angle - …

Member Avatar for Schol-R-LEA
0
204
Member Avatar for rbyrd

I am trying to learn wxpython, but having trouble laying out two buttons that I want to be centered in a horizontal panel. I can get the buttons on the panel, but they are not centered. What I'm trying to do is create a Frame that contains an upper panel …

0
81
Member Avatar for Vish0203

I found this question on the internet, > Create a text file with name filename and about size bytes. The file should contain > an incrementing number on each line starting with 0. (ie) 0, 1, 2, 3, .... as many are required to make the file size > just …

Member Avatar for TrustyTony
0
161
Member Avatar for bnn678

So I have been working on a directory and have not really been able to get it off the ground. As a matter of fact none at all. import H:\Python Helpful Programs\DivisibleBy.py (also: everything is in the same folder) I have also tried just DivisibleBy.py and some others. The error …

Member Avatar for bnn678
0
243
Member Avatar for a_1

return the first count multiples of number in desc order in a list. e.g call with input (3,2) returns [6,3] call with input(5,3) returns [15,10, 5] plz help me with this how can i do it using map()??

Member Avatar for woooee
0
146
Member Avatar for lewashby

In this line -> `tcpSerSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)` what is the first 'socket' after the '=' sign, is that refering to a socket class making tcpSerSock an object or just to a module called socket? After reading the documentation I see that socket.accept returns a connection and an address pair, …

Member Avatar for lewashby
0
892
Member Avatar for Vish0203

I wrote a code which fills numbers into the file and when the file exceeds the size given, it stops adding data. But whenever i run the code there is an indefinite run in the data and the size of file just goes off the chart! Please help!! def create_file_numbers(filename, …

Member Avatar for Harold_2
0
263
Member Avatar for Andrei_1

I'm using python3 on Windows, got a problem with ZEO , when i start a ZEO server (python runzeo.py -a localhost:9000 -f database.fs) on server appears : ------ 2014-01-15T16:24:17 INFO ZEO.runzeo (4080) opening storage '1' using FileStorage ------ 2014-01-15T16:24:18 WARNING ZODB.FileStorage Ignoring index for C:\Documents and Settings\calarasanu\Desktop\Licenta\DBase\Test\zeo\database.fs ------ 2014-01-15T16:24:18 INFO …

0
83
Member Avatar for Vish0203

I have a generator function, i've filled in the function if there are no more_seqs. But I feel trouble if there are more sequences. I need to generate 1 tuple at a time. if the function call is generate_zip(range(5),range(3),range(4),range(5)) then the tuple generated should be (0,0,0,0) (1,1,1,1) n so on …

Member Avatar for slate
0
185
Member Avatar for Vish0203

I have a list say word = ["engine","ant","aeiou"] I need to sort the list according to the number of vowels in the list elements. And this sort must change the input as well. I tried writing the code, by using zip() and a few ops i'm getting the required answer …

Member Avatar for vegaseat
0
299
Member Avatar for onely

class Point: def __main__(self, x=0, y=0): self.x = x self.y = y def distance_from origin(self): return ((x ** 2) + (y ** 2)) ** 0.5 def distance_between_points(a, b): return distance_from_origin(a) - distance_from_origin(b) I get a global variable error when I try to run the function at the bottom.

Member Avatar for woooee
0
181
Member Avatar for CodingCabbage

from random import randint from tkinter import * import time screen = Tk() widthOfScreen = screen.winfo_screenwidth() #Get the width of the screen heightOfScreen = screen.winfo_screenheight() #Get the height of the screen screen.geometry("%dx%d+0+0" % (widthOfScreen, heightOfScreen)) def spammer(): count = 0 for count in range(0,1000): Button(screen, text = count, font = …

Member Avatar for CodingCabbage
0
261
Member Avatar for giancan

Dear friends, I need help understanding my error with urllib. I wrote the following code to check the availability of updates for a software I wrote try: datasource = urllib.urlopen("URL to FILE.txt") while 1: line = datasource.readline() if line == "": break if (line.find("<") > -1) : LastVersion="Error" else: LastVersion=line …

Member Avatar for snippsat
0
213

The End.