15,190 Topics
![]() | |
Sometimes we want to not split by every space character, but we want to split only on those outside of brackets and quotes. This way we can have for example quoted string as single argument for command. EDIT: 1. Added hierarchical nesting of same kind of brackets. 2. Bunching multiple … | |
![]() | Hello guys, I am Toni Hacker, i browsed through this forum and I saw you guys really talk more about programming. i wanna make an operating system but i need a team. please its gonna be an open project. I need your advice and help. anybody care to help |
I' m trying to see if it is possible to write a keyboard only wxpython program. All of the tutorials I'm finding on the web when run have no focused control at all. That's fine if you expect the user to click with a mouse. I'll try to give a … | |
it says the following: Write a function that converts the time to 24hr format. Examples [CODE] >>> time24hr('12:34am') '0034hr' >>> time24hr('12:15pm') '1215hr' [/CODE] so i wrote the following: [CODE] def time24hr(tstr): a = tstr.split(':') am = {'12':'00','1':'01','2':'02','3':'03','4':'04','5':'05','6':'06', '7':'07','8':'08','9':'09','10':'10','11':'11'} pm = {'12':'12','1':'13','2':'14','3':'15','4':'16','5':'17','6':'18', '7':'19','8':'20','9':'21','10':'22','11':'23'} if 'am' in tstr: return am[a[0]] + a[1][:2] … | |
iam asking about chimical equations how can i programme it to the computer how can i make the computer understand that c+o2=co2 or naoh + hcl =nacl+h2o i mean how he understand that acid +alkail= water +salt | |
how to take a dictionary from this list ? Shop = ["Apple" , "orange", "mangoo" . "Tomato" . "grape"] #Example# $python shop.py > > 1. apple > 2. orange > 3. mangoo > 4. tomato > 5. grape > > > What will u buy? use number (1-5) : 2 … | |
Hi, i was wondering how to change the lable text in Python after clicking a button. For example: `from Tkinter import * `def onclick():` pass import tkMessageBox root = Tk() root.title("Pantai Hospital") L1 = Label(root, text='Welcome to Pantai Hospital!') L1.pack() L2 = Label(root, text='Login') L2.pack() L3 = Label(root, text = … | |
I'm stuck on adding a feature to my program where a user types in the email address and stores email and raffle into a database.Also the raffle entires will be selected at random from all stores entries.heres my code from __future__ import print_function from random import seed, randrange, shuffle, sample … | |
Hi How can I install and use pyinstaller under Kali linux I appricate your help with an example | |
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 … | |
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 … | |
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 … | |
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 … | |
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 ![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
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() | |
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 … | |
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 … | |
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, … | |
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], … | |
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, … | |
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 … | |
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 … | |
This simple key logger shows any character/special key when pressed. | |
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" … | |
![]() | 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" … ![]() |
This snippet defines a function returning new identifiers created from reading the computer's time. |
The End.