15,181 Topics

Member Avatar for
Member Avatar for M.S.

I tried many times but no luck. I want to parse a text file with a vcard format (from my phone contacts). the text file looks like this: BEGIN:VCARD VERSION:2.1 REV:20110913T095232Z UID:aac119d5fe3bc9dc-00e17913379d6cc8-3 N;X-EPOCCNTMODELLABEL1=First name:;[B]Maj[/B];;; TEL;VOICE:[B]09120000000[/B] X-CLASS:private END:VCARD BEGIN:VCARD VERSION:2.1 REV:20110228T083215Z UID:aac119d5fe3bc9dc-00e17b0693898c98-4 N;X-EPOCCNTMODELLABEL1=First name:;[B]Ali jahan[/B];;; TEL;VOICE:[B]09120000001[/B] X-CLASS:private END:VCARD BEGIN:VCARD VERSION:2.1 REV:20110228T083510Z …

Member Avatar for snippsat
0
2K
Member Avatar for apeiron27

ok i'm not sure if i can use regex to do this it'd be great if you can give some suggestions! i have a list of pure numbers in one hand and another list of also numbers but with dashes. it's like this: list1 = [245366556346,4534525326562,56345254234237... list2 = [75465-54224-4,3-55-342526,.... as …

Member Avatar for Gribouillis
0
103
Member Avatar for huskeraider

Greetings, I found the equivalent of this in Java but not Python. What i'm trying to figure out is how to reverse and print each of 5 lines in a text file backwards. I am able to take this: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod …

Member Avatar for Thisisnotanid
0
785
Member Avatar for runge_kutta

Hello, I would consider myself a decent python programmer (this may or may not be true). In the past, I have had a few small python contracts and have been screwing around with the language for a few years (I also have experience with c++, java/html/css/javascript/etc). What I would really …

Member Avatar for joehms22
0
200
Member Avatar for Matjame

Hi. I have the below code that update a 'dirpath' and 'cobdate'(calendar) field from a website. When I look at the results from my python script. I can see the correct 'dirpath'. The date value selected is correct(as 2012-01-16) but when it posts or submit, the date comes up incorrectly(20120116) …

Member Avatar for joehms22
0
215
Member Avatar for Xytheron

Hello all, Long time reader, first time poster here. I've been a web programmer for some time now but really never got into any scripting languages, I guess you could say I was just a web designer. Either way I want to write a little web server in Python to …

Member Avatar for joehms22
0
324
Member Avatar for tony75

[B]Hiding .exe file inside JPEG using python3[/B] Hi I would like to hide calc.exe inside the jpg and when I click to my JPEG I would like the calc.exe will execute. My python script do this 1.hide calc.exe file inside jpeg. 2.run calc.exe when I open my jpeg. [B]I will …

Member Avatar for sun_2588
0
234
Member Avatar for Ismatus3

Hello all , I just need to create a folder in an other machine using ssh or samba ; for example i execute : [CODE]os.mkdir( rachid@rachid:/home/rachid/Bureau/new, 0777 ); [/CODE] but It shows the next error : [QUOTE]OSError: [Errno 2] No such file or directory: 'rachid@rachid:/home/rachid/Bureau/new'[/QUOTE] Thank you for answering .

Member Avatar for Ismatus3
0
2K
Member Avatar for funfullson

I am trying to convert a 2d image to 3d one in python. please introduse me some good source or if there is an open source program. Thanks alot.

Member Avatar for funfullson
0
4K
Member Avatar for sainitin

