15,190 Topics
![]() | |
Value of set(sum(french,())) = set(['mardi', 'pass\xc3\xa9', 'voyez', 'envoy\xc3\xa9', 'membres', 's\xc3\xa9lection', 'peut', 'remplissaient', '\xc3\xa9t\xc3\xa9', 'prononcent', 'travaux', 'd\xc3\xa9terminent', 'trop', 'lib\xc3\xa9raux', 'd\xc3\xa9clar\xc3\xa9', 'dont', 'le', 'mais', 'la', '(', ',', 'internationales', 'Les',.....]) tm = {('se', 'est', '-', 'il', 'pass\xc3\xa9'): [phrase(english='has happened', logprob=0.0)], ('pos\xc3\xa9e',): [phrase(english='asked', logprob=-0.261521458626)], ('le', 'cours', 'de', 'les', 'deux', 'prochaines'): [phrase(english='the next two', logprob=0.0)], … | |
!using python 3! first of all, i am a rather noobish python coder, so please dont make the answers too hard to understand. I was trying to get an input from the user with raw_input(), that input had to be the same as a predefined string, i came at: x … | |
Hello all, I was hoping to figure out a code that could find out whether a point was inside a group of points. I already noticed that I could create a convex hull from the points with the scipy.spatial.ConvexHull module. What I'm trying to do is then find a way … | |
So I wrote this program this evening...it was working just fine and when I started trying to tweak the display I started getting syntax errors on my global elif's. Here's my code, somebody please tell me what is going on. # Rock Paper Scissors, Project 2, Tadd O'Bannion import random … | |
I thought it would be fun to code all the different ways to show Hello World on the display. Let's start simple ... `print("Hello World")` Can anybody print out "Hello World" vertically? | |
I tried to make a way to let the user choose to which piece of the program it would go, i first tried *for* but later went and used *if*, this is the code: while True: whichcode = 1 #set the variable for the first time. while True: if whichcode … | |
!python3! so i was trying to get a for loop to work to get a program to choose which part of the code it had to run, this is what i have: while True: whichcode = 1 #set the variable for the first time. for whichcode == 1: print code … | |
I am attempting to convert a C application to python. I am having difficultiy on this particular for loop. Any ideas how I might proceede? bool Enigma2C::encrypt(char *inString, char *outString) { int16 csum = 1, checksum = 0; int16 tmpSum = 0; int16 i = 0; strcpy(m_keyCode, inString); // Calculate … | |
HI, I'm having some trouble with this program - its supposed to return an acronym based on the input of the user: It prints three of the same letter instead of the acronym. Any help would be much appreciated. def acronym(phrase): a = "" for words in phrase.split(): a = … | |
well , I just realised that we forgot about our " turtle " so here it is printing " hello world " from turtle import * title("hello world") shape("turtle") speed(2) color("blue") write('hello world',align = 'center', font=('imes New Roman', 36,'bold')) done() | |
But i want steganographic plugin in python language.This link http://registry.gimp.org/node/25988 shows the steganography plugin in c language. please help me to find a steganographic plugin in python | |
I have a list in python that I am printing to the screen. The current format is Option Key: [0, 3, 6, 8, 8, 5, 2, 0, 7, 1, 9, 5, 0, 7, 7, 4, 2] I would like it to be Option Key: 0 3688 5207 1950 7742 I … | |
Hey Guys, Ive been having a bit of trouble with a program which rolls dice for the game risk. Ive been able to implement number of dice choice selection for both attacker and defender, and to get them to roll the results. The part I am trying to implement now … | |
As the title implies, what I want to do is create main.py and have it open a window. after the window is open, I want to edit main.py, and when finished editing, hit File -> Reload in the window's menu bar. what's expected is for the window to update with … | |
In python if I know the volume label of a USB mass storage device is there a way to get its. Drive letter Windows Mount Point Linux Mount Point OSX Originally I was thinking either the sys library or the os library. i ahve found another library called PYUSB. Still … | |
how to dynamically insert keys into an existing python dictionary, input is the .json file and the output in a .csv file. this is the input in the .json file [{"FIRSTNAME":"barc","EMAIL":"jahg@jh.com","ADDRESS":"gyuyj"}, {"FIRSTNAME":"rth","EMAIL":"tht@thuyj.com","ADDRESS":"ytju"}, {"FIRSTNAME":"trhy","EMAIL":"klo@pyu.com","ADDRESS":"trght"}, {"FIRSTNAME":"ghy","EMAIL":"ytj@uki.com","ADDRESS":"ukyk"}] output is required as .csv file(in each row its specified columns should be added) "FIRSTNAME":"barc","rth","trhy","ghy" "EMAIL":"jahg@jh.com","tht@thuyj.com","klo@pyu.com","ytj@uki.com" … | |
Hello everyone. I am currently making some database connection modules in Python inb order to learn Python's approach to OOP and also to lear how to connect to databases via Python. I successfully made a package with modules for postgres, mysql, sqlite3, and MongoDB. The classes simply connect, disconnect and … | |
Hello! I'm working on a program at work for a device we are building, it's a device that (basically) in real-time reads in sensors, makes decisions about said data, and performs output. I have a loop that runs, and then calculates how long to sleep, so we can get as … | |
def main(): print ("-------------------------") print ("Program computes your BMI") print ("-------------------------") while weight == float(input("Enter weight in pounds: ")) while height == float(input("Enter height in inches: ")) if weight <= 0 or weight > 500: print ("Weight cannot be less than 0 or greater than 500") continue elif height <= … | |
A few months ago someone figured out how much money to put on a metrocard so that you end up with a zero balance instead of random amounts on your balance that you need to figure out how to even out or just throw away and lose that money. Now … | |
How do I read a .txt/.csv file from an internet address? For example: http:\\[url]www.internetaddress.com\file.txt[/url] I don't think file() would work for this. Thanks | |
hi, soat the moment i am writing an encryption program, i am not quite sure how to use for loops for lists, my list at the moment is this: **Somewhere in la Mancha, in a place whose name I do not care to remember, a gentleman lived not long ago, … | |
The Tkinter GUI toolkit's canvas object is very nice for all sorts of drawings and plotting. However, when it comes to saving the image Tkinter limits you to postscript printer files. One solution is to draw the same image in parallel on PIL's image-draw object in memory. This is made … | |
Hello, I have created pretty simple voice chat with pyaudio, but the voice is kinda meh. You hear usually some noise like in the old movies. It is probably caused by missing CHUNKs of voice which I send over UDP. Is it possible to somehow reduce the noise? Further I … | |
Hello. I was looking for a tutorial or any example of creating web crawler that i found this code somewhere and copied and pasted to test it: First, it is a web crawler, right? Because when i gave it a url of a website, the output was some linkes were … | |
Hi so in my list i have multiple characters - '32' which i need to replace with a space, would anybody be able to give an example of how to do this? Thanks | |
Hello all, I'm hoping this is related enough to python to merit being posted here. I'm hoping someone will possibly have a better way of doing it altogether. I'm using tetgen to try to create a hollow dome. I was using triangle and then just triangulating a circle and raising … | |
Hi,so I am supposed to encrypt a text file chosen by a user at the moment I have completed most of it (offset factor/shift), I have got each separate character from the text file and put it into a list and converted it into ASCII, I am wondering how you … | |
Can someone please give me an example code for a tkinker GUI of a reverse polish notation calculator written in python. |
The End.