15,181 Topics

Member Avatar for
Member Avatar for EdJones

What's a good book to learn C if you already know Python and are comfortable with computer science terminology? I'd like a book that is downloadable as a .pdf free of charge but an html book viewable online free of charge would be fine. Also, is there an advantage to …

Member Avatar for tabanpanoam
0
275
Member Avatar for Slavi

Hey guys, I have a quick question here, I have Python 2 installed on my machine and I read a book on Python and Vega's great threads. However, my next book that I am about to read states that I need Python 3 to compile the code on their examples, …

Member Avatar for HiHe
1
285
Member Avatar for HiHe

I copied this code from page 11 of http://personal.denison.edu/~krone/cs173/files/PythontoC++.pdf and assigned it to a Python string. Alas there are still line numbers. How could I use Python to remove these? Help, I have a mental block. s = ''' 1 #include <iostream> 2 using namespace std; 3 4 int gcd(int …

Member Avatar for vegaseat
0
1K
Member Avatar for gmosley96

I am learning Python and one thing I thought I could work on was a program to scan an IP range and then compare the results with previous - alerting me to any new IP addresses that respond to ping. Can I get some feedback on my code? Is there …

Member Avatar for gmosley96
0
226
Member Avatar for Tcll

What I'm trying to do is figure out a legit way of updating or downdating my program from my GitHub repository. I'm rather lost as the the approach on this and don't know what to consider. I want to notify a user if a new major update is available, and …

Member Avatar for Tcll
0
213
Member Avatar for fahadkalis

Hello everyone, I am working on Linux PC and want to make a program to get data from RaspberryPi(another Linux machine). Both machines are connected together by CAT5 cable directly without any Switch or Hub. Linux PC hostname is mike and IP is 192.168.93.12 Raspberry hostname is pi and IP …

Member Avatar for fahadkalis
0
244
Member Avatar for rogwar

Good morning everyone. I have a question, please if you do not mind. In this file E_vs_cutoff1.pdf, i represent the energy vs radial cutoff. And in the python script, i specified the limits of Y-axis as: pl.ylim(-5524.0,-5522.5). I am using python 2.7, pylab. And the script i wrote is simple …

0
73
Member Avatar for mark103

Hi guys, I'm creating the width size for the buttons when I'm getting a list of arrays so I can store the buttons size in a database. The types of arrays that I stored for the buttons and the buttons width size is a list. I have stored a list …

Member Avatar for TrustyTony
0
246
Member Avatar for Chem_1
Member Avatar for sneekula
0
675
Member Avatar for PCSAWICK829

I was working on my raspberry pi creating a game called raspberrysnake from code out of a book. I entered the code exactly as shown... I had a few errors which turned out to be missing characters or mistyped characters. Finally, after catching these, I ran it through the command …

Member Avatar for sneekula
0
2K
Member Avatar for mark103

Hi guys, I'm trying to write the code to allowed me to store each data in a database from the arrays, but it give me the error. [b]Error: InterfaceError: Error binding parameter 0 - probably unsupported type.[/b] Code: #generating the program button ids for generate_ids in range(3002, 3485): program_id.append(generate_ids) #create …

Member Avatar for Gribouillis
0
423
Member Avatar for vegaseat

Once you are on the internet, you have to come up with passwords. After a while it will be difficult to remember those passwords. You could write them down somewhere, but the wrong person could find them. Why not have Python help you to come up with a logical password …

Member Avatar for Gribouillis
1
432
Member Avatar for tony75

Hi How to merge two binary files into one in python and make them both execute. For example 1.exe+2.exe = OutPut3.exe when you run 3.exe both 1 and 2 execute def Main(): File_1 = raw_input("Location path of 1.exe:") File_2 = raw_input(" Location path of 2.exe:")

Member Avatar for tony75
0
2K
Member Avatar for itsthewendigo1111

I want this to keep track of each players turn including the AI. Not the numer of rolls but for each turn till the game ends. For example your turn ends when a 1 is rolled on either dice or both. import sys from random import randint def game(): playercount …

Member Avatar for davidnelson4911
0
318
Member Avatar for mark103

Hi guys I need a bit of your help. I've created the variables that I want to store a list of arrays outside the for loop. I have got a problem with the code that I currently using. When I try this: import xbmc import xbmcgui import xbmcaddon class ProgramControls(object): …

Member Avatar for mark103
0
653
Member Avatar for fonzali

hi guys , first of all merry Christmas and happy new year since there have been many discussions about favorite idle for python , al sweigart is trying to improve python's own idle and everyone is invited to help out and since this is the best python forum I thought …

Member Avatar for Gribouillis
2
232
Member Avatar for noronet

i hava question how i access to one pc in localy network and take screenshot in desktop and finally send picture to me.

Member Avatar for Gribouillis
0
87
Member Avatar for varshaholla