I have text file as follows seq.txt >S1 AACAAGAAGAAAGCCCGCCCGGAAGCAGCTCAATCAGGAGGCTGGGCTGGAATGACAGCG CAGCGGGGCCTGAAACTATTTATATCCCAAAGCTCCTCTCAGATAAACACAAATGACTGC GTTCTGCCTGCACTCGGGCTATTGCGAGGACAGAGAGCTGGTGCTCCATTGGCGTGAAGT CTCCAGGGCCAGAAGGGGCCTTTGTCGCTTCCTCACAAGGCACAAGTTCCCCTTCTGCTT CCCCGAGAAAGGTTTGGTAGGGGTGGTGGTTTAGTGCCTATAGAACAAGGCATTTCGCTT CCTAGACGGTGAAATGAAAGGGAAAAAAAGGACACCTAATCTCCTACAAATGGTCTTTAG TAAAGGAACCGTGTCTAAGCGCTAAGAACTGCGCAAAGTATAAATTATCAGCCGGAACGA GCAAACAGACGGAGTTTTAAAAGATAAATACGCATTTTTTTCCGCCGTAGCTCCCAGGCC AGCATTCCTGTGGGAAGCAAGTGGAAACCCTATAGCGCTCTCGCAGTTAGGAAGGAGGGG TGGGGCTGTCCCTGGATTTCTTCTCGGTCTCTGCAGAGACAATCCAGAGGGAGACAGTGG ATTCACTGCCCCCAATGCTTCTAAAACGGGGAGACAAAACAAAAAAAAACAAACTTCGGG TTACCATCGGGGAACAGGACCGACGCCCAGGGCCACCAGCCCAGATCAAACAGCCCGCGT CTCGGCGCTGCGGCTCAGCCCGACACACTCCCGCGCAAGCGCAGCCGCCCCCCCGCCCCG GGGGCCCGCTGACTACCCCACACAGCCTCCGCCGCGCCCTCGGCGGGCTCAGGTGGCTGC GACGCGCTCCGGCCCAGGTGGCGGCCGGCCGCCCAGCCTCCCCGCCTGCTGGCGGGAGAA ACCATCTCCTCTGGCGGGGGTAGGGGCGGAGCTGGCGTCCGCCCACACCGGAAGAGGAAG TCTAAGCGCCGGAAGTGGTGGGCATTCTGGGTAACGAGCTATTTACTTCCTGCGGGTGCA CAGGCTGTGGTCGTCTATCTCCCTGTTGTTC >S2 ACACGCATTCACTAAACATATTTACTATGTGCCAGGCACTGTTCTCAGTGCTGGGGATAT AGCAGTGAAGAAACAGAAACCCTTGCACTCACTGAGCTCATATCTTAGGGTGAGAAACAG TTATTAAGCAAGATCAGGATGGAAAACAGATGGTACGGTAGTGTGAAATGCTAAAGAGAA AAATAACTACGGAAAAGGGATAGGAAGTGTGTGTATCGCAGTTGACTTATTTGTTCGCGT TGTTTACCTGCGTTCTGTCTGCATCTCCCACTAAACTGTAAGCTCTACATCTCCCATCTG TCTTATTTACCAATGCCAACCGGGGCTCAGCGCAGCGCCTGACACACAGCAGGCAGCTGA CAGACAGGTGTTGAGCAAGGAGCAAAGGCGCATCTTCATTGCTCTGTCCTTGCTTCTAGG AGGCGAATTGGGAAATCCAGAGGGAAAGGAAAAGCGAGGAAAGTGGCTCGCTTTTGGCGC TGGGGAAGAGGTGTACAGTGAGCAGTCACGCTCAGAGCTGGCTTGGGGGACACTCTCACG CTCAGGAGAGGGACAGAGCGACAGAGGCGCTCGCAGCAGCGCGCTGTACAGGTGCAACAG CTTAGGCATTTCTATCCCTATTTTTACAGCGAGGGACACTGGGCCTCAGAAAGGGAAGTG CCTTCCCAAGCTCCAACTGCTCATAAGCAGTCAACCTTGTCTAAGTCCAGGTCTGAAGTC CTGGAGCGATTCTCCACCCACCACGACCACTCACCTACTCGCCTGCGCTTCACCTCACGT GAGGATTTTCCAGGTTCCTCCCAGTCTCTGGGTAGGCGGGGAGCGCTTAGCAGGTATCAC CTATAAGAAAATGAGAATGGGTTGGGGGCCGGTGCAAGACAAGAATATCCTGACTGTGAT TGGTTGAATTGGCTGCCATTCCCAAAACGAGCTTTGGCGCCCGGTCTCATTCGTTCCCAG CAGGCCCTGCGCGCGGCAACATGGCGGGGTCCAGGTGGAGGTCTTGAGGCTATCAGATCG GTATGGCATTGGCGTCCGGGCCCGCAAGGCG . . . . I …

Member Avatar for TrustyTony
0
290
Member Avatar for Zeref

So i was busy playing around with the python module MySQLdb and looking at sql injection. [CODE] import MySQLdb def hack(name): db=MySQLdb.connect('xxx','xxx','xxx','xxx') cursor=db.cursor() sql="SELECT * FROM PLAYERS WHERE NAME = %s" %(name) print sql cursor.execute(sql) print cursor.fetchall() [/CODE] i entered Hack("'pete' OR '1'='1'") results were: SELECT * FROM PLAYERS WHERE …

Member Avatar for woooee
0
279
Member Avatar for colejmc20

1. (10 points) Using string method find, extract the Video link from the following HTML code for embedding videos on a web page. Your code should work for any embedded code of this format. <embed src="http://www.youtube.com/v/Xp2uzv9uSn8?version=3&feature=pl ayer_detailpage" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="360"> 2. (10 points) In the Disney cartoon adaptation …

Member Avatar for woooee
0
164
Member Avatar for Irina77

Please give me ideas why would I get following errors: [code] Traceback (most recent call last): File "C:\temp_Jag\FilePickling.py", line 3, in <module> unpickledlist = pickle.load(unpicklefile) File "C:\Python26\lib\pickle.py", line 1370, in load return Unpickler(file).load() File "C:\Python26\lib\pickle.py", line 858, in load dispatch[key](self) File "C:\Python26\lib\pickle.py", line 1142, in load_pop_mark k = self.marker() File …

Member Avatar for Irina77
0
190
Member Avatar for jola.chmiel

