15,175 Topics

Member Avatar for
Member Avatar for sun_2588

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 …

Member Avatar for chriswelborn
0
298
Member Avatar for arindam31

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' …

Member Avatar for Syed Sulaiman
3
10K
Member Avatar for bryann

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 …

Member Avatar for snippsat
0
263
Member Avatar for Abdulkabir_1

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] …

Member Avatar for Abdulkabir_1
0
572
Member Avatar for ThePlacid

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 …

0
209
Member Avatar for DarkRm

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 ...

Member Avatar for rubberman
0
331
Member Avatar for gishi

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 …

Member Avatar for Gribouillis
0
15K
Member Avatar for rhys1619

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 …

Member Avatar for fonzali
0
209
Member Avatar for Sukka_1

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 …

Member Avatar for David W
0
538
Member Avatar for rhys1619

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 …

0
110
Member Avatar for SpiritualMadMan

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 …

Member Avatar for Gribouillis
1
7K
Member Avatar for arindam31

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?

Member Avatar for Taywin
0
231
Member Avatar for rhys1619

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 …

Member Avatar for Gribouillis
0
329
Member Avatar for vegaseat

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.

Member Avatar for Ekta_1
3
2K
Member Avatar for micksulley

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 …

Member Avatar for micksulley
0
424
Member Avatar for homeboy

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 …

Member Avatar for invisal
0
310
Member Avatar for tony75

Hi I got this error when I ran my scrip? import vidcap,time ImportError: No module named vidcap Where can I download the module?

Member Avatar for tony75
0
625
Member Avatar for powerade661

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 …

Member Avatar for powerade661
0
365
Member Avatar for Jaspreet_3

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 …

Member Avatar for rproffitt
0
1K
Member Avatar for powerade661

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'): …

Member Avatar for powerade661
0
228
Member Avatar for glao

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 …

Member Avatar for glao
0
144
Member Avatar for tony75

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?

Member Avatar for rproffitt
0
371
Member Avatar for Nick_11

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 …

Member Avatar for Taywin
0
262
Member Avatar for v1shwa

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` …

Member Avatar for v1shwa
0
572
Member Avatar for ipman99

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 …

Member Avatar for snippsat
0
2K
Member Avatar for Valmian

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 …

Member Avatar for Jim_9
0
16K
Member Avatar for PyGuy123456789

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 …

Member Avatar for Gribouillis
0
411
Member Avatar for Dat One Lefty

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?

Member Avatar for Taywin
0
205
Member Avatar for Chris.T

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 …

Member Avatar for rubberman
-1
481
Member Avatar for Alok_3

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 …

Member Avatar for Alok_3
0
507

The End.