15,181 Topics

Member Avatar for
Member Avatar for sam.tubb.75

I'm very new to the Raycasting algorithim, and was reading a webpage on how it works with CPP code to accompany. I followed what the page described and converted it into Python/Pygame and then ran it, but my result was *very* different. I have a feeling it has something to …

Member Avatar for andybe
0
302
Member Avatar for jarograv

I have the following section of code that works perfectly when I run it as a .py file. When I convert it to a .exe using py2exe it appears that the linecache.getline() function is not working properly. I am able to create and write the .txt file fine, so I …

Member Avatar for Gribouillis
0
335
Member Avatar for lewashby

import pymongo uri = "mongodb://127.0.0.1:27017" client = pymongo.MongoClient(uri) database = client['fullstack'] collection = database['students'] students = [student['mark'] for student in collection.find({}) if student['mark'] == 99.0] print(students) In the program above how does this work? Why is the `if` statement after the execution code? I would expect the `if` to be …

Member Avatar for Gribouillis
0
398
Member Avatar for ALosh99

I plot the archimedaen spirlas for one branch, how can I plot more than one branches starting from the original, my code that I have written : n= 1000 a= 2. # will turn the spiral v= 1 omega = 0.1 r0 = v/omega T=100 N=10000 t=np.linspace(0,T,N+1) r= v*t theta …

0
118
Member Avatar for tony75

HI There is many method to bypass Antivirus detection! The Best way is writing your own toolsespecailly using python language. My question is How to protect your self againt PE portable excuteble and how we make Antivirus to detect for example metasploit payloads? I will appriciate for yur help

Member Avatar for powerade661
0
443
Member Avatar for checker

so here is my code [CODE]from math import sqrt class ageName: "class to represent a person" def _init_(self): self.name = "" self.age = 0.0 self.sqrtage = 0 g = ageName() g.name = raw_input("Enter a name, or stop to exit: ") g.age = int(raw_input("Enter an age: ")) g.sqrtage = sqrt(g.age) list1 …

Member Avatar for Gribouillis
0
2K
Member Avatar for overwraith

I was wondering if there were any USB powered web cams for the Raspberry pi that are specifically No-IR. I know about the camera module which plugs directly into the board, I was wondering however if there are any alternatives, usb powered so I could perhaps plug in more than …

Member Avatar for overwraith
0
195
Member Avatar for SagarK95

I have basic knowledge about python. I am looking for help with this code: how is the snake moving? How does it length increases on colliding with the object? And, how does it detect when it touches itself or when it collides with the wall? It also has semicolon in …

Member Avatar for BustACode
0
439
Member Avatar for Thea1950

Hi all, Can someone please define what a build and release engineer is in a brief summary. I've googled this but still have no idea what the person in this industry would do. **A**: What is a build and release engineer. **B**: What is a build and release engineer expected …

Member Avatar for rubberman
0
96
Member Avatar for mcroni

i am trying to build an app that implements a double tap feature to open another screen, the UI includes a textinput. but with this implementation the textinput doesnt respond. def change(self): self.manager.current = 'screen2' def on_touch(self,touch): if touch.is_double_tap(self): self.change()

0
131
Member Avatar for Onion13

Studying python and in the lesson it says to modify anc change the program. I thought I'd make the game more interactive. I know it requires the program to use inheritance and I've read everything and Ive tried everything. Ive run out of ideas and would appreciate any and all …

Member Avatar for Onion13
0
287
Member Avatar for OrcaSoul

I have a Python script getData.py that uses Mechanize, and runs fine under the interpreter. It was installed using easy_install - and the install seemed to indicate it was completed. The problem is, when I try to compile it using py2exe while in the folder of the script, and using …

Member Avatar for Gribouillis
0
612
Member Avatar for ray.shahil95