Hey,I wanted to know how to read a .txt file and the output should be in .xml format. I have the input file as input1.txt ![0376d295e822f9bd4db190cdd215e996](/attachments/large/4/0376d295e822f9bd4db190cdd215e996.png "0376d295e822f9bd4db190cdd215e996") My code: from lxml import etree import csv root = etree.Element('data') #f = open('input1.txt','rb') rdr = csv.reader(open("input1.txt",newline='\n')) header = next(rdr) for row in …

Member Avatar for Gribouillis
0
343
Member Avatar for EdJones

Which class structure is better for what purposes. This one: class Text: def __init__(self, passage): self.s = passage def read_text(self): return self.s def grow(self, sentence): self.s = self.s + sentence.s class Sentence(Text): def __init__(self, sentence): Text.__init__(self, sentence) self.s = sentence def format(self): self.s = self.s[:1].title() + self.s[1:len(self.s)-1] + ". " …

Member Avatar for EdJones
0
158
Member Avatar for 4evrmrepylrning

I'n trying to convert a dbf file to a csv file(or anything else really). I found this on the interwebs but I get an error import csv from dbfpy import dbf import sys dbf_fn = 'in.dbf' csv_fn = 'out.csv' in_db = dbf.Dbf(dbf_fn) out_csv = csv.writer(open(csv_fn, 'wb')) names = [] for …

Member Avatar for Nisar222
0
13K
Member Avatar for stan3688

Hello Guys, its my first few months on progamming, love the course but things are abit confusing at the moment, i have this assignment below, pls i will appreciate if anyone can help me out. Write a program to accept a number of scores from a user. Use floating point …

Member Avatar for Gribouillis
0
236
Member Avatar for mark103

Hi guys, I'm working on my python script to get the list of elements in the arrays. I'm using the variable `position_x = elem.getX()` to get the list of pixel size for the elements. Here is the output: 18:32:12 T:4060 NOTICE: 375 18:32:12 T:4060 NOTICE: 724 18:32:12 T:4060 NOTICE: 1073 …

Member Avatar for Gribouillis
0
242
Member Avatar for Chrislynn_1

I have a requirement to update a configuration file content at a specific lines location. How to do this in python. For example, I have a configuration file which is having below 5 lines now: define host{ name kiki-server; XXXX XXXX; XXXX XXXX; } I am interested have my python …

Member Avatar for Chrislynn_1
0
235
Member Avatar for ZeroEddy

Hi im new to python and am trying to make a simple tank game where I want the tank gun to follow the position of the mouse cursor. Im am having some trouble in doing this. Below is my code. Whenever I run I get an error. So far I …

Member Avatar for ZeroEddy
0
401
Member Avatar for Slavi

Hey guys, some of you might know me from other sub sections of Dani Web. I am about (just started) to learn Python. And not just learn but possibly make it my prefered language over all. So, I've read the thread from `vegaseat` for beginners and it has a link …

Member Avatar for vegaseat
0
237
Member Avatar for har58

Hi, I have created TY.py. The Ty.py file executes and runs successfully. I am trying to make its executable using py2exe and by creating setup.py. It is not able to include the requests. I think it is because 'requests' is not present in 'include' folder for python27. The path of …

Member Avatar for vegaseat
0
1K
Member Avatar for wesam.teto.9

Similarity(X,Y): For i = 0,...,m: SIM[i,0] = i*g For j = 1,...,n: SIM[0,j] = j*g For i = 1,...,m: For j = 1,...,n: SIM[i,j] = max( SIM[i-1,j-1] + s(X[i],Y[j]), SIM[i-1,j]+g, SIM[i,j-1]+g ) EndFor EndFor Return SIM[m,n]

Member Avatar for Gribouillis
0
227
Member Avatar for EdJones

As part of a study exercise I wrote a procedural script and would like to ask whether anyone has a more polished version. Your version can be procedural or object oriented. #! /usr/bin/env python3 # This script simulates a monkey on a typewriter trying to come up with one sentence …

Member Avatar for Gribouillis
0
131
Member Avatar for Tcll

so I've reverse-engineered Tkinter's tkfiledialog functions askopenfilename and asksaveasfilename to figure out how they work: import Tkinter class Open: "Ask for a filename to open" def __init__(self, master=None, **options): self.master, self.options = master, options if not master and options.get('parent'): self.master = options['parent'] def _fixoptions(self): try: self.options["filetypes"] = tuple(self.options["filetypes"]) # make …

Member Avatar for Tcll
0
287
Member Avatar for Tcll

I've been working on this in other places so it's a little ahead of it's time, but it still has a few minor issues... heh here's an example to get started: x = struct( 12, # struct size 'x,y,z', # variable order x = bf32, y = bf32, z = …

Member Avatar for Tcll
0
225

The End.