comp.lang.python
www.freeservice6.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
Client Needs---QA Manual Tester at Sacramento, CA
Good Day, We have an urgent Contract Openings in Folsom, CA Looking forward to submit your resume for below mentioned Requirement… If you are interested, Please forward your latest resume along with location and pay rate details to r...@tech-netinc.com Job Title: QA Engineer(Strong Web services Experience Needed) Location: Sacramento, CA Duration: 2 Years Required: • Strong knowledge of SDLC • Manual testing experience should be 6+ years • Web services exp must be more than 4+ years • Solid background of software testing methods, processes, tools • Strong in XML,UNIX and SQL • Advance level knowledge and hands-on experience with Test Planning, Test Development, Test Data Setup, Test Execution and Test Reporting. • Knowledge of variety of testing methods and direct experience in test development and execution of functionality, integration, security, transaction, error handling, performance of web applications. • Expertise in testing web services API using Parasoft SOA Test or SOAP UI. • Hands-on experience with Quality Center/ALM 11. • Experience working in Windows and Unix (Linux) environments. • Team player with good mentoring and presentation skills Desired: • ISO or Electricity Industry experience • GUI and API test automation using HP Quick Test Pro • Load/performance test automation using HP Load Runner • Experience in integrating QTP, SOA Test, Load Runner or other test automation tools with HP Quality Center • Advance level experience in using and administering Quality Center, developing workflows to customize QC using VB Script. • Strong programming/scripting background in Java and Python. Able to code review and develop unit test if needed. Environment: JBoss, Groovy and Grails, Oracle 11g, SQL, XNL, Actuate, Reporting Services, SharePoint, Quality Center, Quick Test Pro, Load Runner, SOA Test, Windows, Linux. Thanks, Ram Dev Recruiter Tech-Net Inc. Tel: 916-458-4390 Ext 102 Email: r...@tech-netinc.com URL: www.tech-netinc.com -- http://mail.python.org/mailman/listinfo/python-list
Client Needs Sr. Java Developer, Sacramento, CA
Good Day, We have an urgent Contract Opening in Sr.Java Developer Looking forward to submit your resume for below mentioned Requirement… If you are interested, Please forward your latest resume along with location and pay rate details to r...@tech-netinc.com asked at the bottom of mail Job Title: Sr. Java Developer Location: Sacramento, CA Duration: 12+ Months Required Skills: • J2EE • SOA • Web services(Strong, i.e., 3-4 years) • Oracle pl/sql • UNIX platform • Full Name: • Current Location: • Pay Rate : • Contact Details: • Email: • Availability: • Visa Status: • Relocation to : • Last 4-digits of SSN: • References: • Ready for Telephonic discussion during office hours Thanks, Ram Dev Recruiter Tech-Net Inc. Tel: 916-458-4390 Ext 102 Email: r...@tech-netinc.com -- http://mail.python.org/mailman/listinfo/python-list
Need Data Architect/Technical Business Analyst For 6months at San Rafael, CA
Good Day, urgent Requirement : San Rafael, CA 6 months As a member of the Market Intelligence team, the Data Architect/Technical Business Analyst will be tasked with assessing current state business process and corresponding data flows, understanding Marketing business objectives, and identifying gaps in process, systems, and data that prevent execution against those objectives. This will require understanding the broader internal data integration landscape to adequately determine synergies/ overlap and call out integration areas pertinent to Marketing that are insufficiently addressed by current systems and in-flight projects. Principal Duties and Responsibilities: • Develop clear understanding of company’s integrated Marketing objectives/KPIs • Leverage IT and Marketing resources to understand related process/data flows • Develop and execute ETL procedures to integrate required sources (where currently feasible) • Perform data/system/project gap analysis, documenting issues within the context of Marketing objectives • Work closely with/inform business owners and project teams to ensure that documented gaps are addressed Requirements: • 5+ years SQL experience (SQL Server, Oracle) experience • 5+ years ETL (SSIS, DTS, Informatica) experience • High proficiency in data/systems analysis and integration • Understanding of data models, data quality • Proven ability to work within a highly-matrixed, global organization • Excellent documentation and organizational skills • Excellent communication skills, both written and verbal, and interpersonal skills Desired Knowledge/Skills: • Siebel CRM data model experience strongly preferred • Business systems analysis./process engineering experience strongly preferred • SFDC data model experience a plus • Understanding of Clients Customer, Product, Contract, and Entitlement data/structures a plus Thanks, Ram Dev Recruiter Tech-Net Inc. Tel: 916-458-4390 Ext 102 Email: r...@tech-netinc.com -- http://mail.python.org/mailman/listinfo/python-list
Client Needs at Network Engineer at Germantown,MD
Good Day, We have an urgent Contract Opening in Germantown, MD. Looking forward to submit your resume for below mentioned Requirement… If you are interested, Please forward your latest resume along with location and pay rate details to r...@tech-netinc.com Job Title: Network Engineer Location: Germantown,MD Duration: 6+ months Position Details: Client is looking for a Network Engineer to join a multi-member / multi-region team which supports a Global Enterprise Network consisting of more than 50 sites. The successful candidate will engage with a Global team supporting systems and tools which include Cisco and HP networking and security systems, Blue Coat proxies, Juniper and Cisco SSL VPN appliances, Cisco and F5 load balances, H.323 and SIP voice gateways, Riverbed optimization and analysis appliances and management tools such as SPLUNK, Solar Winds Orion and TACACS+. Principal duties and responsibilities may include, but are not limited to: • Participate in rotating on-call coverage (as an escalation point for Tier 2) • Identify, diagnose, and resolve complex network problems • Assist application teams to diagnose and resolve performance issues over the network using sniffing tools (i.e. wire shark) • Able to travel occasionally for special projects • Implement, maintain and enhance network management tools (i.e. Riverbed Cascade, SPLUNK, Solar Winds Orion, etc…) • Review project specifications and make design/implementation recommendations for improvements • Escalation point for incident, change, and service request tickets • Preparation of proposals and solution presentations • Act as a level 3 support for firewalls, load balancers, routing, and switching. Work with technical group to resolve issues in a timely manner • Mentor and knowledge sharing (training) for Tier 2, Tier 1, desk side and helpdesk support staff • Submit network level changes and provide appropriate level of coordination along with implementation. • Maintain knowledge of the network environment and sufficient familiarity with business/application/systems • Perform work in an ethical manner, and act at all times with a business professional manner Required Qualifications: • Minimum eight (8) years networking support for medium to large networks • Have senior/expert knowledge of routing and switching with Cisco and HP hardware/software. • Have senior/expert knowledge of Cisco ASA / ACE / ACS / TACACS+ / NCS, Juniper, and F5 • Have senior/expert knowledge of ACE and F5 load balancing technologies. • Capable of performing packet level analysis. • Have senior/expert knowledge of Cisco Router suite of products (2900/3800, 3900/2900, ASR, etc.) • Have senior/expert knowledge of Cisco Switch suite of products (6500, 4500, 4900, 3750, etc.) • Have senior/expert knowledge of WAN technologies: Frame Relay, ATM, T3, MPLS, MetroE • Have senior/expert knowledge of Internet and networking technologies such as DNS, SMTP, SNMP, NTP. • Ability to understand and adhere to systems security and control procedures in accordance with departmental, vendor standards and regulatory bodies • Knowledge of network technologies such as, TCP/IP protocol, Layer 2 Spanning Tree, Layer 3 routing (EIGRP, BGP, OSPF), Quality of Services, DNS, DHCP, SNMP • Good knowledge of IP Telephony • Good Knowledge of Server Virtualization (i.e. VM Ware) and networking requirements to support • Have senior/expert knowledge of network cabling standards and wireless network technologies • Have senior/expert knowledge of enterprise network management tools such as Cisco Works, HP Open view, Solar Winds • Provide leadership to junior staff • Must be able to create and update documentation with Visio, Excel and Word • At least 2 years in a team lead or technical project management role, with experience in: o Ability to oversee and lead vendors and other network department resources o Ability to interact with other departments such as facilities • Ability to work independently and provide timely status updates. • Good oral and written communications skills. • Ability to handle multi-tasking and frequently changing priorities. • Cisco Certifications a plus • Familiarity with ITIL processes a plus Thanks, Ram Dev Recruiter Tech-Net Inc. Tel: 916-458-4390 Ext 102 Email: r...@tech-netinc.com Ym: vramde...@yahoo.com URL: www.tech-netinc.com -- http://mail.python.org/mailman/listinfo/python-list
I'm looking for a Junior level Django job (telecommute)
I'm looking for a Junior level Django job (telecommute) About me: - less than year of experience with Python/Django - Intermediate knowledge of Python/Django - Experience with Linux - Experience with Django ORM - Passion for developing high-quality software and Python language - I am able to use many aplications, for example (south, mptt, django-debug-toolbar etc.) - English: communicative, still learning I would like to develop my qualifications I can be reached anytime via email at dreampr...@gmail.com Thank you. -- http://mail.python.org/mailman/listinfo/python-list
Project
Please, tell me how to develop project on "how people intract with social networing sites". -- http://mail.python.org/mailman/listinfo/python-list
MemoryError vs malloc error
Hi, I've a long running python process (running on freebsd). Sometimes when it uses too much memory it core dumps. I would've expected it to raise MemoryError. Normally, when would a python process raise MemoryError and when would it fail with malloc error and cores? This is happening in pure python code (Eg. if ' '.join(biglist)) etc. Regards, Amit -- http://mail.python.org/mailman/listinfo/python-list
Reference Cycles with instance method
Simple question. If I have the following code: class A: def __init__(self, s): self.s = s self.m2 = m1 def m1(self): pass if __name__ == '__main__': a = A("ads") a.m1() a = None The object is not garbage collected, since there appears to be a cycle (between method m2 and A). I would expect this to behave the same as having another method "def m2(self): self.m1()", but unfortunately its not. In above case m2 seems to be in a.__dict__ which is causing the cycle. Any idea why this is so? Regards, Amit -- http://mail.python.org/mailman/listinfo/python-list
Memory Usage of Strings
I'm observing a strange memory usage pattern with strings. Consider the following session. Idea is to create a list which holds some strings so that cumulative characters in the list is 100MB. >>> l = [] >>> for i in xrange(10): ... l.append(str(i) * (1000/len(str(i This uses around 100MB of memory as expected and 'del l' will clear that. >>> for i in xrange(2): ... l.append(str(i) * (5000/len(str(i This is using 165MB of memory. I really don't understand where the additional memory usage is coming from. If I reduce the string size, it remains high till it reaches around 1000. In that case it is back to 100MB usage. Python 2.6.4 on FreeBSD. Regards, Amit -- http://mail.python.org/mailman/listinfo/python-list
Re: Memory Usage of Strings
sum(map(len, l)) => 8200 for 1st case and 9100 for 2nd case. Roughly 100MB as I mentioned. On Wed, Mar 16, 2011 at 11:21 PM, John Gordon wrote: > In Amit Dev > writes: > >> I'm observing a strange memory usage pattern with strings. Consider >> the following session. Idea is to create a list which holds some >> strings so that cumulative characters in the list is 100MB. > >> >>> l = [] >> >>> for i in xrange(10): >> ... l.append(str(i) * (1000/len(str(i > >> This uses around 100MB of memory as expected and 'del l' will clear that. > >> >>> for i in xrange(2): >> ... l.append(str(i) * (5000/len(str(i > >> This is using 165MB of memory. I really don't understand where the >> additional memory usage is coming from. > >> If I reduce the string size, it remains high till it reaches around >> 1000. In that case it is back to 100MB usage. > > I don't know anything about the internals of python storage -- overhead, > possible merging of like strings, etc. but some simple character counting > shows that these two loops do not produce the same number of characters. > > The first loop produces: > > Ten single-digit values of i which are repeated 1000 times for a total of > 1 characters; > > Ninety two-digit values of i which are repeated 500 times for a total of > 45000 characters; > > Nine hundred three-digit values of i which are repeated 333 times for a > total of 299700 characters; > > Nine thousand four-digit values of i which are repeated 250 times for a > total of 225 characters; > > Ninety thousand five-digit values of i which are repeated 200 times for > a total of 1800 characters. > > All that adds up to a grand total of 20604700 characters. > > Or, to condense the above long-winded text in table form: > > range num digits 1000/len(str(i)) total chars > 0-9 10 1 1000 1 > 10-99 90 2 500 45000 > 100-999 900 3 333 299700 > 1000- 9000 4 250 225 > 1-9 9 5 200 1800 > > grand total chars 20604700 > > The second loop yields this table: > > range num digits 5000/len(str(i)) total bytes > 0-9 10 1 5000 5 > 10-99 90 2 2500 225000 > 100-999 900 3 1666 1499400 > 1000- 9000 4 1250 1125 > 1-1 1 5 1000 1000 > > grand total chars 23024400 > > The two loops do not produce the same numbers of characters, so I'm not > surprised they do not consume the same amount of storage. > > P.S.: Please forgive me if I've made some basic math error somewhere. > > -- > John Gordon A is for Amy, who fell down the stairs > gor...@panix.com B is for Basil, assaulted by bears > -- Edward Gorey, "The Gashlycrumb Tinies" > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
Re: Memory Usage of Strings
Thanks Dan for the detailed reply. I suspect it is related to FreeBSD malloc/free as you suggested. Here is the output of running your script: [16-bsd01 ~/work]$ python strm.py --first USERPID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND amdev 6899 3.0 6.9 111944 107560 p0 S+9:57PM 0:01.20 python strm.py --first (python2.5) amdev 6900 0.0 0.1 3508 1424 p0 S+9:57PM 0:00.02 sh -c ps aux | egrep '\\<6899\\>|^USER\\>' amdev 6902 0.0 0.1 3380 1188 p0 S+9:57PM 0:00.01 egrep \\<6899\\>|^USER\\> [16-bsd01 ~/work]$ python strm.py --second USERPID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND amdev 6903 0.0 10.5 166216 163992 p0 S+9:57PM 0:00.92 python strm.py --second (python2.5) amdev 6904 0.0 0.1 3508 1424 p0 S+9:57PM 0:00.02 sh -c ps aux | egrep '\\<6903\\>|^USER\\>' amdev 6906 0.0 0.1 3508 1424 p0 R+9:57PM 0:00.00 egrep \\<6903\\>|^USER\\> (sh) Regards, Amit On Thu, Mar 17, 2011 at 3:21 AM, Dan Stromberg wrote: > > On Wed, Mar 16, 2011 at 8:38 AM, Amit Dev wrote: >> >> I'm observing a strange memory usage pattern with strings. Consider >> the following session. Idea is to create a list which holds some >> strings so that cumulative characters in the list is 100MB. >> >> >>> l = [] >> >>> for i in xrange(10): >> ... l.append(str(i) * (1000/len(str(i >> >> This uses around 100MB of memory as expected and 'del l' will clear that. >> >> >> >>> for i in xrange(2): >> ... l.append(str(i) * (5000/len(str(i >> >> This is using 165MB of memory. I really don't understand where the >> additional memory usage is coming from. >> >> If I reduce the string size, it remains high till it reaches around >> 1000. In that case it is back to 100MB usage. >> >> Python 2.6.4 on FreeBSD. >> >> Regards, >> Amit >> -- >> http://mail.python.org/mailman/listinfo/python-list > > On Python 2.6.6 on Ubuntu 10.10: > > $ cat pmu > #!/usr/bin/python > > import os > import sys > > list_ = [] > > if sys.argv[1] == '--first': > for i in xrange(10): > list_.append(str(i) * (1000/len(str(i > elif sys.argv[1] == '--second': > for i in xrange(2): > list_.append(str(i) * (5000/len(str(i > else: > sys.stderr.write('%s: Illegal sys.argv[1]\n' % sys.argv[0]) > sys.exit(1) > > os.system("ps aux | egrep '\<%d\>|^USER\>'" % os.getpid()) > > dstromberg-laptop-dstromberg:~/src/python-mem-use i686-pc-linux-gnu 10916 - > above cmd done 2011 Wed Mar 16 02:38 PM > > $ make > ./pmu --first > USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND > 1000 11063 0.0 3.4 110212 104436 pts/5 S+ 14:38 0:00 > /usr/bin/python ./pmu --first > 1000 11064 0.0 0.0 1896 512 pts/5 S+ 14:38 0:00 sh -c ps > aux | egrep '\<11063\>|^USER\>' > 1000 11066 0.0 0.0 4012 740 pts/5 S+ 14:38 0:00 egrep > \<11063\>|^USER\> > ./pmu --second > USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND > 1000 11067 13.0 3.3 107540 101536 pts/5 S+ 14:38 0:00 > /usr/bin/python ./pmu --second > 1000 11068 0.0 0.0 1896 508 pts/5 S+ 14:38 0:00 sh -c ps > aux | egrep '\<11067\>|^USER\>' > 1000 11070 0.0 0.0 4012 740 pts/5 S+ 14:38 0:00 egrep > \<11067\>|^USER\> > dstromberg-laptop-dstromberg:~/src/python-mem-use i686-pc-linux-gnu 10916 - > above cmd done 2011 Wed Mar 16 02:38 PM > > So on Python 2.6.6 + Ubuntu 10.10, the second is actually a little smaller > than the first. > > Some issues you might ponder: > 1) Does FreeBSD's malloc/free know how to free unused memory pages in the > middle of the heap (using mmap games), or does it only sbrk() down when the > end of the heap becomes unused, or does it never sbrk() back down at all? > I've heard various *ix's fall into one of these 3 groups in releasing unused > pages. > > 2) It mijght be just an issue of how frequently the interpreter garbage > collects; you could try adjusting this; check out the gc module. Note that > it's often faster not to collect at every conceivable opportunity, but this > tends to add up the bytes pretty quickly in some scripts - for a while, > until the next collection. So your memory use pattern will often end up > looking like a bit of a sawtooth function. > > 3) If you need strict memory use guarantees, you might be better off with a > language that's closer to the metal, like C - something that isn't garbage > collected is one parameter to consider. If you already have something in > CPython, then Cython might help; Cython allows you to use C datastructures > from a dialect of Python. > > > -- http://mail.python.org/mailman/listinfo/python-list
Online offline Python apps
Is there a best practice, tutorials, examples out there that demenstrates the best ways to create an offline mode of a python app that gets and sends its data to a remote database. I have tried creating my own via json API to mysql and using sqlalchemy SQLite and mysql. Everything I seem to come up with is buggy and or extremely ugly -- https://mail.python.org/mailman/listinfo/python-list
Django Calendar
Does anyone know of an easy to follow guide/tutorial to follow. I am trying to implement a calendar into my app that works as a job rota for employees. I have tried using django-scheduler and creating htmlcalendar but can not get either method to work -- https://mail.python.org/mailman/listinfo/python-list
python and ARM memory types
I am running python in the ARM architecture (arm64 to be exact). The CPU Arch I use has clusters (2 big cores in a cluster and 2 small cores in another cluster think : A57, A53). It's going to be run in Ubuntu 14.04 I am trying to run traffic that stresses the interconnects of the clusters. One example is dekker's algorithm : pin first process to 1 cluster and another process to another cluster and check the algo (using multiprocessing library). Also I am also trying to run "streaming" traffic - the kind of traffic that you don't want in the cache because it is non-temporal. But how do I specify (streaming,write-combining,write-back) memory types in python ? Is there a library that I can use ? I am thinking of programming some fixed memory space (say 0x1000_000 - 0x2000_000) as "WC or WT or streaming" using the OS and then try to use the mmap facility in python. What set of libraries can I use ? Where should I start ? Fixed memories are discouraged so what kind of alternatives I can use ? Thanks, Vox -- https://mail.python.org/mailman/listinfo/python-list
Minimal Python Build in Docker Container
Hello, I wanted to share what I've learned about making a reasonably minimal Docker image containing CPython built from source. Motivation: Many popular distros are not able to provide packaged builds of the desired Python version. Operators of co-tenanted Python services have struggled since the dawn of time to manage the Matrix of Hell with Python apps - system Python version versus versions required by different applications versus shared lib versions, etc. We have made due with "almost good enough" tools like virtualenv, pyenv, and Software Collections. In spite of this, many operators just gave up and decided every Python service ought to live inside its own virtual machine. To me, it seems like we finally have a real solution: Compile Python from source with the version and deps you need inside a Standard Container on top of the distro of your choosing. Disclaimer: I have never been involved in the Python project or in the packaging of Python libs for any distro, so excuse me if this is naive. If you, like me, have decided the key to sanity is in containerized Python services, you might try pulling the official Docker Python image: python 2.7.7 a87a2288ce782 weeks ago 1.041 GB Hmm, Python 2.7.8 has been out for over a month with "regression and security fixes over 2.7.7". Also, over 1 GB? The "debian:wheezy" image with Python 2.7.3 installed from apt-get weighs in at 124 MB. And finally, this image is running on top of a pre-release version of the as-yet unreleased debian jessie. So we have 3 very good reasons from staying away from the official Python Docker image. Let's build our own. We chose Centos 7 as the standard base for both Docker hosts and guest containers. Here's what I did: FROM centos:centos7 RUN yum install -y tar gcc make RUN mkdir /usr/src/python WORKDIR /usr/src/python RUN curl -Sl "https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz"; \ | tar -xJ --strip-components=1 # You may want to verify the download with gpg: https://www.python.org/download RUN ./configure \ && make -j$(nproc) \ && make install \ && make clean # Clean up prior to flattening RUN yum remove -y tar gcc make \ && yum clean all \ && rm -rf /usr/src/python Beginning with the 244 MB Centos 7 base image, this yields a 369 MB image after flattening, with a compiled Python 2.7.8. While +125 MB to the base is not terrible, it seems like the image could still lose some weight. Any ideas? If you would like to check out the built image, it is at marina/python:2.7.8_r1 on the public registry. Of course I recommend building your own with whatever makes sense for your "Python base" for production use! -- https://mail.python.org/mailman/listinfo/python-list
GeoBases V5 beta release
Hello! We just released the new beta version of GeoBases. For those who do not know GeoBases, this project provides tools to play with geographical data. It also works with non-geographical data, except for map visualizations :). There are embedded data sources in the project, but you can easily play with your own data in addition to the available ones. After data loading, you can: - perform various types of queries (find this key, or find keys with this property) - make fuzzy searches based on string distance (find things roughly named like this) - make phonetic searches (find things sounding like this) - make geographical searches (find things next to this place) - get results on a map, or on a graph, or export it as csv data, or as a Python object A few highlights of this new version: - sub-indexes - join clauses - better zsh autocomplete - sources admin mode - beginner's mode - phonetic search - graph display Get the code from Github https://github.com/opentraveldata/geobases Get the latest news from https://twitter.com/GeoBasesDev/ If you like it, share it! -- http://mail.python.org/mailman/listinfo/python-list
pwdmodule.c
I am trying to compile Python with cmake, but perhaps there are a few dependencies that have not been corrected for Windows compilation. Is pwdmodule.c supposed to be excluded for windows compilation? Are the makefiles the place to look to deduct which files are meant for which platforms? Henrik -- http://mail.python.org/mailman/listinfo/python-list
Re: pwdmodule.c
> > http://mail.python.org/pipermail/python-dev/2007-July/073912.html Thanks. I tried his files against trunk and it didn't work. -- http://mail.python.org/mailman/listinfo/python-list
Prevent Modification of Script?
Is it possible to prevent modification of a python file once its been deployed? File permissions of the OS could be used..but that doesn't seem very secure. The root of my question is verifying the integrity of the application and the scripts being run. Is this possible, if so, how? -- http://mail.python.org/mailman/listinfo/python-list
Re: Prevent Modification of Script?
On Apr 4, 6:10 pm, Michael Ekstrand <[EMAIL PROTECTED]> wrote: > One significant factor: are you worried about other > users on your systems (or other users who share systems with you under a > third party's control), or are you worried about what people will do on > their own systems? Michael, Ben & others: The short answer is others on a shared system, or malware that could modify the scripts. I'm new to python programming and there are just some paradigms I'm having trouble grasping. If the scripts can be modified (very easily), how can the application be trusted? i.e. If its an address book, then it would be trivial for malware to modify the script to override data or send it somewhere else... It would also seem like it makes user authentication through a password/ username, or encryption useless. The script could easily be modified to by-pass authentication and encryption could be disabled. Please correct any wrong assumptions that I might be making.. In a compiled application its not impossible to by pass the code.. but its not so easy. Perhaps this is just a side-effect of being a scripted language - not a flaw, just me trying to use it for something its not well suited for. - Kiel -- http://mail.python.org/mailman/listinfo/python-list
Re: Hide the python-script from user
On Apr 6, 3:19 pm, hlubenow <[EMAIL PROTECTED]> wrote: > recently there was a thread about hiding the python-script from the user. > The OP could use Interesting - thanks -- http://mail.python.org/mailman/listinfo/python-list
Getting Linux partition info programmatically
Hello everyone, I am trying to get a list of all the partitions (along with their respective file system types) listed in the /media directory. Does anybody know if there is a way to do this using Python, or do I have to get this information by parsing the output of a Linux command? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list
trying to improve my knn algorithm
This is a knn algorithm for articles that I have gotten. Then determines which category it belongs to. I am not getting very good results :/ k = 23 training_folder = './data/training/' minn_folder = training_folder + 'Minnesota/' health_folder = training_folder + 'Health/' def remove_punctuation(text): return regex.sub(r'\p{P}+', "", text) def file_list(folder): return [f for f in listdir(folder) if isfile(join(folder, f))] def all_file_list(): minn_files = file_list(minn_folder) for i in range(len(minn_files)): minn_files[i] = minn_folder + minn_files[i] health_files = file_list(health_folder) for i in range(len(health_files)): health_files[i] = health_folder + health_files[i] return minn_files + health_files def file_to_word_list(f): fr = open(f, 'r') text_read = fr.read() text = remove_punctuation(text_read) return text.split() def get_vocabularies(all_files): voc = {} for f in all_files: words = file_to_word_list(f) for w in words: voc[w] = 0 return voc def load_training_data(): all_files = all_file_list() voc = get_vocabularies(all_files) training_data = [] for f in all_files: tag = f.split('/')[3] point = copy.deepcopy(voc) words = file_to_word_list(f) for w in words: point[w] += 1 d = {'tag': tag, 'point': point} training_data.append(d) return training_data def get_distance(p1, p2): sq_sum = 0 for w in p1: if w in p2: sq_sum += pow(p1[w] - p2[w], 2) return math.sqrt(sq_sum) # This function is implemented for seeing insights of training data def show_distances(training_data): for i in range(len(training_data)): for j in range(i + 1, len(training_data)): print('d(' + str(i) + ',' + str(j) + ')=') print(get_distance(training_data[i]['point'], training_data[j]['point'])) print() for i in range(len(training_data)): print(training_data[i]['tag']) def test(training_data, txt_file): dist_list = [] txt = {} item = {} max_i = 0 words = file_to_word_list(txt_file) for w in words: if w in txt: txt[w] += 1 else: txt[w] = 1 for pt in training_data: item['tag'] = pt['tag'] item['distance'] = get_distance(pt['point'], txt) if len(dist_list) < k: dist_list.append(copy.deepcopy(item)) else: for i in range(1, k): if dist_list[i]['distance'] > dist_list[max_i]['distance']: max_i = i if dist_list[max_i]['distance'] > item['distance']: dist_list[max_i] = item vote_result = {} for d in dist_list: if d['tag'] in vote_result: vote_result[d['tag']] += 1 else: vote_result[d['tag']] = 1 # print(vote_result)# for testing result = dist_list[0]['tag'] for vote in vote_result: if vote_result[vote] > vote_result[result]: result = vote return result def main(txt): td = load_training_data() print(show_distances(td)) # show_distances(td)# for test usage only print('Category: ' + test(td, txt)) if __name__ == '__main__': main(sys.argv[1]) -- https://mail.python.org/mailman/listinfo/python-list
Your message to plucker-dev awaits moderator approval
Your mail to 'plucker-dev' with the subject Delivery ([EMAIL PROTECTED]) Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive notification of the moderator's decision. -- http://mail.python.org/mailman/listinfo/python-list
Your message to Reflex-dev awaits moderator approval
Your mail to 'Reflex-dev' with the subject Test Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL: http://reflex.dcc.uchile.cl/mailman/confirm/reflex-dev/0ad35f04f7a6585b804b0244f8706633fac538bd -- http://mail.python.org/mailman/listinfo/python-list