def list_function(x): x[1] = x[1] + 3 return x[1] n = [3, 5, 7] print list_function(n) It shows following error when i run the code for multiple times. 1. Oops, try again. list_function([6, 3]) returned 6 instead of [6, 6] 2.Oops, try again. list_function([1, 6]) returned 9 instead of [1, …

Member Avatar for ray.shahil95
0
161
Member Avatar for ray.shahil95

lloyd = { "name": "Lloyd", "homework": [90.0, 97.0, 75.0, 92.0], "quizzes": [88.0, 40.0, 94.0], "tests": [75.0, 90.0] } alice = { "name": "Alice", "homework": [100.0, 92.0, 98.0, 100.0], "quizzes": [82.0, 83.0, 91.0], "tests": [89.0, 97.0] } tyler = { "name": "Tyler", "homework": [0.0, 87.0, 75.0, 22.0], "quizzes": [0.0, 75.0, 78.0], …

Member Avatar for ray.shahil95
0
359
Member Avatar for dhitinair

can anyone suggest how to convert python code to java. Following is the python implementation """ K-prototypes clustering """ # Author: 'Nico de Vos' <njdevos@gmail.com> # License: MIT from collections import defaultdict import numpy as np from scipy import sparse from sklearn.utils.validation import check_array from . import kmodes def euclidean_dissim(a, …

Member Avatar for stultuske
0
1K
Member Avatar for Prateek_2

I am learning django, here is the model i have created class UserProfile(models.Model): name = models.CharField(max_length=50, verbose_name="Name") login = models.CharField(max_length=25, verbose_name="Login") password = models.CharField(max_length=100, verbose_name="Password") phone = models.CharField(max_length=20, verbose_name="Phone number") def __str__ (self): return self.name Since `name` is a static variable, so in method `__str__`, it can also be called …

Member Avatar for Gribouillis
0
329
Member Avatar for Ali_56

Hey, still a beginner in Python. I was wondering if anybody could help me out with all this info. Im planning to make an actual game, but first i have to get classes/methods etc. I thought maybe this would be some good classes: Trainer, Pokemon, Moves, Stats, Type, Pokeball, Pokedex …

Member Avatar for Ali_56
0
8K
Member Avatar for vegaseat
Member Avatar for Mattia_1

I'm tryng to read sentence for sentence from an input with python: sentences = raw_input("Insert some sentences here: ") (For example: Hello, my name is Mattia) How i can read sentence for sentence? For example: 1 = "Hello" 2 = "," 3 = "my" 4 = "name" 5 = "is" …

Member Avatar for Onion13
0
3K
Member Avatar for powerade661

Hello Everyone, I am having issues with this current script. I am trying to create a Twitch bot in Python. Any help with this would be much appreciated. The issue that I am having is it is not replying back with the message Hello there, when I type in "Hello" …

Member Avatar for powerade661
0
154
Member Avatar for Gribouillis

This snippet defines a function returning new identifiers created from reading the computer's time.

Member Avatar for Gribouillis
0
515
Member Avatar for Onion13

I've been learning python and I'm almost finished and I'm learning about oop. I have a question, is it possible to make a looping menu using oop on python (Not using Tkinter, WX) without having to key in the object. I learn better through playing around with what I've learned …

Member Avatar for Onion13
0
8K
Member Avatar for Popc0rn

If you develop for Android, what do you use to do so? Do you write your apps in a MS Windows environment and then drop it into the Android environment? Or, do you do all of your coding on the Android tablet itself? What do you do, how do you …

Member Avatar for gtel
0
215
Member Avatar for MrQuentin

Hello! my name is Quentin and i am a young french programmer and i have some issue with my program i don't know how to simplify it for the refresh function and the creation of rectangles. i would like to create a fonction that create X rectangles for me then …

Member Avatar for Gribouillis
0
216
Member Avatar for steven.rose.94

Fair warning - I'm still learning so this might be a very newb like question: What I'm trying to do: I'm trying to import a python file into a Tkinter window and run it when I press a button. Eventually I'd like to display the output of the imported script …

Member Avatar for steven.rose.94
0
573
Member Avatar for Ahmed_65

Hi guys, I am new Python user, I am using SAX module to extract some information from a very big xml file (55 GB)....I want to know if there is path, xpath or something like that in SAX module to work on a specific tags and ignore other tags in …

0
95
Member Avatar for Amit_31

name='' eggs=0 pony=0.0 So why we write " while name:" Instead of " while name=='': " What are these Truthy and Falsey values? And what are the rules for writing name: Instead of name==''.

Member Avatar for Sean Francis
-1
130
Member Avatar for vegaseat

The module pyglet leans on OpenGL for graphics and is used in the scientific community together with Python. This short code snippet shows you how to use it to display an animated GIF file. The download is free, so give it a try. You don't have to download OpenGL to …

Member Avatar for kwekey
4
17K
Member Avatar for Abdulkabir_1

ID Arrival Departure ArrivalDate DepatureDate 1001 New York Holland 2009-09-23 2012-07-23 1301 Florida Germany 2010-10-23 2012-10-11 1401 New York Holland 2009-09-23 2009-09-25 1301 New York Beijing 2009-09-23 2010-09-21 1201 New York Holland 2008-01-01 2009-09-23 1001 Virginia New York 2008-01-01 2009-09-22 1021 New York Holland 2009-09-23 2009-09-25 1001 New York Holland …

Member Avatar for rproffitt
0
350
Member Avatar for Aeonix

If I wrote a program which would `Console.WriteLine()` a base64 code, like an easter egg ("a hidden secret" in gaming jargon) or something, for example string EasterEgg = "dGhlYmlnc2VjcmV0"; Console.WriteLine(b64d(EasterEgg)); And I would let a good obfuscator run through it. Now I know that crackers with enough time and knowledge …

Member Avatar for Aeonix
0
447

The End.