Hi, I am just begining my adventure(if i may call it this way) with python used for web development. I found out that there are two well known frameworks: django and pylons. I read about them a lot, but I am not certain which one to pick. That's why I …

Member Avatar for sun_2588
0
108
Member Avatar for sun_2588

Hello everyone , i am trying to write a python code which will setup user quota for a user home directory...... i am successful in completing all the basic configuration, like entry in fstab file running quotacheck command.... The only issue which i am facing is of edquota command .... …

0
65
Member Avatar for Tcll

first off... a litte explanation as to what I'm doing... this is basically a way for me to create an update system for my program... the webhost I'm using allows hot-file linkage, so there's nothing that's improper... (except for my compy not having net) anyways... the structure I have for …

Member Avatar for Tcll
0
165
Member Avatar for Gribouillis

These two functions compute the orders of the lowest bit and the highest bit set in the binary representation of an integer. I expect them to handle securely very large integer values.

Member Avatar for Gribouillis
1
2K
Member Avatar for spyhawk

I am new to python i am trying to return True if the strs are the same (including lettercase), and False otherwise. def abc(str, str): x = raw_input() y = raw_input() return x==y i have no idea how to compare two strings, is there code for getting how many letters …

Member Avatar for woooee
0
158
Member Avatar for imperfectluck1

k I'm trying to create a program that calculates the Standard deviation of a sample of r random numbers between 0 and 1 in python 2.7. This is my program: [CODE] from random import random r= input("please enter a number r: ") for i in range(r): sum1=0 i = random() …

Member Avatar for woooee
0
153
Member Avatar for ronvenna

Hello I am supposed to find a bunch of different statistics from a text file for a homework assignment. I have found everything except the shortest line that is not a blank line. Can someone help me solve this problem? Thanks [CODE] def stats(): linecount = 0 blankline = 0 …

Member Avatar for woooee
0
530
Member Avatar for Noliving

Hello everyone, I'm obviously having trouble with a program that wants me to create a house with just five mouse clicks. My program is simple create a house using only 5 mouse clicks. This problem is from the book Python Programming by John Zelle Its on page 162 This is …

Member Avatar for Karsam
-1
4K
Member Avatar for subhra1234

hello,everyone,basically,i am trying to install [B]pyaramid[/B] framework,i have [B]windows[/B] installed in my system,and i am follwing this link at the time of installing pyramid.... [B][url]http://docs.pylonsproject.org/projects/pyramid/en/1.0-branch/narr/install.html[/url][/B] [B][COLOR="red"]1.[/COLOR][/B][B]Installed Python 3.2 in my system and set the path D:\python32 in My Computer->Properties –> Advanced Tab –> Environment Variables and add that directory to …

Member Avatar for subhra1234
0
270
Member Avatar for subhra1234

hello,everyone,i am a beginner in python and at the time of creating a project in pyramid framework i am facing some sort of problem,i have a windows system,and i have pyramid installed in my system.... my current location of python is d:\python27 i am following this tutorial from pyramid documentation …

0
49
Member Avatar for LdaXy

i'm learning python currently, coming from c++ and i realized that i can't do certain things like in C++ anyways, i created a class call Object_refs: [CODE] #attempt to make a structure like class using INIT #to define all common variables. class Object_refs: def __INIT__(self, descriptor_type, type, reference_count, flags): self.desctype …

Member Avatar for LdaXy
0
220
Member Avatar for inuasha

I want to be able to generate my own random numbers without using the random module. I want to do this that way I can learn somewhat how to do the big boy code on my own.

Member Avatar for snippsat
0
2K
Member Avatar for soltak

Hi, I'm using Windows and Python 3. I'm having problems using [B]os.listdir[/B] with Unicode. Let's say I have a directory which contains files with Unicode file names. The name and path of the directory itself might or might not be Unicode. When it is Unicode, I can't seem to get …

Member Avatar for soltak
0
2K
Member Avatar for edwords12

I want to know what to do if i have some content in a text file, i wish to preprocess it by removing certain things. from the file the text file has content as shown below sub_401000 proc near [B]; [/B]CODE XREF: sub_4021FD+7Fp [B]; [/B]sub_403366+40Dp ... loc_401019: ; CODE XREF: …

Member Avatar for sorry711
0
166
Member Avatar for patyypol

need to make a function that sorts integers from smallest to largest without using the sort function in python python must open a file with integers one per line store the data in a list then print the unsorted list then bubble sort code sorts the list from smallest to …

Member Avatar for TrustyTony
0
121
Member Avatar for WolfShield

Hey everyone, I was wondering what some reasons would be to use an XRC file in a program? Does it make it easier to read? Does it help with organization? Are there times where that format is needed/beneficial? Just looking to know, - [B][I]WolfShield[/I][/B]

0
77
Member Avatar for harrygriet

Hi I am trying to create a simple webserver program in python 3.2.2 and I want the server to process different methods other than GET and POST. These methods are handled by default by the library. I want to handle a OPTIONS method and I used a do_OPTIONS() method to …

0
90

The End.