15,175 Topics
| |
Hi, I am trying to build a scrapper and for that I am using mechanize to get the page source then beautiful soup to parse it. But yesterday I faced a very strange error the page source which I am getting is kind of binary, though from browser I can … | |
Here is a weird regular expression for emails . We can have various kind of email addresses [email]string1@somemail.com[/email] [email]string1@somemail.co.in[/email] [email]string1.string2@somemail.com[/email] [email]string1.string2@somemail.co.in[/email] The following regular expression can find any of the mails above email2="santa.banta@gmail.co.in" email1="arindam31@yahoo.co.in'" email="bogusemail123@sillymail.com" email3="santa.banta.manta@gmail.co.in" email4="santa.banta.manta@gmail.co.in.xv.fg.gh" email5="abc.dcf@ghj.org" email6="santa.banta.manta@gmail.co.in.org" [CODE]re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email) >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email2) >>> x.group() 'santa.banta@gmail.co.in' >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email1) >>> x.group() 'arindam31@yahoo.co.in' … | |
Hi, I'm trying to write code that will allow me to assign values to lists of strings. I then want to compare user input to the lists and create a scoring system based on what has been typed in. For example if the input contains letters in list1 then the … | |
My issue is much. I have a csv file, and want to select where Arrival or Departure and must be the same "date and time" have the same value. I can only read from csv file but can't go further import pandas as pd df = pd.read_csv("data.csv") row = next(df.iterrows())[1] … | |
Hello, i need help with my project. Im making a program that encrypts and decrypts the contents of a text file. I had to generate an 8 character key which is converted to ascii and then calculate the offset factor of the key that was generated (New every time program … | |
Hi everyone I am new with you. I study in the university, they teaching us many programming languages. I wont you to help me to found the best to focus on. thank you by the way I am good in java ... | |
hi! i want to place the contents of a dictionary into a csv file. Can someone help me with this? i already have the code in reading the csv file [CODE] import csv reader = csv.reader(open("c:\sample.dat")) for row in reader: print row [/CODE] i want the first element of the … | |
hi this is my quiz. what i need to do is add a thing at the start where it askes the user their age. if the user is under the age of 5 they will only be asked 5 question and if there 5 or above they will be asked … | |
Hello friends, I'm currently in Tech class doing a project on a very old version of python and need help animating a moving object. I have no idea what to do please help i need to create a winter wonderland Landscape with a cabin, trees, a chimney with active smoke … | |
hi there what i've tried a lot is to make it so at the start of the quiz it asks the user there age. if the user is under 5 they will only be asked 5 questions and if there over 5 they will be asked all 10 #rhys translation … | |
I have a form from which I can launch various Test Modules. The Form has 16 PushButtons, one for each of the possible Modules. I need to disable Button_2 through Button_11 until the Modules that are connected to Button_1 and Button_0 are succesfully completed. The Buttons are on a pyQT … | |
I am trying to find out if a button is disabled....If it is , I want to enable it . For example : if button disabled: self.convertButton.setDisabled(False) So what can be button disabled be? | |
Hi this is a quiz i'm making for school. I've tried to add a restart but nothing worked. i want it to say "do you want to restart". the user then types yes or no and it will begin the quiz again. PLEASE HELP thanks # rhys translation quiz #intro … | |
Just a simple exploration of the goslate module (uses the Google Translate API) to translate some common languages. However, some IDE's create character problems. Note: Your computer has to be connected to the Internet to access Google. | |
I have been using Eric to develop Python2.7 code for a while. I have just tried to look at Python3 and cannot figure out how to do it in Eric. Setting > Preferences > Python says Python2 uses .py extension, Python3 uses .py3 I create hello.py3 #!/usr/bin/env python3 from platform … | |
Hi guys, could you tell me how to solve this problem. This is what i've done. The result show : [9, 2, 6] [3, 9, 5] l1 = [4,9,2,6] l2 = [3,9,4,5] i = 0 j = 0 while(i < len(l1)): while(j < len(l2)): if(l1[i] == l2[j]): del(l1[i]) del(l2[j]) j … | |
Hi I got this error when I ran my scrip? import vidcap,time ImportError: No module named vidcap Where can I download the module? | |
| So I am trying to make this code run in a constant loop. Any ideas how I would do this? As I said before I am trying to self teach myself Python and so far I have been successful. import os import datetime import time print('What would you like to … |
Hi, I need help if my Pseudocode is correctCreate and load an array with the following 7 values. Then add one more word (of your own choosing) to the array for a total of 8 words. This is a very basic programming class. We use Raptor lol biff comely fez … | |
| So I am trying to self teach myself Python, and so far it is working great. However I have ran into a bump in the road and can't really figure out why this script isn't working... Any ideas? import os answer = raw_input('Ready for shutdown, continue?') if answer == raw_input('Yes'): … |
Hello , Let's say I have : def mine( a, b ): return a>=b - 1 I can't understand what's going on with the -1. So , if a = 4 , b = 2 , it gives True If the opposite it gives False. As I said I don't … | |
Hi I have an python script send me log files and ip address from my PC-B Is it posssible to add functins that I can Remote uninstall (distance)my script from my PC-B? if yes how? any idea? | |
char patron10(int m , int n ) char patron10(int m , int n ) { for ( int = 0 ; i < m ; i++) cout<< "." ; int a = 0 ; while (True) { cout<< 10*a ; if (10*a >= n) break ; for ( int i … | |
Hello, I'm a python beginner & I'm learning it on my own. So, I've few (dumb) questions about it. - Where should I host a python project on linux? I'm sure there'd be multiple choices. So, Where would you host it & on what circumstances? - I understand that `virtualenv` … | |
I just started to learn python few days ago. This is a small program I made to practise. print("Find Volumes of some Popular Solids") print("") names=['(1) Sphere','(2) Right Circular Cone','(3) Cylinder'] x=0 while x < 3: print(names[x]) x +=1 print('\n' + 'Enter the number of the solid, you want to … | |
Hello, First of all, I'm sorry if my question seems silly, but I am very unfamiliar with Python. I am using a particular python code base which, in a Linux system, solves the problem I am working on (I am using Windows). A major part of the python code's task … | |
Given Problem: A professor at Hardtack University has an unusual method of grading. The students may or may not all take the same number of tests. The individual tests are weighted, and these weights are used to compute the student's average. Important: the weights for all of the tests for … | |
how could i download a empty file from a website and see if the lines are the same as a diffrent file on my computer? | |
0 down vote favorite I'm using Wireshark packet analyzer & when I filter for all "Websocket" packets I see what I am sending /receiving to the host. When I check individual packets mine always show as [MASKED], but you can 'Umask Payload' which shows the data in clear text that … | |
Get difference of two text files in excel and highlighting the difference using python. eg. file1.txt alok|test1|test2|test3|test4 alok1|test2|aewer|262771|262772 Rest|t1|rang|banh|test Must|t1|rang|banh|test file2.txt alok|test11|test2|test3|test4 alok1|test2|aewer|262771|262772 Rest||rang|banh|test In excel the difference should be shouwn as below: file1.txt|alok||`test2`|test3|test4 file2.txt|alok|`test11`|test2|test3|test4 file1.txt|Rest|`t1`|rang|banh|test file2.txt|Rest||rang|banh|test `file1.txt`|`Must`|`t1`|`rang`|`banh`|`test` Basically if a record is present but with some field with different … |
The End.